What It Does
Perseus Memory Agent gives AI agents persistent, evolving memory so they remember project context across sessions. Instead of re-explaining your tech stack, conventions, and architectural decisions every time you start a new session, the agent recalls everything it learned about your project — even from weeks ago.
Key capabilities:
- Remembers project context — stack, conventions, architecture, preferences
- Logs decisions with rationale — why pgvector over Pinecone? The agent remembers
- Compounds knowledge — spots patterns across sessions, surfaces insights
- Swappable backends — Elastic (managed cloud) or Engram-rs (self-hosted MIT), one config line
- Hybrid search — ELSER semantic + BM25 keyword for accurate recall via Elastic
The demo shows 3 sessions:
- Session 1 — agent learns project context from scratch
- Session 2 — agent recalls prior knowledge, logs decisions with rationale
- Session 3 — agent compounds everything, backend swap Elastic → Engram-rs
How I Built It
Built with Gemini 3 Pro in Google Cloud Agent Builder, connected to Elastic Agent Builder via MCP for the memory layer:
Elastic MCP tools — Three tools in Elastic Agent Builder:
search_memory(hybrid ELSER + BM25),store_memory,delete_memory. Exposed as MCP endpoints the Gemini agent calls directly.Memory abstraction layer — Abstract
MemoryBackendinterface in Python. Two implementations:ElasticMemoryBackend(Elasticsearch via MCP) andEngramMemoryBackend(Engram-rs CLI / SQLite). Same API surface, swap backends by changing one environment variable.Agent tools — Three MCP-callable tools:
ProjectContextTool(manage project stack/conventions),DecisionLogTool(log and recall architectural decisions with rationale),KnowledgeGraphTool(cross-reference memories, find patterns, compound knowledge).Session lifecycle —
start_session()loads all relevant context from Elastic.process_message()enriches every prompt with hybrid search results.end_session()reflects on new knowledge and compounds insights.Backend-agnostic — The abstract interface means the same agent code works with Elastic (managed) or Engram-rs (self-hosted). Demo shows the swap live.
Why Elastic
Elastic Agent Builder was the natural choice because it's the only partner with a built-in context layer for memory and insights:
- Hybrid search (ELSER semantic + BM25 keyword) gives accurate recall that pure vector search or pure keyword search can't match alone
- ES|QL enables complex memory queries without custom code
- MCP server makes tools immediately available to Gemini — no custom integration layer needed
- Elasticsearch scales from hackathon demo to production without changing the API
What's Next
- Multi-project awareness — Agent recognizes cross-project patterns (e.g., "you use this same auth pattern in 3 repos")
- Memory confidence decay — Facts automatically lose confidence if unverified, prompting re-verification
- MCP-native Engram-rs — Direct MCP server in Engram-rs so it plugs into Agent Builder without the CLI wrapper
Built With
- Google Cloud Agent Builder (Gemini 3 Pro)
- Elastic Cloud (Elasticsearch, ELSER, BM25)
- Elastic Agent Builder (MCP tools)
- Engram-rs (Self-hosted memory, MIT, Rust + SQLite + FTS5)
- Python 3.12 (Pydantic, async/await)
- MCP (Model Context Protocol)
Built With
- elastic-cloud
- elasticsearch
- engram-rs
- gemini
- git
- github
- google-cloud
- mcp
- pydantic
- python
- rust
- sqlite


Log in or sign up for Devpost to join the conversation.