Nahuali
Local-first memory for AI agents with evidence-backed recall, deterministic trust verdicts, self-inspection, and a tamper-evident audit history.
README
<p align="center"> <img src="assets/nahuali-cover.webp" alt="Nahuali, governed and verifiable memory for AI agents" width="100%"> </p>
Nahuali
The trust layer for agent memory. Nahuali shows what a memory is based on, whether it is safe to use, and when an agent should refuse it.
<p align="center"> <a href="https://github.com/Arakiss/nahuali/actions/workflows/ci.yml"><img src="https://github.com/Arakiss/nahuali/actions/workflows/ci.yml/badge.svg?branch=main&event=push" alt="Tests"></a> <a href="https://codecov.io/gh/Arakiss/nahuali"><img src="https://codecov.io/gh/Arakiss/nahuali/branch/main/graph/badge.svg" alt="Coverage"></a> <a href="https://github.com/Arakiss/nahuali/releases"><img src="https://img.shields.io/badge/release-0.8_beta-blue.svg" alt="Latest release train: 0.8 beta"></a> <a href="LICENSE"><img src="https://img.shields.io/badge/license-FSL--1.1--MIT-yellow.svg" alt="FSL-1.1-MIT license"></a> <a href="Cargo.toml"><img src="https://img.shields.io/badge/rust-2024_edition-orange.svg" alt="Rust 2024 edition"></a> <img src="https://img.shields.io/badge/platform-macOS_%7C_Linux-5d6d7e.svg" alt="macOS and Linux"> <a href="https://registry.modelcontextprotocol.io/v0.1/servers?search=io.github.Arakiss%2Fnahuali"><img src="https://img.shields.io/badge/MCP_Registry-published-6f5bd3.svg" alt="Published in the official MCP Registry"></a> <img src="https://img.shields.io/badge/default-local--first-3f7f6c.svg" alt="Local-first by default"> <a href="RELEASE_VERIFICATION.md"><img src="https://img.shields.io/badge/releases-Sigstore_signed-2f6f4e.svg" alt="Sigstore-signed release artifacts"></a> <a href=".github/workflows/sbom.yml"><img src="https://img.shields.io/badge/SBOM-CycloneDX-4c6ef5.svg" alt="CycloneDX software bill of materials"></a> <a href="TRUST_MODEL.md"><img src="https://img.shields.io/badge/ledger-tamper--evident_by_default-8b5cf6.svg" alt="Tamper-evident ledger by default"></a> </p>
Most memory systems optimize for finding relevant context. Nahuali asks the question that comes next: should the agent trust what it found?
It records observations, claims, relationships, procedures, and intentions in an append-only ledger. Recall can return the supporting evidence and a deterministic trust verdict. Self-inspection finds unsupported, stale, or contradictory memory without silently rewriting it. The default ledger is hash chained, and an operator can sign its tip to detect a fully rewritten history.
Nahuali is local-first, source-available, and in public beta.
<p align="center"> <img src="assets/nahuali-tui.png" alt="Nahuali explore showing memory, evidence, trust verdicts, ledger integrity, governance signals, and the nahual mascot" width="100%"> </p>
<p align="center"><sub><code>nahuali explore</code>: inspect what the agent remembers, why it trusts it, and whether the ledger is intact. The nahual in the bottom-right corner mirrors the current trust verdict and moves without obscuring the cockpit.</sub></p>
Quickstart
Install the signed macOS or Linux binaries:
curl -fsSL https://raw.githubusercontent.com/Arakiss/nahuali/main/scripts/install.sh | sh
export PATH="$HOME/.nahuali/bin:$PATH"
Record an observation, derive a claim from it, and inspect the result:
nahuali remember "Lena owns the release notes" --mention Lena --tag product
nahuali claim Lena owns "release notes" --source-last --confidence 0.92
nahuali recall "Who owns the release notes?" --authority --json
nahuali self-inspect --json
This is real persistent memory. The default store lives under
~/.nahuali/data, survives process restarts, and needs no Docker, database
server, model, account, or API key. Set NAHUALI_DB_URL when you want a shared
remote SurrealDB deployment instead.
After upgrading Nahuali, restart any application that keeps nahuali-mcp
running. This ensures the CLI and the long-lived MCP server open the embedded
store with the same engine version.
For a narrated integrity example with no writes, run:
nahuali demo
That command explains the hash chain and signed checkpoint without changing
your store. The end-to-end demo below is a separate, reproducible product flow.
From a source checkout, run scripts/run-launch-demo.sh verify. It creates a
disposable store, follows it through the CLI, TUI, and a real MCP tool call, then
asserts the expected results.
An evidence-backed claim can drive action. A competing unsourced claim is retained but blocks action, and self-inspection explains the contradiction without silently rewriting the ledger.
<p align="center"> <img src="assets/nahuali-demo.gif" alt="Nahuali showing evidence-backed recall across CLI, TUI, and MCP, then blocking an unsupported contradiction without rewriting memory" width="100%"> </p>
Why this is different
| Memory failure | Nahuali response |
|---|---|
| A relevant claim has no source | Return it as unsafe, not as a trusted fact |
| Good and weak memories are mixed together | Give each result its own evidence and verdict |
| Claims conflict or become stale | Surface the affected records for explicit review |
| A model proposes a repair | Validate the evidence and append an audited repair event |
| A historical record is edited | Break the ledger chain at the next record |
| The history is rewritten and re-chained | Refuse the old operator-signed checkpoint |
The four trust modes are deterministic:
certify: the available checks support using the result.advisory: useful as a lead, but not safe to state without qualification.warn: evidence or health problems require verification.block: the result must not drive action until the conflict is resolved.
A verdict does not prove that remembered content is true. It makes the reason for trust inspectable: evidence, provenance, confidence, freshness, contradictions, and ledger integrity. The exact guarantees and limits live in the trust model.
Use it from an agent
Nahuali ships a stdio MCP server with tools for capture, recall, inspection, review, repair, intentions, backup, and ledger verification.
Run nahuali init to install the bundled skill where supported and print a
native-binary MCP configuration. The server is also published as
io.github.Arakiss/nahuali in the official MCP Registry and as an OCI image:
{
"mcpServers": {
"nahuali": {
"command": "docker",
"args": [
"run", "--rm", "-i",
"-v", "nahuali-data:/data",
"ghcr.io/arakiss/nahuali-mcp:latest"
]
}
}
}
The named volume keeps memory across container restarts. See MCP onboarding for native and container configurations.
The trust loop
flowchart LR
A[Observed episode] -->|evidence| B[Claim or link]
B --> C[Authority-aware recall]
C --> D{Trust verdict}
D -->|certify| E[Use with evidence]
D -->|advisory, warn, block| F[Inspect and review]
F --> G[Explicit repair or resolution]
G --> H[Append-only audit event]
H --> C
The deterministic core never calls an LLM. A model may propose a repair, but the engine classifies, gates, and records it. Contradictions are never silently overwritten.
Interfaces
| Interface | Purpose | Reference |
|---|---|---|
nahuali |
Local workflow for agents, operators, audits, backup, and migration | CLI |
nahuali-mcp |
Structured tools and resources for MCP clients | MCP |
nahuali-api |
Local HTTP integrations with an OpenAPI contract | HTTP API |
nahuali-core |
Deterministic Rust engine and public data contracts | Core |
The local HTTP API is unauthenticated. Do not expose it to an untrusted network. Nahuali does not currently provide accounts, hosted sync, billing, or a managed control plane.
Storage
SurrealDB's memory_record table is the source of truth. Current memory, graph
tables, snapshots, and semantic vectors are derived and rebuildable.
- Embedded SurrealKV is the zero-service default.
- A remote SurrealDB endpoint supports shared deployments.
- Qdrant is optional and used only for semantic recall.
- Deterministic lexical recall works without Qdrant or a model.
reconcileverifies the ledger and rebuilds derived data.- Backup and restore operate on the authoritative record ledger.
The embedded store has one process owner. A long-running MCP or HTTP server owns the local store while it is active; a second process fails clearly instead of waiting or risking concurrent writes. Use remote SurrealDB when several independent processes need the same memory.
Reproducible evidence
The governance benchmark suite tests provenance coverage, contradiction and staleness detection, trust-verdict calibration, ledger tampering, and attestation recovery against checked-in fixtures.
The vendor-neutral Agent Memory Trust Benchmark defines an adapter contract for comparing these capabilities across memory systems. It reports each capability separately and keeps failures and unsupported controls visible.
Run Nahuali's release gate:
bash scripts/verify-governance-benchmarks.sh
bash scripts/verify-controlled-beta.sh
NAHUALI_VERIFY_GITHUB_SETTINGS=1 bash scripts/security-supply-chain-check.sh
Beta limits
- APIs and storage behavior may still change before 1.0.
- Self-inspection proposes work but never writes automatically.
- Evidence proves traceability, not factual truth.
- The operator must retain a trusted signed checkpoint to detect rollback or a fully re-chained history.
- Scope labels separate memory contexts but are not access-control boundaries.
- Semantic recall requires an optional Qdrant service; the default lexical path does not.
Read BETA.md before using irreplaceable data.
Build from source
cargo build --workspace
cargo test --workspace
cargo install --path crates/nahuali-cli --locked
cargo install --path crates/nahuali-mcp --locked
cargo install --path crates/nahuali-api --locked
Docker is only needed for the optional remote development stack and Qdrant:
docker compose up -d
More documentation
- Trust model
- Release verification
- Self-repair contract
- Governance benchmarks
- Security policy
- Contributing
Questions, use cases, and design feedback belong in GitHub Discussions. Bugs and benchmark contributions have structured issue templates.
License
Nahuali uses the Functional Source License 1.1 with an MIT future grant. Each release converts to MIT two years after its release date.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。