Skip to content
RAGRAF

Integrations

Connecting to agent environments

RAGRAF connects to any environment that speaks MCP (stdio, JSON-RPC): one server — 59 ragraf_* tools, one envelope contract, one telemetry. Environments differ in how they connect, in regimen and attribution. The AutoClaw and DeepSeek Harness pairings are debugged and confirmed by session measurements; the SagaAI connection is described from platform facts verified against the v1.13.1 code. Every environment has a full setup guide.

AutoClaw

--agent-kind autoclawOpen the guide

The agent environment of the RAGRAF author (zwork 2.0.2, Electron): the product was designed on it and the published results were measured on it. Connection runs over two independent channels — the CLI without configuration and MCP through the product interface; --agent-kind autoclaw is a real code path (telemetry attribution, extended journal mode). Everything in the guide is integration-session measurements and facts from the application code.

  1. Start with the CLI channel — it works without configurationThe first step of a task is python <repo>\tools\ragraf.py ensure <directory>, then index operations instead of reading files. The CLI depends neither on app settings nor on restarts and cannot "silently fall off". If there are no ragraf_* tools in the agent list, that is not a breakage: the index, search, schema and graphs remain fully operational through the CLI (session measurement: tool_search → 0).
  2. MCP is registered through the product interfaceMeasured: there is no file-based registration — no mcp.json or mcpServers in the profile, no server table in runtime.sqlite (all 106 tables checked). The server is entered in the project/application settings: the .venv interpreter, ragraf-mcp.py --agent AutoClaw --agent-kind autoclaw, working directory <repo>. --project is not needed: the corpus is resolved from the working directory, switching is ragraf_use_project.
  3. Skill into both accounts, rules into ~/.pi/agent/AGENTS.mdragraf-core is deployed into the skill tree of each account (source — docs/skills of the project; copy freshness is controlled by SHA-256). Section 8 of the user rules prescribes starting tasks with ensure and stays executable in both configurations — with MCP and without.
  4. Verify by measurement, not assumptiontool_search for ragraf: 0 before registration and 59 after the restart — that difference is the proof. Through the CLI: catalog (registry), ensure (status: actual), check (matching checksums). usage --agent AutoClaw shows ensure in the breakdown — the first-step rule is being followed.
MCP server registration — launch values
команда:            <repo>\.venv\Scripts\python.exe
аргументы:          <repo>\tools\ragraf-mcp.py
                    --agent AutoClaw --agent-kind autoclaw
рабочий каталог:    <repo>

Agent regimen

The rules live in ~/.pi/agent/AGENTS.md (section 8) and in the ragraf-core skill. Without MCP the "work through the shell" prescription keeps RAGRAF mandatory — only the invocation method changes.

Telemetry

usage_call writes agent=AutoClaw, kind=autoclaw. Extended attribution makes it possible to compare "before/after" sessions on the same corpus — the source of the published 14 versus 28/43 calls. ensure and use_project also land in the summary (Facade.record_external_call).

SagaAI

--agent-kind externalOpen the guide

An open platform for a team of AI employees (Streamlit, MIT, v1.13.1): assistants, autonomous orchestrators, the built-in DevAgent developer agent, knowledge bases and a skills library. The platform code has no MCP client — verified by a repository search — so RAGRAF connects through the platform native mechanisms: the ragraf-core skill and CLI calls via the run_code tool.

  1. Build the corpus once — shared by every employeeThe index is read-only for agents: several orchestrators and dialogs work with one corpus at the same time. The first step is ensure <project directory>.
  2. Install the ragraf-core skill into the libraryInstall from a GitHub URL, ZIP or folder (skills/skills.json registry; limits: 200 MB, 5000 files, 50 MB per file). A third-party skill does not reach the system prompt until DevAgent (Skill Developer) completes adaptation — mark_skill_adapted.
  3. Put the regimen into orchestrator instructionsThe five rules of the universal fragment are the minimal sufficient set; add them to the employee instructions (persisted across restarts) or to the project AGENT.md. Without a regimen agents fall back to search_in_files — immediately visible in the call statistics.
  4. CLI calls — via run_coderun_code executes commands in an isolated subprocess (300 s timeout; dangerous patterns only with UI confirmation): catalog, ensure, query symbol, check, usage --agent saga-worker. The agent reads the response text itself — no schema interpretation needed.
MCP config — forward-looking (no MCP client in v1.13.1)
{
  "mcpServers": {
    "ragraf": {
      "command": "python",
      "args": [
        "<repo>/tools/ragraf-mcp.py",
        "--agent", "saga-worker",
        "--agent-kind", "external"
      ]
    }
  }
}

Agent regimen

The universal regimen (fragment below) fits without changes. For multi-agent pipelines add an envelope hand-off rule between employees: every next stage must see stale_warnings.

Telemetry

Each employee writes its own agent=<name> under the shared kind=external. usage_stats groups calls by agent — who is "healthy" and who bypasses the index. Cross-check with the platform Statistics page by token usage.

DeepSeek Harness

--agent-kind externalMCP · stdio · JSON-RPCmcp__ragraf__ragraf_*verified by measurements · dsh 0.2.0-rc.2

The DeepSeek Harness 0.2.0-rc.2 Electron app with a built-in MCP client (the @deepseek-ai/dsh-mcp-client plugin). RAGRAF connects to it as an MCP server over stdio; its tools surface as mcp__ragraf__ragraf_*. The pairing was debugged end to end and confirmed by live-session measurements: everything below is reproducible commands, paths and measured outputs.

Installation — three steps

A patch block into the profile patch layer, the ragraf-core skill, a rule in the global AGENTS.md — all with backups; the patch is checked via dsh --dump-config without launching the app.

Verification — four levels

Scrubbed environment (ИТОГ: пройдено 13, провалено 0), a live headless run (tool_call/tool_result, rev-0043), skill loading, the project doctrine checker (checks: 16, errors: 0, warnings: 0, PASS).

Three limitations to know

Restarting the app is mandatory; a lingering Joern is possible after reindexing (java.exe ~3 GB, port 9500); reindex used to lose the run record in the registry — fixed with regression protection.

Full Harness setup guide

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: 59 инструментов 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
Connectionproduct interface + CLI without configurationskills library + CLI (run_code)profile patch layer (cordis.patch.yml)
Corpusauto by working directory + use_project-p <corpus>.yaml explicitly (CLI)auto by working directory + use_project
Regimen~/.pi/agent/AGENTS.md §8 + ragraf-core skillorchestrator instructions + ragraf-core skillragraf-core skill + AGENTS.md §6
Telemetryagent=AutoClaw · kind=autoclawper employee agent-name · kind=externalper agent-name (--agent / RAGRAF_AGENT)
Tools59 tools · list_capabilities59 tools · list_capabilities59 tools · list_capabilities
Verifiedsession measurements · zwork 2.0.2verified in platform code · v1.13.1live run · dsh 0.2.0-rc.2

The tool and envelope contract is shared by all three — they differ in how they connect, how the corpus is chosen and telemetry attribution. The tool contract in detail — in the wiki article The agent working regimen.