Skip to content
RAGRAF

Integrations

Connecting to agent environments

RAGRAF connects to any environment that speaks MCP (stdio, JSON-RPC): one server — 23 ragraf_* tools, one envelope contract, one telemetry. Environments differ in regimen and attribution, not mechanics. Below: step-by-step scenarios for AutoClaw, SagaAI and DeepSeek Harness.

AutoClaw

--agent-kind autoclawMCP · stdio · JSON-RPC

The agent environment of RAGRAF's author: the product was designed on it and the published results were measured on it. First-class support — the --agent-kind autoclaw value is a real code path (telemetry attribution, extended journal mode).

  1. Install RAGRAF and build the corpusStandard install (install.ps1 or pip -e .), then ragraf ensure <project> --json. AutoClaw works with the same corpus as the CLI — no separate preparation needed.
  2. Register the MCP server in the environment configAutoClaw spawns the server as a child stdio process. The key difference from other environments — --agent-kind autoclaw: telemetry gains extended session attribution.
  3. Attach the regimen and skillPut the AGENTS.md regimen into the environment context (or use the shipped skill): the "ask the index → check the envelope → write_check before writes" order is the measured source of the published results (46 calls, 0 full reads).
  4. Verify and observeRun the verify commands on the right; then watch the call profile in usage_stats or the panel: a healthy profile is symbol/search/write_check dominance and zero full file reads.
MCP config — AutoClaw
{
  "mcpServers": {
    "ragraf": {
      "command": "python",
      "args": [
        "/path/to/RAGRAF/tools/ragraf-mcp.py",
        "--project", "/path/to/corpus.yaml",
        "--agent", "autoclaw-main",
        "--agent-kind", "autoclaw"
      ]
    }
  }
}

Agent regimen

The repository regimen applies as is — it was written for AutoClaw. The fragment below can be pasted into the environment system prompt unchanged.

Telemetry

usage_call records agent=autoclaw-main, kind=autoclaw. Extended attribution enables before/after session comparisons on one corpus — this is how the published 14 vs 28/43 calls were obtained.

SagaAI

--agent-kind externalMCP · stdio · JSON-RPC

A multi-agent environment supporting the MCP protocol. Connection goes through the universal stdio contract: RAGRAF requires nothing from SagaAI beyond the ability to spawn a child process and exchange JSON-RPC.

  1. Build the corpus once — let all workers use itThe index is read-only for agents: multiple SagaAI workers can hit one corpus through one server (or their own instances — stores open read-only safely).
  2. Add the server to the environment MCP configConfig below; name --agent meaningfully by worker role (saga-worker, saga-reviewer) — telemetry will separate call profiles per agent.
  3. Put the regimen into the system promptThe five rules of the AGENTS.md fragment below are the minimal sufficient set. Without a regimen, agents tend to ignore the index and fall back to grep — immediately visible in usage_stats.
  4. Check capability before planning tasksMake ragraf_list_capabilities the first call of a session: under capability=degraded the SagaAI planner must exclude tasks requiring slice (interprocedural slices).
MCP config — SagaAI
{
  "mcpServers": {
    "ragraf": {
      "command": "python",
      "args": [
        "/path/to/RAGRAF/tools/ragraf-mcp.py",
        "--project", "/path/to/corpus.yaml",
        "--agent", "saga-worker",
        "--agent-kind", "external"
      ]
    }
  }
}

Agent regimen

The universal regimen (fragment below) applies unchanged. For multi-agent pipelines add an envelope hand-off rule: every next stage must see stale_warnings.

Telemetry

Each worker records its own agent=<name> under the shared kind=external. usage_stats groups calls per agent — showing which worker is "healthy" and which bypasses the index.

DeepSeek Harness

--agent-kind externalMCP · stdio · JSON-RPC

The harness wrapping DeepSeek models (deepseek-chat / deepseek-reasoner) with MCP tool support. Connection is standard; the pairing's peculiarity — reasoner models follow the fixed operations contract disciplinately, so the regimen is observed more strictly than the market average.

  1. Prepare the corpus and run selftestAs everywhere: ragraf ensure <project> --json and ragraf selftest. The harness requires nothing beyond Python 3.13+ from the environment.
  2. Register the server in the harness configConfig below — universal MCP stdio. --agent deepseek-harness separates harness session telemetry from manual CLI runs.
  3. Enable strict envelope mode for the reasoner modelPairing recommendation: require the model in the system prompt to quote index_rev and capability in every answer — reasoners reliably honor this, making answers auditable without extra checks.
  4. Check the call profile after the first sessionsusage_stats: the expected healthy profile — symbol/search/write_check dominate, whole-file live_grep absent. A deviation signals tightening the regimen in the prompt.
MCP config — DeepSeek Harness
{
  "mcpServers": {
    "ragraf": {
      "command": "python",
      "args": [
        "/path/to/RAGRAF/tools/ragraf-mcp.py",
        "--project", "/path/to/corpus.yaml",
        "--agent", "deepseek-harness",
        "--agent-kind", "external"
      ]
    }
  }
}

Agent regimen

The regimen below works unchanged. For deepseek-reasoner it helps to add a "one question — one operation" rule: the model tends toward long reasoning chains and saves tokens on precise single calls.

Telemetry

Telemetry is identical to other external agents: agent=deepseek-harness, kind=external, argument hashes instead of full query texts. The token estimate (chars/4) in usage_call lets you compare the pairing's economics against the grep approach.

Any MCP client

Your environment is not listed? If the client can spawn a stdio process and speak JSON-RPC — that is enough. Three steps: server config, regimen into the system prompt, capabilities check as the first call.

Regimen for the system prompt

AGENTS.md — fragment
# Регламент работы с RAGRAF (фрагмент AGENTS.md)
1. Навигация — только через ragraf_symbol / ragraf_search.
   Полный файл — только ragraf_live_read и только по факту из индекса.
2. Проверяй конверт: stale_warnings → перечитай затронутое (live_read);
   capability=degraded → не планируй задачи со slice.
3. Перед любой записью в БД — ragraf_write_check (всегда).
4. Перед правкой символа — ragraf_impact --depth 3.
5. «Не найдено» — валидный ответ: сообщай limits из конверта, не додумывай.

Connection verification

verify
# сервер отвечает на инициализацию MCP и раскрывает режим корпуса
python tools/ragraf-mcp.py --project corpus.yaml --agent probe --agent-kind external
# → JSON-RPC: 23 инструмента ragraf_*; list_capabilities:
#   {"capability":"full","operations":[...22...]}   (или degraded + reason)

# телеметрия после пробных вызовов
ragraf -p corpus.yaml query usage_stats
# → usage_call содержит записи agent=probe, kind=external

Connection comparison

Connection comparison
AutoClaw SagaAI DeepSeek Harness
agent-kindautoclawexternalexternal
Regimenshipped AGENTS.md/skilluniversal regimenuniversal + envelope quoting
Telemetryextended session attributionper worker agent-nameper session agent-name
Tools23 tools · list_capabilities23 tools · list_capabilities23 tools · list_capabilities
Verifiedmeasured published resultsuniversal MCP contractuniversal MCP contract

The connection mechanics are identical for all three — telemetry attribution and regimen recommendations differ. The tool contract in detail — in the wiki article The agent working regimen.