ragdag is a flat-file knowledge graph engine with three interfaces:
- A Bash CLI (
./ragdag) - A Python SDK (
import ragdag) - Server adapters (FastAPI HTTP + FastMCP)
It stores everything in a local .ragdag/ directory (chunks, edges, config, and processing metadata) and keeps the workflow simple: ingest files, search, ask, inspect graph links, and maintain store integrity.
ragdag- CLI entrypoint scriptlib/*.sh- Bash command implementationssdk/ragdag/- Python SDK (RagDag)engines/- embedding/search/LLM helpersserver/- HTTP API and MCP servertests/- pytest and bats test suitesdocs/- project documentation
./ragdag init
./ragdag add ./docs
./ragdag search "knowledge graph" --top 5
./ragdag ask "What does this project do?" --no-llm
./ragdag graphimport ragdag
dag = ragdag.init(".")
dag.add("./docs")
results = dag.search("knowledge graph", mode="hybrid", top=5)
answer = dag.ask("What does this project do?", use_llm=False)Primary commands exposed by ./ragdag:
init,add,search,askgraph,neighbors,trace,relate,linkconfig,serve,verify,repair,gc,reindex
Run ./ragdag help for full command and flag details.
Implemented in server/api.py.
GET /healthPOST /addPOST /searchPOST /askGET /graphGET /neighbors/{node_path}POST /linkGET /trace/{node_path}POST /relate
Implemented in server/mcp.py.
Tools:
ragdag_searchragdag_askragdag_addragdag_graphragdag_neighborsragdag_trace
Install editable package with extras as needed:
python3 -m pip install -e ".[all]"For testing workflows and commands, see docs/TESTING.md.