SQLite

Use SQLite for local agent session storage.

Kern supports using Sqlite as a database with the SqliteDb class.

Usage

1from kern.agent import Agent
2from kern.db.sqlite import SqliteDb
3
4# Setup the SQLite database
5db = SqliteDb(db_file="tmp/data.db")
6
7# Setup a basic agent with the SQLite database
8agent = Agent(db=db)

Params

ParameterTypeDefaultDescription
idOptional[str]-The ID of the database instance. UUID by default.
db_engineOptional[Engine]-The SQLAlchemy database engine to use.
db_urlOptional[str]-The database URL to connect to.
db_fileOptional[str]-The database file to connect to.
session_tableOptional[str]-Name of the table to store Agent, Team and Workflow sessions.
memory_tableOptional[str]-Name of the table to store user memories.
metrics_tableOptional[str]-Name of the table to store metrics.
eval_tableOptional[str]-Name of the table to store evaluation runs data.
knowledge_tableOptional[str]-Name of the table to store knowledge documents data.
traces_tableOptional[str]-Name of the table to store traces.
spans_tableOptional[str]-Name of the table to store spans.