State Layer

The memory + context brain
for AI agents

Stop hallucinations. Remember users. Understand your entire codebase. Production-ready infrastructure for intelligent AI applications.

7-day free trial • Credit card required • Cancel anytime

Everything your AI agents need

Hybrid search, conversational memory, knowledge graphs, delta compression, and oracle research.

Context Retrieval

Vector + BM25 + reranking. Best-in-class retrieval for any query type.

Semantic + keyword + rerank pipeline

SOTA Memory System

7 memory types with temporal reasoning and version chains. Remember everything.

Factual, preference, event, relationship, opinion, goal, instruction

Delta Compression

50-90% token savings in multi-turn conversations. Only send what changed.

Save $300-$2,000/month on LLM costs

Oracle Research Mode

Tree-guided multi-step search for complex questions. Deep research on demand.

Autonomous reasoning + exploration

Knowledge Graphs

Auto-extract entities and relationships. Navigate complex codebases easily.

Entity extraction + relationship mapping

15+ Connectors

GitHub, Notion, Slack, Discord, Confluence, PostgreSQL, MongoDB, and more.

One API for all your data sources
TYPESCRIPT SDK

40+ production-ready methods

Complete TypeScript SDK with delta compression, SOTA memory, oracle research, auto-indexing, and cost tracking.

Core Context

query(), addContext(), oracleSearch() - everything you need for intelligent retrieval

Memory System

ingestSession(), searchMemoriesSOTA(), getUserProfile() - long-term memory management

Smart Features

autosubscribe(), createSharedContext(), consolidateMemories() - intelligent automation

View SDK docs
TypeScript SDK
import { RetainDBClient } from '@retaindb/sdk'

const client = new RetainDBClient({
  apiKey: process.env.RETAINDB_API_KEY,
  orgId: process.env.RETAINDB_ORG_ID
})

// Query with delta compression
const result = await client.query({
  project: 'my-app',
  query: 'How do we handle auth?',
  compress: true,
  compression_strategy: 'delta',
  include_memories: true
})

// 50-90% token savings
console.log(result.meta.tokens_used)
// 1,500 tokens (was 15,000)

Memory Types

FactualObjective facts
PreferenceUser choices
EventTimestamped occurrences
RelationshipEntity connections
OpinionSubjective views
GoalFuture intentions
InstructionPersistent directives
SOTA MEMORY SYSTEM

State-of-the-art memory

7 memory types, temporal reasoning, version chains, and automatic extraction. Your AI agents remember everything that matters.

Temporal Reasoning

Understand when memories were created and how they evolved over time

Version Chains

Track how information changes and maintain a complete history

Auto Extraction

Automatically extract memories from conversations using Claude Sonnet 4.5

Learn about memory
TOKEN SAVINGS

Save 50-90% on tokens

Delta compression detects what context changed since last query and only sends the difference. Massive token savings for multi-turn conversations.

Without Delta
15,000
tokens per query
With Delta
1,500
tokens per query
Monthly savings: $300-$2,000
For teams running multi-turn agents
View compression docs
Context Hashing
Turn 1 → Turn 2
Changed: 12 lines
Unchanged: 342 lines
90% reduction
Turn 2 → Turn 3
Changed: 5 lines
Unchanged: 349 lines
98% reduction

Enable with compression_strategy: 'delta'

~/.config/claude/mcp.json
{
  "mcpServers": {
    "retaindb-context": {
      "command": "npx",
      "args": [
        "@retaindb/mcp-server"
      ],
      "env": {
        "RETAINDB_API_KEY": "rdb_...",
        "RETAINDB_API_URL": "https://api.retaindb.com",
        "RETAINDB_ORG_ID": "org_..."
      }
    }
  }
}
query_contextstore_memoryoracle_researchget_graphsearch_entities
MCP SERVER

Native Claude Desktop integration

15+ MCP tools give Claude Desktop direct access to your context, memory, and knowledge graphs. Works with any MCP-compatible AI assistant.

15+ MCP Tools

Context retrieval, memory storage, oracle research, and knowledge graph navigation

One Config File

Claude Desktop instantly gets context awareness and long-term memory

View MCP docs

Production-ready performance

Built for scale from day one

<50ms
Memory Retrieval
Lightning-fast access to long-term memory
100%
Memory Retention
Never lose context across conversations
99.9%
Uptime SLA
Enterprise-grade reliability

Ready to build intelligent AI agents?

Stop hallucinations. Remember users. Understand your entire codebase.

7-day free trial • Credit card required • Cancel anytime