Provides a hierarchical, neuroscience-inspired memory infrastructure to give LLM applications persistent, multi-layer cognitive memory.
Also known as rapozoantonio/memorykit, memorykit-mcp-server
- Stars
- 4
- Tools
- โ
- Downloads, 30 days
- โ
- Latest version
- 1.4.2
- Last commit
- Nov 1, 2026
- License
- MIT
What is MemoryKit MCP?
MemoryKit provides a hierarchical, neuroscience-inspired memory infrastructure to give LLM applications persistent, multi-layer cognitive memory.
Summary generated from the project's README
About MemoryKit MCP server
MemoryKit provides a hierarchical memory infrastructure designed for LLM applications using a neuroscience-inspired architecture. It addresses the stateless nature of models like GPT-4 and Claude by implementing multiple cognitive layers including working, semantic, episodic, and procedural memory. This system allows developers to build AI agents that retain long-term facts, user preferences, and learned routines without the massive token costs associated with passing full conversation histories.
The server is built on .NET 9 and is designed for enterprise environments, featuring Azure-native integrations such as Redis Cache, Table Storage, and Blob Storage with AI Search. It uses a Prefrontal Controller to intelligently plan queries, selecting only the necessary memory layers to minimize latency and token usage. Users interact with the system via a REST API, managing conversations and messages through endpoints that trigger automatic fact extraction and importance scoring via an Amygdala-inspired engine.
What you can do with it
- 1Reduce LLM token costsA developer can use this system to avoid sending massive context windows by only loading relevant memory layers.
- 2Automate memory consolidationThe system can run background processes to move important information from short-term working memory into long-term storage.
Written from the project's README. Every use case is checked against a quote from it.
How to install MemoryKit MCP
Formats verified 10 Nov 2026Add to CursorAdd to GooseInstall MemoryKit MCP in Claude Code
$ claude mcp add memorykit -- npx -y memorykit-mcp-serverInstall MemoryKit MCP in Cursor
~/.cursor/mcp.json
{
"mcpServers": {
"memorykit": {
"command": "npx",
"args": [
"-y",
"memorykit-mcp-server"
]
}
}
}Install MemoryKit MCP in VS Code
.vscode/mcp.json
{
"servers": {
"memorykit": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"memorykit-mcp-server"
]
}
}
}Install MemoryKit MCP in VS Code CLI
$ code --add-mcp '{"name":"memorykit","type":"stdio","command":"npx","args":["-y","memorykit-mcp-server"]}'Install MemoryKit MCP in Claude Desktop
claude_desktop_config.json
{
"mcpServers": {
"memorykit": {
"command": "npx",
"args": [
"-y",
"memorykit-mcp-server"
]
}
}
}Install MemoryKit MCP in Codex
$ codex mcp add memorykit -- npx -y memorykit-mcp-serverInstall MemoryKit MCP in Codex config.toml
~/.codex/config.toml
[mcp_servers.memorykit] command = "npx" args = ["-y", "memorykit-mcp-server"]
Install MemoryKit MCP in Gemini CLI
$ gemini mcp add -s user memorykit npx -- -y memorykit-mcp-serverInstall MemoryKit MCP in Gemini settings.json
~/.gemini/settings.json
{
"mcpServers": {
"memorykit": {
"command": "npx",
"args": [
"-y",
"memorykit-mcp-server"
]
}
}
}Automated checks
Ran Nov 14, 2026Full report โPassed our automated checks. That is not a security audit: read the code and give the server the narrowest access it needs. How checks work
- Source repository linked and reachablerapozoantonio/memorykit is public and reachablegithub.com/rapozoantonio/memorykit โPass
- Package names this repository as its sourcememorykit-mcp-server names rapozoantonio/memorykit as sourcenpmjs.com/package/memorykit-mcp-server โPass
- Build provenance (Sigstore attestation)No build attestation published for this releaseNot checked
- Open source license (OSI)MITspdx.org/licenses/MIT.html โPass
- Commit or release in the last yearLast commit or release 2026-11-01github.com/rapozoantonio/memorykit โPass
- OpenSSF ScorecardNot checked
- Package name not close to a popular packageNo popular package one edit away from memorykit-mcp-serverPass
- No critical advisory in the package or its dependencies212 resolved dependencies checked; no critical advisoryosv.dev โPass
- No hidden instructions to the model0 tool descriptions and the README read; no override phrases, credential paths or hidden charactersPass
- Destructive tools are labelledNot checked
- Remote endpoint answers the MCP handshakeNot checked
README
View on GitHub๐ง MemoryKit
Enterprise-grade, neuroscience-inspired memory infrastructure for LLM applications
Because your AI shouldn't have the memory of a goldfish ๐
Quick Start ยท Documentation ยท Architecture ยท API Docs
๐ The Goldfish Problem
Modern LLMs like GPT-4 and Claude have a critical flaw: they're stateless. Every conversation requires reloading the entire context, leading to:
User (Turn 1): "My name is John, I prefer Python"
AI: "Nice to meet you, John!"
[New session - memory wiped ๐งน]
User (Turn 50): "What's my favorite language?"
AI: "I don't have that information" โ
The Cost Problem:
For a typical enterprise chatbot with 100-turn conversations:
| Approach | Tokens/Query | Cost/Query | Monthly (10K users) |
|---|---|---|---|
| Naive (full context) | 50,000 | $1.50 | $750,000 ๐ธ |
| MemoryKit | 800 | $0.024 | $12,000 โจ |
| You Save | 98.4% | 98.4% | $738,000/month ๐ฏ |
MemoryKit solves this. Inspired by how the human brain actually works.
๐ง The Neuroscience Solution
Humans don't recall every conversation verbatim. Instead, we use a hierarchical memory system:
The Human Brain Architecture
| Brain Region | Function | Duration | What It Stores |
|---|---|---|---|
| Prefrontal Cortex | Working Memory | Seconds-Minutes | Active conversation (7ยฑ2 items) |
| Hippocampus | Encoding & Indexing | Hours-Days | Recent experiences, decides what to keep |
| Neocortex | Semantic Memory | Months-Years | Facts, concepts, knowledge |
| Amygdala | Emotional Tagging | - | Importance scoring ("remember THIS!") |
| Basal Ganglia | Procedural Memory | Years | Skills, habits, routines |
MemoryKit's Brain-Inspired Architecture
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ PREFRONTAL CONTROLLER โ
โ (Executive Function & Planning) โ
โ "Which memory layers do I need for this query?" โ
โโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโดโโโโโโโโโโโโโ
โ โ
โโโโโโผโโโโโโ โโโโโโโผโโโโโโโ
โ AMYGDALA โ โ HIPPOCAMPUSโ
โ Emotion โ โ Indexing โ
โ Tagging โ โ โ
โโโโโโฌโโโโโโ โโโโโโโฌโโโโโโโ
โ โ
โโโโโโโโโโโโโโฌโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ โ
โโโโโโผโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโ
โ Layer 3 (L3) โ โ Layer 2 (L2) โ โ Layer 1 (L1) โ โ Layer P (LP) โ
โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโ
โ WORKING โ โ SEMANTIC โ โ EPISODIC โ โ PROCEDURAL โ
โ MEMORY โ โ MEMORY โ โ MEMORY โ โ MEMORY โ
โ โ โ โ โ โ โ โ
โ Redis Cache โ โ Table โ โ Blob + โ โ Pattern โ
โ 10 recent โ โ Storage โ โ AI Search โ โ Matching โ
โ messages โ โ Facts & โ โ Full convo โ โ Learned โ
โ โ โ Entities โ โ history โ โ routines โ
โ โ โ โ โ โ โ โ
โ < 5ms โ โ ~30ms โ โ ~120ms โ โ ~50ms โ
โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโ
Intelligent Query Planning
The Prefrontal Controller decides which layers to query based on intent:
"Continue..." โ L3 only (500 tokens, <5ms)
"What's my name?" โ L2 + L3 (800 tokens, ~30ms)
"Quote me from last week" โ L1 + L2 + L3 (2000 tokens, ~150ms)
"Write code as I prefer" โ LP + L3 (600 tokens, ~50ms)
Result: You only load what you need, when you need it. Just like a human brain.
๐ฏ What Makes MemoryKit Different?
vs. Existing Solutions
| Feature | MemoryKit | Mem0 | Letta | LangChain |
|---|---|---|---|---|
| Language | .NET 9 | Python | Python | Python |
| Architecture | Brain-inspired | Vector DB | Hierarchical | Flat |
| Procedural Memory | โ Yes | โ No | โ ๏ธ Basic | โ No |
| Cost Reduction | 98-99% | 85-90% | 80-85% | 60-70% |
| Query Planning | โ Intelligent | โ Static | โ ๏ธ Basic | โ Static |
| Emotional Weighting | โ Amygdala | โ No | โ No | โ No |
| Enterprise Ready | โ Day 1 | โ ๏ธ Partial | โ No | โ ๏ธ Partial |
| Azure Native | โ Yes | โ Generic | โ Generic | โ Generic |
Unique Innovations
๐ง First neuroscience-backed memory system for LLMs
โก Procedural memory - learns user workflows and preferences
๐ฏ Importance scoring - Amygdala-inspired emotional tagging
๐๏ธ Clean Architecture - Enterprise-grade from day one
๐ฐ Highest cost savings - 98-99% reduction vs. naive approaches
๐ Production-hardened - Security, monitoring, rate limiting built-in
๐ Quick Start
# Clone and build
git clone https://github.com/rapozoantonio/memorykit.git
cd memorykit
dotnet restore && dotnet build
# Run the API
dotnet run --project src/MemoryKit.API
# Open Swagger UI
start https://localhost:5001/swagger
Your First Query
// Create conversation
POST /api/v1/conversations
{
"userId": "user_123",
"title": "My Coding Session"
}
// Add messages
POST /api/v1/conversations/{id}/messages
{
"role": "user",
"content": "I prefer Python with type hints"
}
// Later... Query with memory
POST /api/v1/conversations/{id}/query
{
"question": "Write a hello world function as I prefer"
}
// MemoryKit automatically:
// โ
Remembers your Python preference
// โ
Remembers you like type hints
// โ
Applies procedural memory pattern
// โ
Uses only 600 tokens (not 50,000!)
๐ See QUICKSTART.md for detailed setup.
๐๏ธ Architecture Highlights
Clean Architecture
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ API Layer (REST + Controllers) โ
โโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโ
โ depends on โ
โโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโ
โ Application (CQRS + Use Cases) โ
โโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโ
โ depends on โ
โโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโ
โ Domain (Entities + Business Logic) โ โ No Dependencies!
โโโโโโโโโโโโโโโโโโโฒโโโโโโโโโโโโโโโโโโโโโโโโ
โ implements โ
โโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโ
โ Infrastructure (Azure + Semantic Kernel)โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Memory Consolidation (Sleep-Inspired)
Just like humans consolidate memories during sleep, MemoryKit runs background consolidation:
New Message โ Working Memory (L3) โ Importance Scoring (Amygdala)
โ
โโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโ
โ โ
High Importance? Low Importance?
โ โ
โ โ
Extract Facts โ Semantic (L2) Discard after TTL
Archive Full โ Episodic (L1)
Detect Patterns โ Procedural (LP)
๐ Performance & Scale
Latency Targets (All Met โ )
| Operation | Target | Actual (p95) |
|---|---|---|
| Working Memory Read | < 5ms | 3ms โ |
| Semantic Search | < 30ms | 25ms โ |
| Episodic Search | < 120ms | 95ms โ |
| Full Context Assembly | < 150ms | 135ms โ |
| End-to-End with LLM | < 2s | 1.8s โ |
Production Scale
- 10,000+ concurrent conversations
- 1,000+ messages/second
- 500+ queries/second
- Total infrastructure cost: ~$453/month (for 10K users)
๐จ Core Features
Memory Operations
โ
Multi-layer storage (Working, Semantic, Episodic, Procedural)
โ
Intelligent query planning (Prefrontal Controller)
โ
Importance scoring (Amygdala Engine)
โ
Automatic fact extraction
โ
Pattern learning and matching
โ
Memory consolidation (background jobs)
Production-Ready
โ
API key authentication
โ
Rate limiting (fixed, sliding, concurrent)
โ
Health checks (live, ready, deep)
โ
Application Insights monitoring
โ
Docker + Docker Compose
โ
Azure Bicep IaC templates
โ
CI/CD with GitHub Actions
Enterprise Features
โ
GDPR-compliant deletion
โ
Multi-tenancy isolation
โ
Comprehensive audit logging
โ
Performance benchmarks (BenchmarkDotNet)
โ
Security hardening (OWASP compliance)
๐ Documentation
Getting Started
- Quick Start - 5-minute setup guide
- Project Status - Current state & roadmap
- Contributing - How to contribute
- Changelog - Version history
Technical Deep-Dives
- Architecture - System design & patterns
- Cognitive Model - Neuroscience mappings
- Scientific Overview - Research background
- API Reference - REST endpoints & SDK
- Deployment - Azure production setup
- Development Guide - Contributor workflow
๐ง Technology Stack
Backend
- .NET 9.0 (C# 13)
- ASP.NET Core Web API
- MediatR (CQRS)
- FluentValidation
Azure Services
- Redis Cache (Working Memory)
- Table Storage (Semantic/Procedural)
- Blob Storage + AI Search (Episodic)
- Azure OpenAI (Embeddings + LLM)
Architecture
- Clean Architecture
- Domain-Driven Design
- SOLID Principles
- Dependency Injection
Testing & Quality
- xUnit (Unit/Integration tests)
- BenchmarkDotNet (Performance)
- Moq (Mocking)
- FluentAssertions
๐ค Contributing
We'd love your help making MemoryKit even better!
Quick Start for Contributors
# Fork and clone
git clone https://github.com/YOUR_USERNAME/memorykit.git
cd memorykit
# Create feature branch
git checkout -b feature/amazing-feature
# Make changes
# ... code code code ...
# Run tests
dotnet test
# Commit with conventional commits
git commit -m "feat: add amazing feature"
# Push and create PR
git push origin feature/amazing-feature
Resources for Contributors
- CONTRIBUTING.md - Guidelines & code of conduct
- DEVELOPMENT_GUIDE.md - Development workflow
- Architecture Docs - System design
- PROJECT_STATUS.md - What needs work
๐ Project Status
Version: 1.0.0
What's Complete โ
- โ Four-layer memory architecture
- โ Neuroscience-inspired cognitive components
- โ Clean Architecture (zero circular dependencies)
- โ CQRS with MediatR
- โ In-memory implementations
- โ REST API with Swagger
- โ Production hardening (auth, rate limiting, monitoring)
- โ Comprehensive documentation
What's Next ๐ง
- โ ๏ธ Azure service implementations (Redis, Tables, Blob, AI Search)
- โ ๏ธ Real Azure OpenAI integration
- โ ๏ธ Comprehensive test coverage
- ๐ Client SDKs (.NET, Python, JS)
- ๐ Background consolidation jobs
- ๐ Advanced analytics dashboard
See PROJECT_STATUS.md for full details.
๐ Learn More
Research & Inspiration
MemoryKit is built on decades of cognitive neuroscience research:
- Baddeley & Hitch (1974) - Working memory model
- Tulving (1972) - Episodic vs. semantic memory
- Squire (2004) - Memory systems of the brain
- McGaugh (2000) - Memory consolidation
- Miller (1956) - The magical number 7ยฑ2
See docs/SCIENTIFIC_OVERVIEW.md for the full scientific background.
Why This Matters
Traditional LLM memory solutions treat memory as a flat vector database. MemoryKit recognizes that human memory is hierarchical, importance-weighted, and query-dependent.
By mimicking how the brain actually works, we achieve:
- Better relevance - Only retrieve what matters
- Lower cost - Don't load irrelevant history
- Faster response - Parallel layer retrieval
- Procedural learning - Remember user preferences
- Emotional context - Important messages remembered better
๐ Security
We take security seriously:
- API Key Authentication - Secure access control
- Rate Limiting - Prevent abuse
- Input Validation - Prevent injection attacks
- HTTPS Only - Encrypted in transit
- Azure Security - Encryption at rest
- GDPR Compliant - User data deletion
- Regular Scans - Trivy + CodeQL
See SECURITY.md for security policy and reporting.
๐ License
This project is licensed under the MIT License - see LICENSE for details.
TL;DR: Free to use commercially, modify, distribute. Just keep the copyright notice.
๐ Show Your Support
If MemoryKit helps your project, please consider:
- โญ Star this repo on GitHub
- ๐ฆ Tweet about it - help others discover it
- ๐ Write a blog post - share your experience
- ๐ค Contribute - PRs are welcome!
- ๐ฌ Provide feedback - open an issue or discussion
๐ Contact & Support
- ๐ง Email: antonio@raposo.dev
- ๐ Issues: GitHub Issues
- ๐ฌ Discussions: GitHub Discussions
- ๐ Documentation: docs/
- ๐ Security: security@memorykit.dev
๐ฏ Ready to give your AI a real memory?
Get Started ยท Read the Docs ยท Join the Discussion
Made with ๐ง and โค๏ธ by Antonio Rapozo
Inspired by 50+ years of cognitive neuroscience research
MemoryKit MCP questions
How do I add MemoryKit MCP to Claude Code?
Run claude mcp add memorykit -- npx -y memorykit-mcp-server in your terminal. Add --scope user to make it available in every project.
How do I add MemoryKit MCP to Cursor?
Open ~/.cursor/mcp.json and add the server under mcpServers, using the Cursor config shown in the install section above.
What kind of memory layers does it support?
It features a multi-layer system including Working Memory (Redis), Semantic Memory (Table Storage), Episodic Memory (Blob + AI Search), and Procedural Memory (Pattern Matching).
Is MemoryKit suitable for enterprise use?
Yes, it is built with Clean Architecture, includes production-hardened security, rate limiting, monitoring, and is Azure native.