Skip to content

Conversation

@ygbingo
Copy link

@ygbingo ygbingo commented Jul 16, 2025

πŸ“ Description

This PR enhances the memory persistence mechanism in the graph builder by:

βœ… Default Behavior

  • Replaces the default in-memory MemorySaver with an SQLite-based checkpointer using langgraph-checkpoint-sqlite.
  • SQLite runs in local :memory: mode for dev/testing, ensuring persistence without external services.

πŸ› οΈ Multi-Database Support

  • Introduces configurable support for several database backends for checkpointing:
    • PostgreSQL (langgraph-checkpoint-postgres)
    • MongoDB (langgraph-checkpoint-mongodb)
    • Redis (langgraph-checkpoint-redis)
  • Backend selection and connection string setup are now driven by conf.yaml:
    CHECKPOINTER_MEMORY:
      db_type: "postgres"        # or "sqlite", "mongo", "redis"
      db_uri: "postgresql://user:pass@localhost:5432/dbname"

🧱 Code Structure

  • Refactored builder.py to dynamically instantiate checkpointer based on config.
  • Reorganized app.py to use the unified graph builder pattern with the new checkpointer.

πŸ“˜ Docs & Examples

  • Extended docs/configuration_guide.md with setup instructions for each supported DB.
  • Updated pyproject.toml and dependencies accordingly.

βœ… Benefits

  • Persistent agent memory across sessions.
  • Flexible deployment in cloud or local environments.
  • Easy extension for future database types.

@WillemJiang
Copy link
Collaborator

@ygbingo Thanks for the contribution. Please use 'make format' to reformat the code and fix the unit test errors.
BTW, we may need to give the user choice of using in memory store or persistant checkpoint through the configuration.

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.

3 participants