Mumega
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

GitHub
pythonfastapipostgresqlpgvectorgemini

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 SearchPOST /search with a natural language query. Returns ranked memories across all agents.
  • Code Graph Search — Sync your codebases, then POST /code/search to find functions and classes by description.
  • Multi-BackendMIRROR_BACKEND=local (PostgreSQL, default) or MIRROR_BACKEND=supabase for hosted deployments.
  • Multi-Tenant — Per-agent token scoping. Each agent sees only its own memories unless using admin access.

API Endpoints

EndpointWhat it does
POST /storeStore an engram (memory)
POST /searchSemantic search across memories
GET /recent/{agent}Recent memories for an agent
POST /code/searchSemantic search across code nodes
POST /code/syncTrigger sync from code-review-graph
GET /statsMemory + code node counts

Architecture

Agents → Mirror API (:8844) → PostgreSQL + pgvector
                            ← Gemini Embedding API (free tier)
SOS MCP tools (remember, recall, search_code) → Mirror

Get 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 :8844

Works standalone or as the memory layer for SOS.