Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
You are viewing v1 docs. For the latest documentation, visit docs.agno.com
SingleStoreStorage
from os import getenv from sqlalchemy.engine import create_engine from agno.agent import Agent from agno.storage.singlestore import SingleStoreStorage # SingleStore Configuration USERNAME = getenv("SINGLESTORE_USERNAME") PASSWORD = getenv("SINGLESTORE_PASSWORD") HOST = getenv("SINGLESTORE_HOST") PORT = getenv("SINGLESTORE_PORT") DATABASE = getenv("SINGLESTORE_DATABASE") SSL_CERT = getenv("SINGLESTORE_SSL_CERT", None) # SingleStore DB URL db_url = f"mysql+pymysql://{USERNAME}:{PASSWORD}@{HOST}:{PORT}/{DATABASE}?charset=utf8mb4" if SSL_CERT: db_url += f"&ssl_ca={SSL_CERT}&ssl_verify_cert=true" # Create a database engine db_engine = create_engine(db_url) # Create a storage backend using the Singlestore database storage = SingleStoreStorage( # store sessions in the ai.sessions table table_name="agent_sessions", # db_engine: Singlestore database engine db_engine=db_engine, # schema: Singlestore schema schema=DATABASE, ) # Add storage to the Agent agent = Agent(storage=storage)
table_name
str
schema
Optional[str]
"ai"
db_url
None
db_engine
Optional[Engine]
schema_version
int
1
auto_upgrade_schema
bool
False
true
Was this page helpful?