Memorykit

io.github.rapozoantonio由 GitHub 帳號 rapozoantonio 發布v1.4.2更新於 Oct 24, 2026

Cognitive memory for AI coding assistants — persistent memory across sessions

已驗證STDIO僅桌面知識與記憶開發者工具

概覽

AI 產生的概覽

一個本機 MCP 伺服器,為 AI 程式設計助理提供跨工作階段的持久分層記憶,讓偏好與歷史脈絡得以延續。

可以做什麼
透過分層記憶模型(工作記憶、語意記憶、情節記憶、程序性記憶)跨工作階段保存對話脈絡與使用者偏好。依重要性為記憶評分並進行整併,支援自動事實擷取與模式學習。依問題意圖規劃要查詢哪些記憶層。README 描述了包含工作階段、訊息與查詢端點的 REST API,但清單未列出任何工具,因此具體的 MCP 工具範圍沒有文件說明。
適用情境
當你希望程式設計助理記住你的偏好、過往決策和先前的工作階段,而不是每次都從空白脈絡開始,並且願意自行執行與設定後端服務時,值得加入。
執行需求
以本機 stdio 程序執行,來自 npm 套件 memorykit-mcp-server,需要 Node.js。README 描述了一個 .NET 9 後端,依賴 Azure 服務(Redis、資料表儲存、Blob 儲存、AI Search、Azure OpenAI)與 API 金鑰驗證;清單未宣告任何環境變數或標頭。
安裝前請注意
README 說明使用 API 金鑰驗證,並會保存對話歷史與擷取出的事實,應將儲存的記憶視為敏感資料。它也描述了 Azure OpenAI 呼叫與 Azure 基礎設施,可能產生費用。多項 Azure 整合與真實的 OpenAI 整合被列為尚未完成,因此實際行為可能受限或僅使用記憶體實作。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Memorykit,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

🧠 MemoryKit

[CI/CD Pipeline] [License: MIT] [.NET] [PRs Welcome]

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:

ApproachTokens/QueryCost/QueryMonthly (10K users)
Naive (full context)50,000$1.50$750,000 💸
MemoryKit800$0.024$12,000 ✨
You Save98.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 RegionFunctionDurationWhat It Stores
Prefrontal CortexWorking MemorySeconds-MinutesActive conversation (7±2 items)
HippocampusEncoding & IndexingHours-DaysRecent experiences, decides what to keep
NeocortexSemantic MemoryMonths-YearsFacts, concepts, knowledge
AmygdalaEmotional Tagging-Importance scoring ("remember THIS!")
Basal GangliaProcedural MemoryYearsSkills, 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:

csharp
"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

FeatureMemoryKitMem0LettaLangChain
Language.NET 9PythonPythonPython
ArchitectureBrain-inspiredVector DBHierarchicalFlat
Procedural Memory✅ Yes❌ No⚠️ Basic❌ No
Cost Reduction98-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

bash
# Clone and buildgit clone https://github.com/rapozoantonio/memorykit.gitcd memorykitdotnet restore && dotnet build
# Run the APIdotnet run --project src/MemoryKit.API
# Open Swagger UIstart https://localhost:5001/swagger

Your First Query

csharp
// Create conversationPOST /api/v1/conversations{  "userId": "user_123",  "title": "My Coding Session"}
// Add messagesPOST /api/v1/conversations/{id}/messages{  "role": "user",  "content": "I prefer Python with type hints"}
// Later... Query with memoryPOST /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 ✅)

OperationTargetActual (p95)
Working Memory Read< 5ms3ms ✅
Semantic Search< 30ms25ms ✅
Episodic Search< 120ms95ms ✅
Full Context Assembly< 150ms135ms ✅
End-to-End with LLM< 2s1.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

Technical Deep-Dives


🔧 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

bash
# Fork and clonegit clone https://github.com/YOUR_USERNAME/memorykit.gitcd memorykit
# Create feature branchgit checkout -b feature/amazing-feature
# Make changes# ... code code code ...
# Run testsdotnet test
# Commit with conventional commitsgit commit -m "feat: add amazing feature"
# Push and create PRgit push origin feature/amazing-feature

Resources for Contributors


📈 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


🎯 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

來源:README.md,提交 35e85fa

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v1.4.2最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分