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.
PostgresStorage
docker run -d \ -e POSTGRES_DB=ai \ -e POSTGRES_USER=ai \ -e POSTGRES_PASSWORD=ai \ -e PGDATA=/var/lib/postgresql/data/pgdata \ -v pgvolume:/var/lib/postgresql/data \ -p 5532:5432 \ --name pgvector \ agno/pgvector:16
from agno.storage.postgres import PostgresStorage db_url = "postgresql+psycopg://ai:ai@localhost:5532/ai" # 使用 Postgres 数据库创建存储后端 storage = PostgresStorage( # 将会话存储在 agent_sessions 表中 table_name="agent_sessions", # db_url: Postgres 数据库 URL db_url=db_url, ) # 将存储添加到 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