MarsNMe is an open-source, agent-agnostic memory backend that gives your AI continuity across sessions — not just context injection, but a growing relationship. Here's how we built it.
The Problem
Every time you start a new conversation with an AI assistant, it forgets everything. Your preferences, your projects, your context — gone.
Most memory solutions either:
- Lock you into one AI provider
- Store memories as flat key-value pairs (no semantic search)
- Require complex infrastructure to self-host
We wanted something different.
The Architecture
MarsNMe is a Streamable HTTP MCP server that any MCP-compatible client can connect to. One npx command, one .env file, and your AI has memory.
MCP_PROFILE=my-agent npx @marsnme/mcp-gateway
Stack
| Layer | Tech |
|---|---|
| Protocol | MCP (Streamable HTTP) |
| Storage | Supabase (PostgreSQL + pgvector) |
| Embeddings | Jina AI (jina-embeddings-v3) |
| Runtime | Node.js 20+, TypeScript |
| Auth | Optional OAuth / Bearer token |
Two-tier Memory Model
-
Short-term:
<profile>.memories— daily context, expires in 30 days -
Long-term:
<profile>.marsvault_chunks— distilled insights, semantic recall
Short-term memory captures everything. Long-term memory is promoted explicitly by the agent (or via our Dream Runner).
Multi-Profile Isolation
One gateway, multiple agents. Each MCP_PROFILE gets its own Supabase schema:
MCP_PROFILE=coco npx @marsnme/mcp-gateway # port 18790
MCP_PROFILE=toto npx @marsnme/mcp-gateway # port 18791
No cross-contamination. No shared tables.
The 13 MCP Tools
| Tool | What it does |
|---|---|
session_boot |
Pre-load context at session start |
insert_memory |
Store short-term memory |
recall |
Semantic recall from long-term chunks |
memory_ingest |
Promote insight to long-term storage |
search_memories |
Jina embedding search |
health_check |
Coverage + conflict diagnostics |
soft_forget |
Soft-delete a memory |
explain_memory |
Trace memory provenance |
| ... | (13 total) |
The Hardest Part
The hardest part wasn't the embeddings or the storage. It was teaching AI assistants when to save vs. when to recall.
We ended up writing a session_boot tool that runs at the start of every conversation and injects the most relevant memories automatically. The agent doesn't have to think about it.
Try It
# 1. Set up .env (Supabase + Jina keys)
cp .env.example .env
# 2. Run migrations
npx supabase db push --db-url "<your-db-url>"
# 3. Start
MCP_PROFILE=my-agent npx @marsnme/mcp-gateway
# 4. Connect Claude Desktop
# Add to claude_desktop_config.json:
# { "mcpServers": { "marsnme": { "url": "http://127.0.0.1:18790/mcp" } } }
What's Next
- LobeHub marketplace listing
- Smithery registry
- Web-based "Try it" demo (no install required)
GitHub: https://github.com/Marsmanleo/MarsNMe
Website: https://marsnme.com
npm: npx @marsnme/mcp-gateway
License: Apache 2.0
Built by Mars Group. Designed for humans and AI to grow together.

Top comments (0)