Getting Started

Install

With PDM:

pdm install -G :all

With pip:

pip install "sqldbagent[cli,postgres,langchain,langgraph,mcp,dashboard,docs,test]"

Start Local Infra

make up
make demo-migrate

That raises the local integration stack declared in infra/compose.integration.yaml, including the demo Postgres database and Qdrant.

Common First Commands

pdm run sqldbagent config validate
pdm run sqldbagent inspect tables postgres_demo --schema public
pdm run sqldbagent snapshot create postgres_demo public
pdm run sqldbagent profile unique-values postgres_demo customers segment --schema public
pdm run sqldbagent prompt export postgres_demo public
make dashboard-demo

The demo dashboard prefers durable Postgres checkpointing and durable Postgres-backed long-term memory when local persistence configuration is present, and it will tell you when it has to fall back to session-only memory.

The current dashboard flow gives you:

  • chat over the persisted LangGraph-backed agent

  • schema inspection through an interactive graph plus generated PNG/SVG fallback output when Mermaid rendering is unavailable

  • prompt review with token-budget breakdowns for the base prompt, final system prompt, saved enhancement, and live explored context

  • live prompt exploration that saves additional read-only database context back into the prompt artifact and can sync concise schema notes into long-term memory

  • retrieval-index management for the active saved snapshot, even when the current thread state has not populated snapshot identifiers yet

  • guarded query execution with read-only default behavior

What to Expect

  • Snapshots are stored under var/sqldbagent/snapshots/<datasource>/<schema>/.

  • Document bundles are stored under var/sqldbagent/documents/<datasource>/<schema>/.

  • Prompt bundles are stored under var/sqldbagent/prompts/<datasource>/<schema>/.

  • Retrieval manifests are stored under var/sqldbagent/vectorstores/<datasource>/<schema>/.