MIRIX is an async-native multi-agent personal assistant with a six-component memory system (Core, Episodic, Semantic, Procedural, Resource, Knowledge Vault). It captures memories from conversations and screen activity, storing them in PostgreSQL with vector search via pgvector.
- Entry point:
mirix/server/rest_api.py(FastAPI, port 8531) - Orchestration:
mirix/agent/meta_agent.py→ 6 sub-agents - Data flow: ORM (
mirix/orm/) → Schemas (mirix/schemas/) → Managers (mirix/services/) → API (mirix/server/) - Queue: Kafka-backed (
mirix/queue/) for async memory extraction - All I/O is async — never introduce sync blocking calls (see
docs/Mirix_async_native_changes.md)
- Docker + Docker Compose
- Python 3.10+
- At least one LLM API key (OpenAI, Anthropic, or Google Gemini)
cp docker/env.example .env # then add your API keys to .env
docker-compose up -d # starts PostgreSQL (5432), Redis (6379), API (8531), Dashboard (5173)
docker-compose ps # verify all services healthypip install -e .
export GEMINI_API_KEY=your-key # or OPENAI_API_KEY / ANTHROPIC_API_KEY
python scripts/start_server.py --port 8531- Dashboard: http://localhost:5173
- API Swagger: http://localhost:8531/docs
- API ReDoc: http://localhost:8531/redoc
# Fast unit tests — no running server needed (~20s)
pytest tests/test_memory_server.py -v
# All tests except integration
pytest -m "not integration" -v
# Integration tests — requires server on port 8899
python scripts/start_server.py --port 8899 # Terminal 1
pytest tests/test_memory_integration.py -v -m integration -s # Terminal 2
# Full suite
pytest -vRequired env var for tests: GEMINI_API_KEY
- Add Pydantic request/response schemas to
mirix/schemas/ - Add business logic method to the relevant manager in
mirix/services/ - Add the route to
mirix/server/rest_api.py - Add the corresponding method to
mirix/client/remote_client.py
- Create ORM model in
mirix/orm/ - Create Pydantic schemas in
mirix/schemas/ - Create manager in
mirix/services/ - Create sub-agent in
mirix/agent/ - Register in
mirix/agent/meta_agent.py
make format # ruff import sort + format
make lint # ruff check + pyright
make check # format + lint + test- All new manager methods must be
async def - Never use
asyncio.run()inside the server — the event loop is already running - Only 5 intentional sync touch-points exist (LangFuse, Gmail OAuth, SQLAlchemy DDL at startup, cleanup job entry, pure CPU helpers) — do not add more
- Use
asyncio.to_thread()to wrap any unavoidably sync third-party calls
Prefix commits with the Jira ticket: [VEPEAGE-NNN] Description
- Confuse queue messages (transient) with database messages (persistent)
- Call
step_manager.get_step()— steps are write-only audit logs - Skip
create_or_get_user()— always ensure users exist first - Commit secrets or API keys
- Create README or doc files unless explicitly requested