Selecting Custom Table Names
Kern allows you to customize table names when using databases, providing flexibility in organizing your data storage.
Usage
Specify custom table names when initializing your database connection.
1from kern.agent import Agent2from kern.db.sqlite import SqliteDb34# Setup the SQLite database with custom table names5db = SqliteDb(6 db_file="tmp/data.db",7 # Selecting which tables to use8 session_table="agent_sessions",9 memory_table="agent_memories",10 metrics_table="agent_metrics",11)1213# Setup a basic agent with the SQLite database14agent = Agent(15 db=db,16 update_memory_on_run=True,17 add_history_to_context=True,18 add_datetime_to_context=True,19)2021# The Agent sessions and runs will now be stored in SQLite with custom table names22agent.print_response("How many people live in Canada?")23agent.print_response("And in Mexico?")24agent.print_response("List my messages one by one")