You spend three hours with an AI agent — Octomind, Claude Code, Cursor, or any MCP client. It learns your codebase, makes architectural decisions, hits dead ends, finds solutions. You type exit. The next session starts at zero.

Same patterns rediscovered. Same decisions remade. The same day again, but in a terminal.

This isn't a context window problem. Even 200K tokens doesn't help when the session ends and the AI starts fresh. The fix isn't more context. It's persistent memory that understands your project, your role, and your git history — automatically.

The Session Reset Problem

Every AI coding tool resets when you exit. Claude Code, Cursor, custom agents — doesn't matter. The context window clears. The agent's mental model evaporates.

What you lose:

  • Re-exploration tax. Every session starts with the agent grepping around, re-learning your project structure, re-finding the files that matter. 15–30 minutes of token burn before real work begins.
  • Decision drift. Yesterday the agent chose REST over GraphQL for the API. Today? It might choose differently — because it doesn't remember the trade-off analysis.
  • Pattern rediscovery. That clever caching pattern the agent found three sessions ago? Gone. It'll reinvent it eventually. Or won't.
  • Stale knowledge accumulation. You tried five approaches before finding the right one. Without memory, the agent might try those same five wrong approaches again.

Manual workarounds fail because they require discipline. CLAUDE.md files grow to thousands of tokens, eating the context they're meant to preserve. Session summaries lose the nuance of why decisions were made. Static knowledge bases rot when files get renamed.

You need memory that works without manual maintenance, token bloat, or stale references.

The Fix: Project-Aware Persistent Memory

This is why we built Octobrain — and why it integrates tightly with Octomind.

Octobrain is a long-term memory system for AI assistants. It stores insights, decisions, and knowledge across sessions, not just within them. But the key is how it automatically scopes everything to your project, role, and git state when paired with Octomind.

What this looks like in practice:

Automatic Role Detection

Octomind agents have roles: developer, reviewer, architect, debugger. Each role needs different memory.

When you run:

bash
octomind run developer:general

Octobrain automatically tags memories with the developer role. When you later run octomind run reviewer:rust on the same codebase, the reviewer sees code context but doesn't get cluttered with implementation details that matter to developers.

Role scoping is automatic. No configuration. No manual tagging. Memories organize themselves around who's doing the work.

Automatic Project Scoping

Octobrain identifies your project by Git remote URL hash. Push to GitHub, GitLab, anywhere — Octobrain knows it's the same project. Pull a fresh clone on a different machine? Same memory, same context.

This matters because:

  • Cross-project isolation. Memories from your work project don't leak into your side project.
  • Team synchronization. When your teammate runs Octomind on the same repo, they get the same project-scoped context (if they share the Octobrain instance or sync storage).
  • Clone detection. Rename the directory, move it around — Octobrain still knows which project it is.

The project scoping happens automatically. No manual project IDs. No "current working directory" confusion.

Git-Commit Awareness

The interesting part is commit awareness. Octobrain stores memories with the current git commit hash.

When you run:

bash
octomind run developer:general

And the agent decides on an API design pattern, Octobrain stores that decision tagged with commit abc1234. Three months later, you're refactoring that module. The agent retrieves the original decision — plus related memories, conflicting approaches that were rejected, the reasoning behind trade-offs.

But it goes further. Octobrain detects stale references automatically:

  • File got renamed? Git history detection updates the references.
  • File got deleted? Importance gets penalized, and if all related files are gone, the memory cleans itself up.
  • Major refactor? Memories pointing to old structures get deprioritized, new patterns get boosted.

Your memory stays as clean as your codebase. Without manual work.

How It Actually Works

Octobrain runs as an MCP server. When Octomind connects, it passes context via capabilities.experimental.session during the MCP initialize handshake:

json
{
	"session": {
		"project": "a1b2c3d4",
		"role": "developer",
		"session_id": "uuid-here"
	}
}

Octobrain locks the session to this project and role. Once locked, all memory operations are automatically scoped — the AI doesn't specify project or role in tool arguments, and can't accidentally save memories to the wrong scope.

The session_id enables session-scoped knowledge — temporary storage that auto-cleans after 120 hours. Perfect for one-off research that shouldn't pollute long-term memory.

With Octomind — automatic scoping via capabilities. One Octobrain installation, multiple projects and roles, each perfectly isolated.

With other MCP clients — the same tools work, but you manually specify project and role in tool arguments. The auto-scoping is native to Octomind integration.

The flow in practice:

bash
octomind run developer:general
# Agent explores, decides on middleware pattern
# Stores: "Use axum middleware for auth, not tower"
# Tagged: developer, commit abc1234, project my-api
exit

Three months later — Session 2:

bash
octomind run developer:general
# Same project, same role
# Agent asks Octobrain: "auth patterns for this project?"
# Gets back: the middleware decision, plus related patterns, rejected alternatives
# Starts where it left off, not at zero

The integration works because Octomind passes role, project, and git context via MCP capabilities on every tool call. Octobrain receives this context automatically and scopes every memory operation — store, retrieve, search — to the right project, role, and commit.

How the Memory Stack Works

We didn't reinvent memory systems. We assembled what works from the state of the art, made it automatic, and integrated it with Octomind's workflow. (Storage is the easy part — deciding what to remember is where most teams go wrong.)

Hybrid Search (BM25 + Vectors)

Octobrain combines BM25 full-text search with vector similarity via native RRF fusion. Search for "auth middleware" and find it even if the code says "authentication layer" — semantic match. But also find exact matches when you need them. Both strategies, fused.

Temporal Decay (Ebbinghaus-Style)

Memories fade naturally. Unused memories drift down in importance. Frequently accessed memories stay visible. It's configurable — set your half-life (default: 90 days), set your floor. The system models human forgetting, not robotic permanence.

Auto-Linking (Zettelkasten for AI)

When you store a memory, Octobrain finds semantically similar memories and creates bidirectional relationships. The result is an emergent knowledge graph. Query one memory, get its context — memories that extend it, contradict it, implement it, depend on it.

Git-Aware Cleanup

No manual pruning. File renamed via git? References update. File deleted? Memory importance drops, then cleans up if truly obsolete. Your knowledge base stays synchronized with your actual codebase.

Octomind + Octobrain: The Full Picture

Octomind gives you specialist agents in five seconds — no setup, no prompt engineering, no credential juggling. Octobrain gives those agents memory that persists across sessions — scoped by role, project, and git state.

Together they solve the full problem:

Without OctobrainWith Octobrain
Session starts at zeroSession starts with context
Re-learns codebase layoutKnows the architecture from previous sessions
Re-discovers patternsRetrieves established patterns
Re-makes decisionsReferences previous decision rationale
Accumulates stale file referencesAutomatically cleans up renamed/deleted files
Manual memory discipline requiredAutomatic, git-aware, role-scoped

What's New in 0.5.0

This release reflects what we learned running memory at scale with Octomind:

Local File Indexing. The knowledge system now indexes local documentation, PDFs, Markdown — not just web URLs. Point it at your internal wiki. It chunks intelligently, tracks parent context, reindexes automatically when content goes stale.

Session-Scoped Knowledge. Some research is temporary. Octobrain can store knowledge chunks as session-scoped — they automatically clean up after 120 hours. No pollution of long-term memory with one-off investigations.

Product and Workflow Memory Types. New categories for feature specs (product) and recurring processes (workflow). Octomind agents can now store "how we handle incident response" or "the Q2 roadmap decisions" with appropriate typing.

Official rmcp SDK. Migrated from custom MCP implementation to the official Rust SDK. Better protocol compliance, better stability.

Stale Reference Cleanup. Automatic detection of dead file references, with git rename tracking. Your memory stays accurate without manual maintenance.

Open Source, Local-First

Octobrain is Apache-2.0 licensed and runs entirely on your machine. Your code, your memories, your data — never leaves your system unless you explicitly configure an external embedding API.

We built it this way because we were tired of choosing between "convenient" managed services that required shipping our codebase to someone else's server, or fragile DIY solutions that fell over under load.

Self-hosting shouldn't mean compromising on capability. Octobrain gives you production-grade hybrid search, temporal decay, and relationship graphs — all running locally, with zero data exposure.

Getting Started

bash
# Install Octobrain
brew install muvon/tap/octobrain
# Or: cargo install octobrain

# Start the MCP server
octobrain mcp

Configure Octomind to use it (automatic if installed via tap), and that's it. Your agents now remember.

Stop Starting at Zero

If you're using Octomind without Octobrain, you're paying the session reset tax. Every exit costs you 15–30 minutes of re-exploration. Every new session risks decision drift and pattern rediscovery.

Persistent memory shouldn't be manual work. With Octobrain + Octomind, it's automatic: role-scoped, project-aware, and git-integrated.

Your agents should remember what they learned. Now they do.


Octobrain is developed by Muvon Un Limited. Open source under Apache-2.0. Tightly integrated with Octomind.