relay-knowledge
relay-knowledge is a local-first knowledge substrate for graph-backed
retrieval. It stores evidence, graph facts, code-repository structure, derived
indexes, freshness state, diagnostics, audit records, and agent-facing context
packs. It is not a general agent runtime or a final-answer generator.
Quick Start
The default local profile needs no external service: platform defaults select the runtime directories, SQLite stores local state, and deterministic local semantic/vector read models are enabled.
Use JSON for scripts and agent integrations:
Installing Releases
GitHub Releases
provide prebuilt archives for Linux x64/ARM64, macOS Intel/Apple Silicon, and
Windows x64/ARM64. Verify the selected archive with checksums.txt before
putting the binary on PATH; GitHub artifact attestations cover the same
archive digests. Linux GNU archives target a glibc 2.31 baseline.
Rust users can install from crates.io:
Each release also publishes relay-knowledge-cli-skill-<tag>.tar.gz for agents
that use the CLI instead of MCP/ACP. See the
CLI skill package and the
installation, release, and upgrade contract
for platform details, verification, service installation, upgrade, rollback,
and uninstall behavior.
Capability Snapshot
- Hybrid GraphRAG context packs combine BM25, local or external semantic/vector retrieval, graph evidence, freshness, bounded context, and ranking explanations.
- Structured evidence, entities, relations, claims, events, source spans, confidence, graph versions, and accepted/proposed grounding remain traceable.
- Repository workflows cover registration, tree-sitter indexing, full and incremental refresh, worktree overlays, symbols, references, calls, imports, context, impact, feature flags, SBOM evidence, and multi-repository sets.
- Durable bounded queues, leases, checkpoints, backpressure, recovery, and observable maintenance protect long-running indexing and background work.
- Software-wide projections and authorized local-file indexing expose dependencies, SDKs, files, topics, build/IaC/design evidence, and relationships without query-time repository scans.
- CLI, Web, MCP Streamable HTTP, and local ACP modes share the same application behavior, scope policy, QoS, cancellation, audit, and diagnostics.
Detailed behavior, limits, and implementation ownership belong in the linked responsibility-specific documentation, not in this navigation page.
Documentation
| Area | Entry point |
|---|---|
| Complete bookshelf | English documentation |
| User workflows | User Guide |
| Implemented behavior | Capabilities |
| Architecture contracts | Architecture Specifications |
| Mandatory engineering rules | Engineering Hard Constraints |
| Research and external evidence | Research |
| Performance and self-iteration contracts | Benchmarks |
| Auditable verification records | Verification |
Two development-loop chapters have distinct responsibilities:
- Chapter 24: Code-Map-Backed Knowledge Development Loop
- Chapter 27: Business Knowledge to Technical Graph Mapping is the executable operating contract.
- Chapter 26: Git Commit + Knowledge Development Philosophy and Iteration Loop explains the commit fact boundary, derived knowledge, decision context, recovery model, and human-agent handoff philosophy.
Essential CLI Workflows
The machine-readable help surface is the command contract:
Create and query knowledge:
Register, index, and query a code repository:
Indexing returns a durable task and makes progress observable through
repo status. If a one-shot CLI cannot finish a large cold index before the
caller times out, inspect status and use the bounded task worker or managed
service recovery path documented in
Code Repository Graph Workflow.
Do not start unmanaged loops or competing writers.
Query a resident service without opening unrelated local state:
The full grammar, command-local --kind values, JSON schemas, read/write
effects, and environment precedence are in the
CLI Command Reference.
Resident Service and Agent Access
Start the shared Web/API service and opt into MCP Streamable HTTP:
RELAY_KNOWLEDGE_MCP_ALLOWED_SCOPES=docs \
The default Web endpoint is http://127.0.0.1:8791/; the MCP endpoint is
http://127.0.0.1:8791/mcp. MCP is disabled unless requested, and graph tools
require an allowed scope or an explicitly registered repository alias.
See Web Workspace, MCP and Agent Access, and Resident Service for session, authorization, cancellation, audit, service-manager, and diagnostics guidance.
Development
Use the repository scripts by responsibility:
The principal local quality gates are:
Architecture boundaries, async and resource-budget requirements, unit-test coverage, documentation completeness, and the requirement that hand-written files stay below 1,000 lines are mandatory in Engineering Hard Constraints.
Self-Iteration Harness
The independent Rust harness for retrieval and indexing optimization is documented in tools/self_iteration:
The default fast profile builds and evaluates the release product binary with
focused gates and workload guardrails. Use
./self-iterate.sh once --profile full for the complete rails and workloads.
Run history, reports, patches, and resume state stay under
.git/relay-knowledge-self-iteration/. The harness documentation also records
the exact pinned commits and reproducible detached-checkout preparation for
external repositories.
Browser Checks
Runtime data, configuration, indexes, logs, and caches belong in the documented platform directories, not in the repository. Do not commit secrets, local databases, private datasets, or generated build output. See Installation and Runtime Directories.
Optional local hooks: pre-commit install and
pre-commit run --all-files.