https://github.com/elbruno/elbruno.mempalacenet
MemPalace.NET β local-first AI memory in .NET (port of MemPalace)
https://github.com/elbruno/elbruno.mempalacenet
agents ai csharp dotnet embeddings knowledge-graph local-first mcp memory semantics
Last synced: 3 months ago
JSON representation
MemPalace.NET β local-first AI memory in .NET (port of MemPalace)
- Host: GitHub
- URL: https://github.com/elbruno/elbruno.mempalacenet
- Owner: elbruno
- License: mit
- Created: 2026-04-24T16:19:45.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2026-04-25T19:07:09.000Z (3 months ago)
- Last Synced: 2026-04-25T19:22:55.881Z (3 months ago)
- Topics: agents, ai, csharp, dotnet, embeddings, knowledge-graph, local-first, mcp, memory, semantics
- Language: C#
- Size: 495 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE
- Code of conduct: .github/CODE_OF_CONDUCT.md
- Security: .github/SECURITY.md
- Agents: docs/agents.md
Awesome Lists containing this project
README
# MemPalace.NET
[](https://github.com/elbruno/ElBruno.MempalaceNet/actions/workflows/ci.yml)
[](LICENSE)
[](https://www.nuget.org/packages/mempalacenet)
[](#)
A **.NET port** of [MemPalace](https://github.com/MemPalace/mempalace) β local-first AI memory that stores everything verbatim, searches semantically, and organizes knowledge through a *wings / rooms / drawers* hierarchy. No cloud calls by default, powered by ONNX embeddings.
> π― **Status:** v0.15.2 β Production-ready with advanced E2E testing, comprehensive journey guides, and skill pattern library.
## NuGet Packages
MemPalace.NET is published as a suite of focused libraries β install only what you need:
| Package | Description | NuGet |
|---------|-------------|-------|
| [`mempalacenet`](https://www.nuget.org/packages/mempalacenet) | CLI tool + meta-package (installs all) | [](https://www.nuget.org/packages/mempalacenet) |
| [`MemPalace.Core`](https://www.nuget.org/packages/MemPalace.Core) | Domain types, storage interfaces, PalaceRef | [](https://www.nuget.org/packages/MemPalace.Core) |
| [`MemPalace.Backends.Sqlite`](https://www.nuget.org/packages/MemPalace.Backends.Sqlite) | SQLite backend with BLOB vectors + cosine similarity | [](https://www.nuget.org/packages/MemPalace.Backends.Sqlite) |
| [`MemPalace.Ai`](https://www.nuget.org/packages/MemPalace.Ai) | M.E.AI integration β ONNX, Ollama, OpenAI, Azure | [](https://www.nuget.org/packages/MemPalace.Ai) |
| [`MemPalace.Search`](https://www.nuget.org/packages/MemPalace.Search) | Semantic, keyword & hybrid search with reranking | [](https://www.nuget.org/packages/MemPalace.Search) |
| [`MemPalace.Mining`](https://www.nuget.org/packages/MemPalace.Mining) | Content ingestion: files, conversation transcripts | [](https://www.nuget.org/packages/MemPalace.Mining) |
| [`MemPalace.KnowledgeGraph`](https://www.nuget.org/packages/MemPalace.KnowledgeGraph) | Temporal entity-relationship graph with validity windows | [](https://www.nuget.org/packages/MemPalace.KnowledgeGraph) |
| [`MemPalace.Mcp`](https://www.nuget.org/packages/MemPalace.Mcp) | Model Context Protocol server (Claude Desktop, VS Code) | [](https://www.nuget.org/packages/MemPalace.Mcp) |
| [`MemPalace.Agents`](https://www.nuget.org/packages/MemPalace.Agents) | Microsoft Agent Framework integration + diaries | [](https://www.nuget.org/packages/MemPalace.Agents) |
| [`MemPalace.Diagnostics`](https://www.nuget.org/packages/MemPalace.Diagnostics) | Health checks, metrics, and observability hooks | [](https://www.nuget.org/packages/MemPalace.Diagnostics) |
## Why MemPalace.NET?
- **Local-first by default** β ONNX embeddings via [ElBruno.LocalEmbeddings](https://github.com/elbruno/LocalEmbeddings) (no API keys, no cloud calls)
- **Microsoft.Extensions.AI** β swap embedders and LLMs with zero lock-in
- **Microsoft Agent Framework** β each agent gets its own memory diary
- **MCP server** β expose your palace as Model Context Protocol tools (Claude Desktop, VS Code, etc.)
- **Temporal knowledge graph** β track entity relationships with validity windows
- **SQLite backend** β managed BLOB storage, cosine similarity, clear upgrade path to vector stores
## Examples & Getting Started
Ready to dive in? Check out our **[runnable examples](./examples/README.md)**:
- π° **[Simple Memory Agent](./examples/SimpleMemoryAgent/)** β Core memory operations with semantic search
- πΈοΈ **[Semantic Knowledge Graph](./examples/SemanticKnowledgeGraph/)** β Temporal entity relationships
See [examples/README.md](./examples/README.md) for detailed walkthroughs and learning paths.
## Quick Start
```bash
# Install the CLI tool
dotnet tool install -g mempalacenet --version 0.15.2
# Initialize a new palace
mempalacenet init ~/my-palace
# Mine project files
mempalacenet mine ~/my-code --wing work --mode files
# Mine conversation transcripts
mempalacenet mine ~/my-convos --wing personal --mode convos
# Semantic search
mempalacenet search "how do I handle auth errors?"
# Hybrid search with reranking
mempalacenet search "latest React patterns" --hybrid --rerank
# Start MCP server (for Claude Desktop, VS Code, etc.)
mempalacenet mcp --palace ~/my-palace
# Run an agent
mempalacenet agents run scribe --wing research --mode local
```
## Architecture
MemPalace.NET is a modular .NET solution with clear separation of concerns:
| Project | Purpose |
|---------|---------|
| **MemPalace.Core** | Domain types, storage interfaces, PalaceRef value object |
| **MemPalace.Backends.Sqlite** | Default SQLite backend with BLOB vectors + cosine similarity |
| **MemPalace.Ai** | M.E.AI integration with ONNX (default), Ollama, OpenAI support |
| **MemPalace.Mining** | Content ingestion: filesystem miner + conversation transcript miner |
| **MemPalace.Search** | Semantic, keyword, and hybrid search with optional LLM reranking |
| **MemPalace.KnowledgeGraph** | Temporal entity-relationship graph with validity windows |
| **MemPalace.Mcp** | Model Context Protocol server (7 tools in v0.1) |
| **MemPalace.Agents** | Microsoft Agent Framework integration + per-agent diaries |
| **MemPalace.Cli** | Spectre.Console CLI (`mempalacenet` command) |
| **MemPalace.Benchmarks** | LongMemEval / LoCoMo / ConvoMem benchmarks + R@5 testing |
## Documentation
Full documentation lives in [`docs/`](docs/):
- **[Architecture](docs/architecture.md)** β solution layout, component contracts, dependency graph
- **[Concepts](docs/PLAN.md)** β wings, rooms, drawers, verbatim storage, embedder identity
- **[Backends](docs/backends.md)** β writing custom backends, conformance tests
- **[AI Integration](docs/ai.md)** β embedder selection, reranking, M.E.AI seams
- **[Mining](docs/mining.md)** β ingestion pipeline, custom miners, .gitignore respect
- **[Search](docs/search.md)** β semantic vs hybrid strategies, RRF fusion, temporal boosting
- **[Knowledge Graph](docs/kg.md)** β temporal triples, pattern queries, invalidation
- **[MCP Server](docs/mcp.md)** β tool reference, VS Code / Claude Desktop setup
- **[Agents](docs/agents.md)** β Agent Framework integration, diary management, agent discovery
- **[CLI](docs/cli.md)** β command reference, configuration, examples
- **[Benchmarks](docs/benchmarks.md)** β reproducibility, dataset sources, R@5 parity
- **[GitHub Copilot Skill](docs/COPILOT_SKILL.md)** β integration guide, pattern library, code generation hints
## Building Custom Integrations
Integrating MemPalace.NET into your .NET projects? Start with our developer guides:
- **[C# Library Developer Guide](docs/guides/csharp-library-developers.md)** β Build applications on MemPalace.NET
- **[Embedder Pluggability Guide](docs/guides/embedder-pluggability.md)** β Swap or implement custom embedders
- **[Skill Integration Deep Dive](docs/guides/skill-integration-deep-dive.md)** β Extend the platform with reusable skills
## Development
```bash
# Clone
git clone https://github.com/elbruno/mempalacenet
cd mempalacenet
# Build
dotnet build src/
# Test (129 tests, all green)
dotnet test src/
# Pack NuGet packages
dotnet pack src/ -c Release
```
## Roadmap
**v0.1.0** (current) ships core memory operations, search, MCP server, and agents.
**Post-v0.1:**
- Upgrade to [sqlite-vec](https://github.com/asg017/sqlite-vec) or Qdrant for >100K vectors
- BM25 keyword search (currently token overlap)
- LongMemEval R@5 parity validation (target β₯ 91%)
- Conversation context summaries (`mempalace wake-up`)
## Credits
- **Original project:** [MemPalace](https://github.com/MemPalace/mempalace) (Python)
- **Default embedder:** [ElBruno.LocalEmbeddings](https://github.com/elbruno/LocalEmbeddings) (ONNX)
## License
[MIT](LICENSE) β same spirit as the original MemPalace.
## π About the Author
**Made with β€οΈ by [Bruno Capuano (ElBruno)](https://github.com/elbruno)**
- π **Blog**: [elbruno.com](https://elbruno.com)
- πΊ **YouTube**: [youtube.com/elbruno](https://youtube.com/elbruno)
- π **LinkedIn**: [linkedin.com/in/elbruno](https://linkedin.com/in/elbruno)
- π **Twitter**: [twitter.com/elbruno](https://twitter.com/elbruno)
- ποΈ **Podcast**: [notienenombre.com](https://notienenombre.com)
---
## Community
We welcome contributions from the community! Here's how to get involved:
- **[Contributing Guidelines](.github/CONTRIBUTING.md)** β how to submit pull requests, report issues, and contribute code
- **[Code of Conduct](.github/CODE_OF_CONDUCT.md)** β our commitment to fostering an open and welcoming environment
- **[Security Policy](.github/SECURITY.md)** β how to report security vulnerabilities responsibly
- **[Issues](https://github.com/elbruno/mempalacenet/issues)** β report bugs or request features
- **[Discussions](https://github.com/elbruno/mempalacenet/discussions)** β ask questions, share ideas, and connect with the community
**Got questions?** Open a [discussion](https://github.com/elbruno/mempalacenet/discussions) or reach out to [@elbruno](https://github.com/elbruno).