# Rta Smriti Brain

> Local-first, evidence-aware project memory for AI coding agents.

- **Type:** MCP server
- **Install:** `agentstack add mcp-sulabhdubey-rta-smriti-brain`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [sulabhdubey](https://agentstack.voostack.com/s/sulabhdubey)
- **Installs:** 0
- **Category:** [Databases](https://agentstack.voostack.com/c/databases)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [sulabhdubey](https://github.com/sulabhdubey)
- **Source:** https://github.com/sulabhdubey/rta-smriti-brain
- **Website:** https://sulabhdubey.github.io/rta-smriti-brain/

## Install

```sh
agentstack add mcp-sulabhdubey-rta-smriti-brain
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# Rta-Smriti Brain

## v1.0.4-alpha

`v1.0.4-alpha` is the current maintenance prerelease for the v1 release line.
It preserves the v1 Project Reality boundary, authorization recovery, and safe
schema diagnostics while isolating installed CLI and MCP launchers from an old
checkout in the current working directory. See the
[release notes](docs/RELEASE_NOTES_v1.0.4-alpha.md)
and bounded [verification ledger](docs/RELEASE_VERIFICATION.md).

v1 turns the brain from a searchable index into an inspectable project-reality
layer. A deterministic Project Cognition projection reconciles indexed sources,
bitemporal truth, observations, structured work state, decisions, and local
multimodal evidence. It reports readiness, coverage, change impact, conflicts,
and decision debt under explicit output budgets. It does not execute project
work, route models, or replace an agent harness.

[](https://github.com/sulabhdubey/rta-smriti-brain/actions/workflows/ci.yml)
[](https://github.com/sulabhdubey/rta-smriti-brain/actions/workflows/binaries.yml)
[](https://github.com/sulabhdubey/rta-smriti-brain/releases)
[](LICENSE)

**A sovereign local project-memory and evidence layer for AI coding agents. The `v1.0.4-alpha` release preserves deterministic Project Reality while isolating installed launchers from stale checkout code.**

**Build provenance:** Conceived and researched by [Sulabh Dubey](https://github.com/sulabhdubey). Built with [OpenAI Codex](https://openai.com/codex/) as the primary design, engineering, testing, and documentation agent under Sulabh's product direction and release approval. [Details](CONTRIBUTORS.md).

Rta-Smriti now connects repository intelligence, durable decisions, agent-session continuity, and evidence-aware retrieval through a private local event journal. Capture is opt-in, bounded, redacted before durable queuing, and explicitly treated as untrusted evidence until an operator or verifier promotes a claim.

[Current release: v1.0.4-alpha](https://github.com/sulabhdubey/rta-smriti-brain/releases/tag/v1.0.4-alpha) · [Release notes](docs/RELEASE_NOTES_v1.0.4-alpha.md) · [Live website](https://sulabhdubey.github.io/rta-smriti-brain/) · [60-second v1 product demo (captured from v1.0.2)](launch-assets/product-hunt/rta-smriti-v1.0.2-product-demo.mp4) · [Installation](docs/INSTALLATION.md) · [Usage guide](docs/USAGE_GUIDE.md) · [Architecture](docs/ARCHITECTURE.md) · [Public benchmark](docs/PUBLIC_BENCHMARK.md) · [Release verification](docs/RELEASE_VERIFICATION.md) · [Build provenance](CONTRIBUTORS.md) · [Security](SECURITY.md) · [Roadmap](ROADMAP.md)

Rta-Smriti Brain turns a project repository, long agent threads, durable decisions, and evidence into a small local memory graph that Codex, Claude Code, Cursor, or any MCP-capable agent can reuse before doing work.

It is built for the moment every AI-assisted developer knows too well:

> "New chat. Same project. Same explanations. Same lost context."

Rta-Smriti gives each project a memory that stays on your machine.

## Latest Release

[`v1.0.4-alpha`](https://github.com/sulabhdubey/rta-smriti-brain/releases/tag/v1.0.4-alpha)
is the current published prerelease. The exact tagged source passes the hosted
Windows, macOS, and Ubuntu matrix across Python 3.11, 3.12, and 3.13. The native
workflow builds and smoke-tests Windows x64, Linux x64, and macOS standalone
binaries, a universal wheel, CycloneDX SBOMs, and a combined
`SHA256SUMS.txt`. The public wheel and Windows binary were then downloaded
without authentication and acceptance-tested from the release page; see the
[release verification record](docs/RELEASE_VERIFICATION.md) for the evidence
boundary and post-publication checks.

v1 adds deterministic Project Cognition and the Project Reality cockpit on top
of canonical project identity, bitemporal truth, governed context compilation,
and Universal Capture. It reconciles indexed sources, structured work state,
decisions, observations, and governed local media into bounded readiness,
coverage, conflict, change-impact, and decision-debt views. The product remains
an evidence and continuity layer: it does not execute project work or silently
promote captured text into trusted truth.

## What It Does

- Indexes your repo into local SQLite: files, chunks, symbols, imports, and graph edges.
- Stores durable memories: decisions, constraints, procedures, facts, and hypotheses.
- Binds every project brain to one canonical root and refuses silent checkout switching.
- Distinguishes clones and Git worktrees with a per-checkout identity, reports privacy-safe root/repository/checkout fingerprints, and revalidates every MCP call.
- Requires explicit, backup-first root rebinding even when an old folder disappeared; repository scans recheck the binding inside their write transaction before committing.
- Records structured checkpoints: objective, verified evidence, remaining gaps, next action, and prohibited repetition.
- Attaches source path, hash, verification command, timestamp, and verification status to remembered claims.
- Ingests long threads or handoff notes as explicitly unverified prior memory so useful context survives compaction without self-assigning trust.
- Incrementally captures matching local Codex sessions with resumable byte cursors, bounded/redacted event payloads, and conservative interruption checkpoints.
- Builds a focused **context pack** for the next agent task.
- Compiles governed agent-specific context from immutable task contracts, explicit acceptance and stop conditions, privacy grants, and explainable selection receipts.
- Enforces a hard context token budget and keeps direct evidence ahead of low-trust historical memory.
- Runs a local operator console with graph, canvas, typed bases, context-pack receipts, memory ledger, freshness checks, and bootstrap flow.
- Loads project surfaces progressively with bounded requests, explicit lifecycle states, and race-safe project switching.
- Exposes a dependency-light stdio MCP server for agent integrations.
- Runs independent MCP tool calls concurrently while preserving ordered mutation visibility.
- Watches active repositories with foreground or managed-background incremental sync and reuses a persistent SHA-256 cache for deep freshness checks.
- Supports optional local hybrid retrieval through a built-in deterministic hash provider or an installed Sentence Transformers model.
- Ships Tree-sitter parsing for seven common source families, deterministic regex fallback, and opt-in discovery of supported local language servers.
- Evaluates intended actions through an evidence-aware **Action Gate** that returns `allow`, `warn`, or `block` with policy, readiness, Git, and freshness signals.
- Explains retrieval provider, embedding coverage, freshness, latency, lexical/semantic rank, and source-hash provenance instead of hiding ranking decisions.
- Traverses bounded dependency, dependent, impact, evidence, and relevance subgraphs with explicit relation filters, including approximate calls and test links.
- Searches existing project brains through query-only local workspaces without merging or mutating their databases.
- Previews and exports selective redacted memory bundles, stages verified imports before one atomic commit, and verifies authenticated private snapshots.
- Records helpful or harmful memory outcomes and conservatively ages only eligible unverified inference or hypothesis records.
- Keeps data local by default: no API keys, no telemetry, no cloud database.

## Why It Is Different

Most second-brain tools store notes. Most code tools index files. Most agent memory systems recall text.

Rta-Smriti combines all three into a small, inspectable project brain:

| Layer | What it adds |
| --- | --- |
| Repo map | Files, chunks, symbols, imports, and evidence edges |
| Memory ledger | Durable decisions, constraints, procedures, and facts |
| Thread memory | Long sessions become searchable project evidence |
| Context pack | A compact, copyable brief for the next agent turn |
| Continuation checkpoint | Structured state that tells the next agent what is done, what remains, and what not to repeat |
| Pramana model | Evidence labels so observed facts, trusted docs, inference, memory, and hypotheses are not treated equally |
| Action Gate | Pre-action checks that surface trusted constraints, required proof, fragile paths, prohibited repetition, checkpoint readiness, dirty worktrees, and stale indexes |
| Explainable intelligence | Retrieval diagnostics with selection reasons plus bounded graph impact queries with evidence hashes and confidence |
| Local workspaces | Search across explicitly selected project brains while preserving database isolation |
| Local operator console | Visual graph, freshness, publish checks, bootstrap, and memory reflection |

The core idea is simple: **memory should not only remember. It should help an agent decide what context deserves trust right now.**

## The Pramana Model

Rta-Smriti uses a Vedic-inspired evidence model to classify context:

- `pratyaksha`: directly observed from code, tests, files, or tools
- `sabda`: trusted instruction, documentation, or human guidance
- `anumana`: inference
- `smriti`: prior memory
- `kalpana`: hypothesis or creative possibility

This keeps a test result, a human instruction, an assumption, and a brainstorm from collapsing into the same kind of "memory."

## Install

Requirements: Python 3.11 or newer and Git. Rta-Smriti supports Windows,
macOS, and Linux. Node.js is only needed to modify the dashboard source.

### Windows (PowerShell)

```powershell
git clone https://github.com/sulabhdubey/rta-smriti-brain.git
cd .\rta-smriti-brain
python --version
python -m venv .venv
& .\.venv\Scripts\python.exe -m pip install .
$RtaBrain = Join-Path $PWD ".venv\Scripts\rta-brain.exe"
& $RtaBrain --json doctor
```

Keep `$RtaBrain` in the current PowerShell session and use `& $RtaBrain` in
the commands below. The launcher is generated from `project.scripts` by pip;
it does not depend on the source wrapper files.

### macOS Or Linux (Bash/Zsh)

```bash
git clone https://github.com/sulabhdubey/rta-smriti-brain.git
cd rta-smriti-brain
python3 --version
python3 -m venv .venv
./.venv/bin/python -m pip install .
RtaBrain="$PWD/.venv/bin/rta-brain"
"$RtaBrain" --json doctor
```

Keep `RtaBrain` in the current shell and use `"$RtaBrain"` in Bash or Zsh.
See the [installation guide](docs/INSTALLATION.md) for native binary artifacts,
optional extras, troubleshooting, and uninstall instructions.

Upgrading from an earlier alpha requires upgrading the active launcher, not
changing the brain database. If the console reports a newer schema, follow the
[existing-installation upgrade procedure](docs/INSTALLATION.md#upgrade-an-existing-installation).
After a console restart, reopen it with `console open`; the plain loopback URL
does not carry the new one-session capability.

## Quick Start

Create one central brain directory, then onboard and open a project in one command. This detects the canonical Git root, creates or migrates the brain, indexes it, starts the background watcher, starts Codex task-continuity capture when a local Codex sessions folder exists, opens the managed console, and opens an authorized browser session:

New brains default to built-in hash retrieval. Re-running onboarding preserves an existing brain's configured provider; use `--embedding-provider` only when you intentionally want to rebuild retrieval with a different provider.

```powershell
$BrainDir = "$env:USERPROFILE\Documents\Rta-Smriti\brains"
& $RtaBrain start C:\path\to\my-project --project my-project --brain-dir $BrainDir --write-agents
```

```bash
BrainDir="$HOME/.local/share/rta-smriti/brains"
"$RtaBrain" start /path/to/my-project --project my-project --brain-dir "$BrainDir" --write-agents
```

### Share What Happened

Tried Rta-Smriti on a real project? [Share your experience in Discussions](https://github.com/sulabhdubey/rta-smriti-brain/discussions), [ask for installation help](https://github.com/sulabhdubey/rta-smriti-brain/discussions/categories/q-a), or [pick a first contribution](https://github.com/sulabhdubey/rta-smriti-brain/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22). If it saved you from repeating project context, consider [starring the repository](https://github.com/sulabhdubey/rta-smriti-brain).

Verify that commands are operating on the intended checkout by passing its root:

```powershell
& $RtaBrain --db "$BrainDir\my-project.sqlite" --json self-check --project my-project --check-files --root C:\path\to\my-project
```

```bash
"$RtaBrain" --db "$BrainDir/my-project.sqlite" --json self-check --project my-project --check-files --root /path/to/my-project
```

If a project intentionally moves to another clone or worktree of the same repository, stop its watcher and continuity worker, create a no-clobber backup, rebind, then restart the workers. Rta-Smriti refuses cross-repository rebinding and rolls back the binding and index if reindexing fails:

```powershell
& $RtaBrain --db "$BrainDir\my-project.sqlite" watcher stop --project my-project
& $RtaBrain --db "$BrainDir\my-project.sqlite" continuity stop --project my-project
& $RtaBrain --db "$BrainDir\my-project.sqlite" --json root-rebind C:\new\checkout --project my-project --backup C:\backups\my-project-before-rebind.sqlite
```

Use `integrity-diagnostics --root ` for a bounded report safe to share: it contains fingerprints and counts, not raw project names or filesystem paths.

## Dashboard

The `start` command opens the managed console automatically. Later, use its lifecycle commands without keeping a terminal open:

```powershell
& $RtaBrain console open --brain-dir $BrainDir
& $RtaBrain console status --brain-dir $BrainDir --json
```

```bash
"$RtaBrain" console open --brain-dir "$BrainDir"
"$RtaBrain" console status --brain-dir "$BrainDir" --json
```

The managed console survives terminal closure. `console open` retrieves the current
session URL; `console restart` repairs stale state or a failed process; `console stop`
ends it explicitly. Login startup is optional and owner-controlled through
`console login-enable` / `console login-disable` on Windows, macOS, and Linux.

Use `--no-continuity` when onboarding a machine that does not use Codex local
sessions, or pass `--sessions-root` when Codex stores sessions somewhere else.

The dashboard runs on `127.0.0.1` and includes:

- **Project switcher**: every local brain, readiness, file count, memory count
- **Canonical-root and Git identity**: bound project root, repository root, branch, HEAD, dirty-file count, and duplicate-root warnings
- **File explorer**: browse the real indexed folder tree, preview source without exposing absolute paths, search files, and add a relevant path directly to the current task
- **Semantic brain graph**: the active project sits at the center of stable Files, Symbols, Imports, Memories, and Evidence hubs; compact leaves reveal labels on hover, focus, or selection
- **Graph navigation**: collapse semantic hubs, pan or zoom the workspace, use the overview minimap, and switch between Global, Local, and Task scopes
- **Spatial canvas**: arrange a temporary working set, inspect a card, reset the layout, and export it as JSON
- **Typed bases**: scan memories, symbols, imports, and launch checks as dense, filterable tables
- **Search nodes**: filter graph nodes by file, symbol, memory, or artifact text
- **Types**: show/hide file, memory, docs, config, test, data, and artifact nodes
- **Context-Pack Studio**: choose any supported or custom target agent, select a 2K/4K/8K/16K token budget, type a task, and generate a focused pack; pack text and receipt metadata remain in the current browser session only
- **Evidence inspector**: open the optional detail panel for the selected node, must-know memories, and measured fresh/changed/missing/added/blocked source counts
- **Truth Timeline**: inspect bitemporal claims, evid

…

## Source & license

This open-source MCP server is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [sulabhdubey](https://github.com/sulabhdubey)
- **Source:** [sulabhdubey/rta-smriti-brain](https://github.com/sulabhdubey/rta-smriti-brain)
- **License:** MIT
- **Homepage:** https://sulabhdubey.github.io/rta-smriti-brain/

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/mcp-sulabhdubey-rta-smriti-brain
- Seller: https://agentstack.voostack.com/s/sulabhdubey
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
