-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
Summary
Implement a PostgreSQL backend for storage, complementing the existing in-memory and file-based storage options.
Requirements
- Add a PostgreSQL store that implements the same interface as the existing memory and file stores
- Connection configured via CLI flag (e.g.
--store postgres://...) or environment variable - Support all existing store interfaces: Agent, Session, Credential, Server
- Handle concurrent access safely (multiple server instances sharing the same database)
- Include database migrations for schema setup (auto-migrate on startup or via a separate command)
Schema Considerations
sessionstable: id, name, provider, model, system_prompt, labels (JSONB), created_at, modified_atmessagestable: id, session_id (FK), role, content (JSONB for multi-part content blocks), tool_calls (JSONB), created_at- Use JSONB for flexible content storage (text, attachments, tool calls/responses)
- Index on labels for efficient label-based lookups
- etc.
Motivation
In-memory storage is lost on restart. File storage works for single instances but doesn't support multiple server replicas or easy backup/querying. PostgreSQL provides durable, queryable, multi-instance-safe storage.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels