Now in Open Beta

Context infrastructure
for AI-powered teams

ContextLayer captures knowledge from every AI session, builds an organizational knowledge graph, and serves compressed context so your agents get smarter with every interaction.

contextlayer / context-flow

AI Agent

Events

ContextLayer

Extract & Graph

Compressed Context

~250 tokens

// Get compressed org context in <150ms
const context = await getContext(session_id, project_id);
// => { critical, relevant, background, total_tokens: 247 }

<150ms

p95 Latency

~250

Tokens per Context

4-Layer

Block Hierarchy

3

Protocols (gRPC, REST, MCP)

Features

Everything your AI agents need

From real-time event ingestion to intelligent Graph RAG retrieval, ContextLayer provides the full infrastructure to make your AI agents context-aware.

Real-time Event Ingestion

Receive events from any AI agent or tool via REST or gRPC. Automatic entity extraction and linking via LLM in the ingestion pipeline.

4-Layer Knowledge Graph

Session, Daily, Project, and Org blocks build a hierarchical knowledge graph using Apache AGE. Context is always up-to-date.

Graph RAG Retrieval

Cypher-powered discovery, multi-hop traversal with decay scoring, and community detection for intelligent context assembly.

Multi-tenant Isolation

Org-scoped data isolation, rate limiting (100 req/min per user, 500/org), and JWT-based role access control.

Token-Optimized Context

LLM-powered compression generates ~250 token summaries with 3 priority tiers: critical, relevant, and background.

Multi-Protocol Access

gRPC for internal high-performance, REST API for integrations, and MCP Server for Claude Desktop & Cursor compatibility.

How it Works

From events to context in three steps

Step 01

Connect your agents

Instrument your AI agents and tools with our SDK, REST API, or MCP protocol. Events flow in automatically as your team works.

Step 02

Knowledge builds itself

ContextLayer extracts entities, detects patterns, and builds a 4-layer block hierarchy. Daily and weekly summaries are generated automatically.

Step 03

AI gets better over time

Every query returns compressed, prioritized context. Your agents understand org history, team expertise, and project status — not just the current conversation.

Architecture

Built for performance
and reliability

A Rust backend with PostgreSQL, Apache AGE for graph operations, and pgvector for embeddings — all in a single database. Designed to serve context in under 150ms at p95.

  • Rust (axum + tonic + tokio) for zero-cost async
  • PostgreSQL 16 + Apache AGE + pgvector in one DB
  • Moka in-process cache per active session
  • Prometheus metrics + structured tracing
  • Incremental delta compression to save tokens
  • Batch processing with concurrent LLM calls

Block Hierarchy

OrgBlock

Weekly org patterns, expertise map, templates

ProjectBlock

Daily project decisions, contributors, open threads

UserDailyBlock

Daily user summary, active projects, delta today

SessionBlock

Single AI session, entities, decisions, outcome

Retrieval Flow

RequestGraph RAGSQL LookupCacheContext

Integrations

Works with your AI stack

Connect through REST API, gRPC, or the Model Context Protocol. Use our TypeScript SDK or build your own integration.

MCP Server

Claude Desktop & Cursor

REST API

Any HTTP client

gRPC

High-performance

OpenClaw Plugin

TypeScript SDK

Custom Agents

Any LLM provider

REST — Ingest an event
POST /api/v1/events
Authorization: Bearer <token>

{
  "session_id": "sess_abc123",
  "project_id": "proj_xyz",
  "event_type": "agent_message",
  "source": "claude",
  "content": { "text": "..." }
}
MCP — Get context (Claude Desktop)
// .claude/mcp.json
{
  "mcpServers": {
    "contextlayer": {
      "command": "./contextlayer",
      "args": ["--stdio"],
      "env": {
        "CL_API_KEY": "your-key"
      }
    }
  }
}

Pricing

Simple, transparent pricing

Start free during beta. Pay based on value delivered as you scale.

Starter

Freeduring beta

For small teams getting started with AI context.

  • Up to 5 users
  • 10K tokens/day
  • REST API access
  • MCP Server (STDIO)
  • Community support
Get Started
Most Popular

Team

$49/user/month

For growing teams that need full organizational context.

  • Unlimited users
  • 100K tokens/day
  • gRPC + REST + MCP
  • Admin dashboard
  • Token analytics
  • Priority support
Start Free Trial

Enterprise

Custom

For organizations with custom requirements and SLAs.

  • Everything in Team
  • Unlimited tokens
  • Dedicated instance
  • SSO / SAML
  • Custom integrations
  • SLA guarantee
Contact Sales

Ready to give your AI agents
organizational memory?

Join the beta and start building context-aware AI workflows for your team in minutes.