Skip to content

feat: pluggable storage backends (memory, sqlite, postgres) - #6

Merged
AhmadHammad21 merged 2 commits into
mainfrom
feat/multi-backend-storage
May 6, 2026
Merged

AhmadHammad21 merged 2 commits into
mainfrom
feat/multi-backend-storage

Conversation

@AhmadHammad21

Copy link
Copy Markdown
Owner

Replace the single PostgreSQL db.py with a three-backend system selectable via CHECKPOINT_BACKEND env var:

  • memory — MemorySaver, zero config, no persistence (default)
  • sqlite — aiosqlite + langgraph-checkpoint-sqlite, auto-creates tables on first start, WAL mode, ideal for single-server use
  • postgres — existing psycopg3 + AsyncPostgresSaver, full production persistence

Introduces src/agent/db/ package (base ABC + three concrete backends). All existing callers remain unchanged — from agent.db import db still works.

Adds 42-test parametrised suite in tests/test_backends/ that runs every assertion against both memory and sqlite; postgres tests skip automatically unless DATABASE_URL is set.

Docs: docs/databases.md covers all three options, migration notes, Docker volume setup, and how to add a new backend.

Replace the single PostgreSQL db.py with a three-backend system
selectable via CHECKPOINT_BACKEND env var:

- memory  — MemorySaver, zero config, no persistence (default)
- sqlite  — aiosqlite + langgraph-checkpoint-sqlite, auto-creates
            tables on first start, WAL mode, ideal for single-server use
- postgres — existing psycopg3 + AsyncPostgresSaver, full production persistence

Introduces src/agent/db/ package (base ABC + three concrete backends).
All existing callers remain unchanged — `from agent.db import db` still works.

Adds 42-test parametrised suite in tests/test_backends/ that runs
every assertion against both memory and sqlite; postgres tests skip
automatically unless DATABASE_URL is set.

Docs: docs/databases.md covers all three options, migration notes,
Docker volume setup, and how to add a new backend.
@AhmadHammad21
AhmadHammad21 merged commit 49a17ac into main May 6, 2026
2 checks passed
@AhmadHammad21
AhmadHammad21 deleted the feat/multi-backend-storage branch May 6, 2026 21:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant