shipped
Mirror — Shared Agent Memory
Semantic memory API for AI agent teams. Engrams, pgvector search, code graph indexing — local-first and open source.
The memory layer — stores what agents learn, retrieves what they need, indexes codebases for semantic search
Mirror is a shared semantic memory API for AI agent teams. Instead of each agent keeping its own notes, they share a collective memory — searchable by meaning, not just keywords. Runs locally on PostgreSQL with pgvector. No cloud required.
What It Does
- Engrams — Store memories from any agent. Embedded with Gemini, retrieved by semantic similarity.
- Semantic Search —
POST /searchwith a natural language query. Returns ranked memories across all agents. - Code Graph Search — Sync your codebases, then
POST /code/searchto find functions and classes by description. - Multi-Backend —
MIRROR_BACKEND=local(PostgreSQL, default) orMIRROR_BACKEND=supabasefor hosted deployments. - Multi-Tenant — Per-agent token scoping. Each agent sees only its own memories unless using admin access.
API Endpoints
| Endpoint | What it does |
|---|---|
POST /store | Store an engram (memory) |
POST /search | Semantic search across memories |
GET /recent/{agent} | Recent memories for an agent |
POST /code/search | Semantic search across code nodes |
POST /code/sync | Trigger sync from code-review-graph |
GET /stats | Memory + code node counts |
Architecture
Agents → Mirror API (:8844) → PostgreSQL + pgvector
← Gemini Embedding API (free tier)
SOS MCP tools (remember, recall, search_code) → MirrorGet Started
git clone https://github.com/Mumega-com/mirror
cd mirror
cp .env.example .env # add GEMINI_API_KEY + DATABASE_URL
pip install -r requirements.txt
# Setup local PostgreSQL with pgvector
psql -c "CREATE DATABASE mirror;"
psql -d mirror -f schema.sql
python3 mirror_api.py # API on :8844Works standalone or as the memory layer for SOS.