The Problem

AI agents are goldfish — they forget everything between sessions. It’s like trying to have a conversation with someone who resets their brain every five minutes. Forget context, forget learning, forget getting smarter with usage. And let’s not even talk about the mess of external APIs, vector databases, and OpenAI keys required to bolt on some kind of memory. It’s slow, expensive, and tied to the cloud.

What This Does

shodh-memory is a local, offline, self-contained memory system for AI agents that actually learns and forgets intelligently. It’s built on principles like Hebbian learning and mathematical decay, meaning it strengthens memories you use often and lets irrelevant ones fade. No LLM calls, no external databases, no nonsense.

The project is a mix of Rust (core memory system in src/), Python (python/shodh_memory/ for integrations), and TypeScript (MCP server in mcp-server/). It’s all tied together in one binary that you can run anywhere. The benches/ directory is loaded with performance benchmarks, showing just how fast this thing is compared to bloated alternatives that rely on OpenAI for everything. The docs/architecture/ folder explains the neuroscience-inspired design, but honestly, you don’t need to care about that to use it.

Real-World Use

Imagine you’re building a chatbot with shodh-memory. Let’s say your bot needs to remember user preferences and decisions across sessions. Here’s a Python example:

That’s it. No cloud, no latency, no API fees. The memory system will automatically prioritize frequently accessed items and decay the irrelevant junk over time. Want to deploy it server-side? A single command with Docker gets you a production setup.

It’s not just for chatbots — integrate it with langchain, hook it into a personal assistant, or bolt it onto a custom AI project.

The Bottom Line

shodh-memory is smart, fast, and lightweight. If you’re tired of handing your lifecycle (and wallet) over to OpenAI and vector DBs, this is for you. It’s not for everyone — if you’re running tiny prototypes or don’t mind being cloud-dependent, it might be overkill. But for anyone serious about persistent, offline memory, this is a no-brainer.