https://github.com/scott-walker/mememory
Persistent semantic memory for AI agents. MCP server with PostgreSQL + pgvector. All data stays local.
https://github.com/scott-walker/mememory
ai-agents claude-code embeddings golang local-first mcp mcp-server ollama pgvector postgresql privacy rag semantic-memory vector-database
Last synced: 3 months ago
JSON representation
Persistent semantic memory for AI agents. MCP server with PostgreSQL + pgvector. All data stays local.
- Host: GitHub
- URL: https://github.com/scott-walker/mememory
- Owner: scott-walker
- License: mit
- Created: 2026-03-30T18:03:04.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2026-04-03T21:18:34.000Z (3 months ago)
- Last Synced: 2026-04-03T21:38:51.378Z (3 months ago)
- Topics: ai-agents, claude-code, embeddings, golang, local-first, mcp, mcp-server, ollama, pgvector, postgresql, privacy, rag, semantic-memory, vector-database
- Language: Go
- Homepage: https://scott-walker.github.io/mememory/
- Size: 185 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# MEMEMORY
**Persistent semantic memory for AI agents**
Store, search, and deliver knowledge across sessions. MCP server with PostgreSQL + pgvector. All data stays local.
[](https://github.com/scott-walker/mememory/actions/workflows/ci.yml)
[](https://github.com/scott-walker/mememory/releases/latest)
[](https://goreportcard.com/report/github.com/scott-walker/mememory)
[](LICENSE)
[Documentation](https://scott-walker.github.io/mememory/) · [Quick Start](#quick-start) · [MCP Tools](#mcp-tools) · [Releases](https://github.com/scott-walker/mememory/releases)
---
## What it does
- **Stores** memories with scope, type, weight, tags, and TTL
- **Searches** by semantic similarity with hierarchical scope inheritance
- **Delivers** accumulated rules and knowledge to agents at session start
- **Detects** contradictions when new memories conflict with existing ones
- **Evolves** beliefs through supersede/weight mechanisms without losing history
## Quick Start
```bash
git clone https://github.com/scott-walker/mememory.git
cd mememory
cp .env.example .env
docker compose -f docker/docker-compose.yml up -d
```
Add to Claude Code config (`~/.claude/.claude.json` → `mcpServers`):
```json
{
"memory": {
"type": "stdio",
"command": "docker",
"args": ["exec", "-i", "mememory-admin", "memory-server"],
"env": {}
}
}
```
Admin UI at `http://localhost:4200`.
## Architecture
```
Agent ──stdio──▶ memory-server (Go, MCP)
│
┌───────┴───────┐
▼ ▼
PostgreSQL Ollama / OpenAI
(pgvector) (embeddings)
```
One `docker compose up` — no Go, Node.js, or other toolchains needed.
## MCP Tools
| Tool | Description |
|------|-------------|
| `remember` | Store a memory with scope, type, tags, optional TTL |
| `recall` | Semantic search with hierarchical scope inheritance |
| `forget` | Delete by ID |
| `update` | Update content, re-embed |
| `list` | List with filters |
| `stats` | Count breakdown by scope/project/type |
| `help` | Usage documentation |
## Key Concepts
**Scopes** — global (everywhere), project (one project), persona (one agent role within a project). Recall searches hierarchically: persona sees global + project + own.
**Types** — rule, feedback, fact, decision, context. Rules and feedback load automatically at session start.
**Scoring** — `similarity × scope_weight × memory_weight × temporal_decay`. Recent, specific, high-weight memories rank higher.
**Contradiction detection** — warns when a new memory is >75% similar to existing ones. Does not block storage.
**Session bootstrap** — all global rules and feedback are sent to the agent as MCP instructions at connection time. No config needed per project.
## Embedding Providers
| Provider | Model | Dimension | Setup |
|----------|-------|-----------|-------|
| **Ollama** (default) | nomic-embed-text | 768 | Included in Docker stack |
| **OpenAI** | text-embedding-3-small | 1536 | Set `EMBEDDING_PROVIDER=openai` + API key |
## Documentation
- [Full Documentation](https://scott-walker.github.io/mememory/) — guides, reference, API
- [Architecture](docs/architecture.md) — system design, data flow
- [Memory Model](docs/memory-model.md) — scopes, types, scoring, belief evolution
- [MCP Tools Reference](docs/mcp-tools.md) — all tools and parameters
- [Setup Guide](docs/setup.md) — installation, configuration, development
## License
MIT