RAGStack / Guide

Everything you can do,
and exactly how.

Installation, configuration, the complete CLI surface, the HTTP API with its event catalog, sessions and recall, authentication, verticals and Docker.

Install

G1 · INSTALL
terminal
# recommended: uv
uv sync

# or pip
pip install ragstack

# optional extras
uv sync --extra neo4j   # Neo4j graph backend driver
uv sync --extra dev     # pytest + ruff for contributors

Pick a stack mode by copying config.example.yaml → ragstack.yaml: local (needs Ollama running), hybrid (local search + cloud LLM via OPENAI_API_KEY/ANTHROPIC_API_KEY) or cloud. Any OpenAI-compatible server (vLLM, LM Studio) works through llm.base_url.

CLI reference

G2 · COMMANDS
CommandWhat it does
ragstack index PATHS...

Index files/folders. Flags: -r recursive (default on), --enrich contextual blurbs, --graph/--no-graph, --force re-index unchanged files.

ragstack crawl URL

Crawl + index a site. --depth N --max-pages N; same-domain only, robots.txt respected.

ragstack query QUESTION

Ask. --mode picks one of eight strategies; --session ID enables follow-up memory; --no-cache bypasses the semantic cache; --no-stream prints a single answer; -k overrides top_k.

ragstack watch PATHS...

Poll paths every N seconds (--interval) and re-index whatever changed. Ctrl+C stops.

ragstack serve

Web console + HTTP API. --host/--port override config.

ragstack modes

The eight-mode catalog with tools/pipeline per mode (also GET /api/modes).

ragstack sessions

List conversation sessions with turn counts.

ragstack forget [SESSION]

Delete conversation turns (and all recall entries when no session given).

ragstack db NAME URL

Register a database for text-to-SQL (e.g. sqlite:///D:/data/app.db).

ragstack bench --docs N

Synthetic-corpus self-benchmark: indexing throughput, retrieval latency p50/p95, hit@k, MRR.

ragstack eval GOLDEN.yaml

Golden-set evaluation: hit@k, MRR, keyword pass-rate, optional LLM-judged faithfulness.

ragstack status / reset

Store counts and provider resolution / wipe all indexes, caches, memory.

Sessions & follow-up memory

G3 · MEMORY

Passing --session demo stores each question/answer pair. On later turns the system rewrites co-references into standalone queries before retrieval — "and its pricing?" becomes "what is the pricing of <subject>?". The original phrasing still reaches the generator so tone is preserved. Every answered pair is also embedded into the recall store so future sessions can find it via the agent's recall_memory tool.

terminal
ragstack query "summarize the supplier agreement" --session legal
ragstack query "and its termination notice period?" --session legal
ragstack sessions
ragstack forget legal

Tune retention with agent.memory_turns (turns kept per session); disable entirely with 0.

Verticals

G4 · DOMAINS

One line adapts chunking and answer discipline to a domain:

ragstack.yaml
vertical: legal   # medical | academic
VerticalTunes
legal

Smaller chunks (384/48); verbatim clause quoting; exact section/statute citations; binding vs recital distinction.

medical

512/96 chunks; population/intervention/dosage surfaced; uncertainty and limitations flagged explicitly.

academic

640/96 chunks; author-year attribution; results vs hypotheses vs speculation separated.

HTTP API

G5 · API
EndpointPurpose
POST /api/query

Body {question, mode, top_k?, use_cache?, session_id?}. Responds with an SSE stream of typed events.

POST /api/index

{paths[], recursive, enrich, graph, force} — returns per-file stats.

POST /api/crawl

{url, depth, max_pages}.

GET /api/status

Version, providers, store counts, memory/recall stats, auth flag.

GET /api/modes

The machine-readable mode catalog.

SSE event catalog

EventPayload highlights
start

mode, tool list, trace_id, cached flag

route

chosen route + full classification object (auto mode)

rewrite

original vs standalone rewritten query (session follow-ups)

tool_start / tool_end

name, arguments, truncated preview

retrieval

count, refs, verdict (direct modes)

answer

delta text (direct-mode streaming)

verification

claim manifest with per-claim verdicts

done

answer, citations[], steps[], confidence, manifest, abstained?, trace_id

clarify / error

clarifying question / failure message

Auth & Docker

G6 · OPERATE

Set server.auth_token (or env RAGSTACK_AUTH_TOKEN) to require Authorization: Bearer … on mutating endpoints. Loopback callers without a header remain frictionless; remote callers must present the token. The console UI prompts once and remembers.

terminal
docker compose up --build            # console at :8000
docker compose --profile neo4j up    # + Neo4j sidecar

Indexes persist in ./.ragstack; model caches in a named volume. Point the console's Data tab at paths inside the container.