Memora is an intelligent agent that provides persistent, long-term memory for knowledge workers. It ingests documents (PDFs, notes, emails), stores their semantic embeddings in CockroachDB's distributed vector index, and answers questions with perfect recall – even across sessions. Unlike stateless chatbots, Memora builds a cumulative knowledge base that grows with the user.

At its core, Memora uses CockroachDB as the single source of truth for all memory: conversation history, user context, task state, and vector embeddings. This eliminates the need for a separate vector store, ensuring consistency between operational data and semantic search.

The agent is deployed serverlessly on AWS Lambda, uses Amazon Bedrock (Titan for embeddings, Claude for generation), and stores raw documents in Amazon S3. It integrates CockroachDB's MCP Server to explore its own schema safely, and uses the ccloud CLI to check cluster health before write operations – demonstrating production-grade resilience.

Key agentic behaviors:

  • Semantic memory retrieval via vector similarity search (ivfflat index).
  • Self-awareness: queries its own schema via MCP to adapt to new data structures.
  • Self-management: checks cluster health with ccloud and can scale cluster via CLI (demonstrated).
  • Stateful context: stores each Q&A pair as a new memory, enabling multi-turn contextual reasoning.

Memora proves that memory is not an afterthought – it's the foundation that makes agents useful in production.

Inspiration

AI agents are moving from chatbots to production workloads—writing code, diagnosing incidents, and automating workflows. But they share a fatal flaw: they forget. Without persistent memory, every interaction starts from zero. Traditional databases were built for human‑scale reads and writes, but agents spawn autonomously, write constantly, and require memory that persists across regions, failures, and scale with zero data loss.

CockroachDB was built for exactly this. We wanted to prove that memory isn't an afterthought—it's the foundation that makes an agent truly useful. Combining CockroachDB's distributed SQL, native vector indexing, and AWS's serverless ecosystem gave us the perfect pair to build an agent that remembers everything, scales globally, and never goes down.

What it does

Memora is an intelligent agent with persistent, long‑term memory for knowledge workers. It ingests documents (PDFs, notes, emails), stores their semantic embeddings directly in CockroachDB's distributed vector index, and answers questions with perfect recall—even across sessions.

Key agentic behaviours:

  • Semantic retrieval – uses CockroachDB's ivfflat vector index to find the most relevant past memories in milliseconds.
  • Self‑awareness – the agent queries its own database schema via CockroachDB's MCP Server to understand its data model and adapt dynamically.
  • Self‑management – before writing any memory, the agent checks cluster health using the ccloud CLI, ensuring operational resilience.
  • Stateful context – every Q&A pair is embedded and stored, enabling multi‑turn reasoning that builds on previous conversations.

How we built it

CockroachDB (memory layer):

  • Distributed Vector Indexing – stored and queried 1536‑dimension embeddings (from Amazon Titan) directly in CockroachDB using PGVector. No separate vector store = no consistency gaps.
  • MCP Server – enabled the agent to safely introspect its schema (SHOW TABLES, SELECT column_name) via a read‑only MCP endpoint, proving the agent can "understand" its own memory structure.
  • ccloud CLI – wrapped the CLI in Python's subprocess so the agent can run ccloud cluster status --format=json to verify cluster health before critical operations.

AWS (compute & AI):

  • Amazon Bedrock – used Titan for generating embeddings and Claude v2 for generating accurate, contextual answers.
  • AWS Lambda – deployed the agent as a serverless function (Python 3.11) with auto‑scaling to handle burst traffic.
  • Amazon S3 – stored raw uploaded documents and system logs.
  • AWS SAM – orchestrated the entire infrastructure with Infrastructure‑as‑Code for reproducibility.

Orchestration flow: User sends query via API Gateway → Lambda invokes Bedrock for embeddings → performs vector similarity search in CockroachDB → builds context → invokes Claude for final answer → stores the new interaction as a memory vector.

Challenges we ran into

  1. Vector search performance – tuning the ivfflat index parameters (lists and probes) was critical. We settled on lists = 100 for our dataset size, achieving sub‑100ms similarity searches at scale.

  2. Lambda cold starts – managing database connections in a serverless environment required connection pooling. Keeping connections alive during warm invocations reduced p95 latency from 1.2s to under 300ms.

  3. ccloud CLI in Lambda – packaging the binary and configuring service‑account‑based RBAC for secure, read‑only health checks took careful layer construction.

  4. MCP Server read‑only safety – locking it down to only SELECT and SHOW commands required careful configuration to meet the hackathon's safety requirements.

  5. Embedding consistency – ensuring the same embedding model (Titan) was used for both storing and querying to avoid broken semantic search. We enforced this via environment variables across all services.

Accomplishments that we're proud of

  • Built a fully functional agent with CockroachDB as the single source of truth – no external vector database needed.
  • Achieved < 100ms vector search latency at scale with CockroachDB's ivfflat index.
  • Integrated all three CockroachDB tools (vector indexing, MCP Server, ccloud CLI) in a cohesive, production‑ready system.
  • Deployed the entire stack on AWS Lambda, making it serverless, cost‑efficient, and auto‑scaling.
  • Demonstrated agentic self‑awareness and self‑management – the agent knows its own schema and checks its own health before acting.

What we learned

  • CockroachDB's vector support is mature and production‑ready – it's genuinely viable as a unified operational and semantic store.
  • MCP Server is a game‑changer for agentic systems – it provides a safe, standardised way for agents to inspect and interact with databases without exposing raw credentials.
  • The ccloud CLI makes it trivial to embed operational intelligence into agents – they can now manage their own infrastructure, not just query data.
  • Serverless AI agents on AWS are not only possible but practical, as long as you handle connection pooling and cold starts properly.
  • Persistent memory transforms an agent from a "chatbot" into a true, useful collaborator.

Built With

  • agentic
  • amazon-bedrock
  • amazon-titan
  • amazon-web-services
  • anthropic-claude
  • api-gateway
  • artificial-intelligence
  • aws-lambda
  • aws-sam
  • ccloud-cli
  • cloud-computing
  • cockroachdb
  • database
  • embeddings
  • machine-learning
  • mcp-server
  • open-source
  • pgvector
  • postgresql
  • python
  • rag
  • semantic-search
  • serverless
  • sql
  • vector-search
Share this project:

Updates

Submission history