Singlestore
Use SingleStore for agent session storage and persistence.
Kern supports using Singlestore as a database with the SingleStoreDb class.
You can get started with Singlestore following their documentation.
Usage
1from os import getenv23from kern.agent import Agent4from kern.db.singlestore import SingleStoreDb56# Configure SingleStore DB connection7USERNAME = getenv("SINGLESTORE_USERNAME")8PASSWORD = getenv("SINGLESTORE_PASSWORD")9HOST = getenv("SINGLESTORE_HOST")10PORT = getenv("SINGLESTORE_PORT")11DATABASE = getenv("SINGLESTORE_DATABASE")12db_url = (13 f"mysql+pymysql://{USERNAME}:{PASSWORD}@{HOST}:{PORT}/{DATABASE}?charset=utf8mb4"14)1516# Setup your Database17db = SingleStoreDb(db_url=db_url)1819# Create an agent with SingleStore db20agent = Agent(db=db)Params
| Parameter | Type | Default | Description |
|---|---|---|---|
id | Optional[str] | - | The ID of the database instance. UUID by default. |
db_engine | Optional[Engine] | - | The SQLAlchemy database engine to use. |
db_schema | Optional[str] | - | The database schema to use. |
db_url | Optional[str] | - | The database URL to connect to. |
session_table | Optional[str] | - | Name of the table to store Agent, Team and Workflow sessions. |
memory_table | Optional[str] | - | Name of the table to store memories. |
metrics_table | Optional[str] | - | Name of the table to store metrics. |
eval_table | Optional[str] | - | Name of the table to store evaluation runs data. |
knowledge_table | Optional[str] | - | Name of the table to store knowledge content. |
traces_table | Optional[str] | - | Name of the table to store traces. |
spans_table | Optional[str] | - | Name of the table to store spans. |