Back to Directory/Developer Tools

io.github.AlekseiMarchenko/central-intelligence

Persistent memory for AI agents. Store, recall, and share knowledge across sessions.

Developer ToolsTypeScriptv0.1.3

Central Intelligence

Agents forget. CI remembers.

Persistent memory for AI agents. Store, recall, and share information across sessions. Works with Claude Code, Cursor, LangChain, CrewAI, and any agent that supports MCP.

npm License: MIT

Central Intelligence MCP server

Quick Start (30 seconds)

bash
# 1. Get an API key
npx central-intelligence-cli signup

# 2. Add to Claude Code
npx central-intelligence-cli init claude

# Done. Your agent now has persistent memory.

When to Use Central Intelligence

Heuristic: If you would write it in a note to your future self, store it in Central Intelligence.

ScenarioWhat to do
Starting a new session, need context from beforerecall or context
Discovered something important (architecture, preferences, fixes)remember
Multiple agents working on the same projectshare with user/org scope
You keep re-learning the same things each sessionremember once, recall forever
Handing off a task to another agent or sessionremember key decisions, next agent calls context
User tells you the same preferences repeatedlyremember them, check with recall next time

Don't store: secrets, passwords, API keys, PII, large binary files, or ephemeral scratch data.

The Problem

Every AI agent session starts from zero. Your agent learns your preferences, understands your codebase, figures out your architecture — then the session ends and it forgets everything. Next session? Same questions. Same mistakes. Same context-building from scratch.

Central Intelligence fixes this.

What It Does

Five MCP tools give your agent a long-term memory:

ToolDescriptionExample
rememberStore information for later"User prefers TypeScript and deploys to Fly.io"
recallSemantic search across past memories"What does the user prefer?"
contextAuto-load relevant memories for the current task"Working on the auth system refactor"
forgetDelete outdated or incorrect memoriesforget("memory_abc123")
shareMake memories available to other agentsscope: "agent" → "org"

How It Works

text
Agent (Claude, GPT, etc.)
    ↓ MCP protocol
Central Intelligence MCP Server (local, thin client)
    ↓ HTTPS
Central Intelligence API (hosted)
    ↓
PostgreSQL + vector embeddings (semantic search)

Memories are stored as text with vector embeddings. Recall uses cosine similarity to find semantically relevant memories, not just keyword matches.

Memory Scopes

ScopeVisible toUse case
agentOnly the agent that stored itPersonal context, session continuity
userAll agents serving the same userUser preferences, cross-tool context
orgAll agents in the organizationShared knowledge, team decisions

MCP Server Setup

Claude Code

Add to ~/.claude/settings.json under mcpServers:

json
{
  "central-intelligence": {
    "command": "npx",
    "args": ["-y", "central-intelligence-mcp"],
    "env": {
      "CI_API_KEY": "your-api-key"
    }
  }
}

Cursor

Add to ~/.cursor/mcp.json:

json
{
  "mcpServers": {
    "central-intelligence": {
      "command": "npx",
      "args": ["-y", "central-intelligence-mcp"],
      "env": {
        "CI_API_KEY": "your-api-key"
      }
    }
  }
}

Any MCP-Compatible Client

The MCP server is published as central-intelligence-mcp on npm. Point your MCP client to it with the CI_API_KEY environment variable set.

CLI Usage

bash
# Sign up and get an API key
npx central-intelligence-cli signup

# Add to Claude Code / Cursor
npx central-intelligence-cli init claude
npx central-intelligence-cli init cursor

# Store a memory
npx central-intelligence-cli remember "The user prefers dark mode and TypeScript"

# Search memories
npx central-intelligence-cli recall "what are the user's preferences?"

# Delete a memory
npx central-intelligence-cli forget <memory-id>

# Check connection
npx central-intelligence-cli status

Or install globally for shorter commands:

bash
npm install -g central-intelligence-cli
ci-memory signup
ci-memory remember "User prefers TypeScript"
ci-memory recall "language preferences"

REST API

Base URL: https://central-intelligence-api.fly.dev

All endpoints require Authorization: Bearer <api-key> header.

Create API Key

bash
curl -X POST https://central-intelligence-api.fly.dev/keys \
  -H "Content-Type: application/json" \
  -d '{"name": "my-key"}'

POST /memories/remember

json
{
  "agent_id": "my-agent",
  "content": "User prefers TypeScript over Python",
  "tags": ["preference", "language"],
  "scope": "agent"
}

POST /memories/recall

json
{
  "agent_id": "my-agent",
  "query": "what programming language does the user prefer?",
  "limit": 5
}

Response:

json
{
  "memories": [
    {
      "id": "uuid",
      "content": "User prefers TypeScript over Python",
      "relevance_score": 0.434,
      "tags": ["preference", "language"],
      "scope": "agent",
      "created_at": "2026-03-22T21:42:34.590Z"
    }
  ]
}

POST /memories/context

json
{
  "agent_id": "my-agent",
  "current_context": "Setting up a new web project for the user",
  "max_memories": 5
}

DELETE /memories/:id

POST /memories/:id/share

json
{
  "target_scope": "org"
}

GET /usage

Returns memory counts, usage events, and active agents for the authenticated API key.

Self-Hosting

bash
# Clone and install
git clone https://github.com/AlekseiMarchenko/central-intelligence.git
cd central-intelligence
npm install

# Set up PostgreSQL
createdb central_intelligence
psql -d central_intelligence -f packages/api/src/db/schema.sql

# Configure
cp .env.example .env
# Edit .env: set DATABASE_URL and OPENAI_API_KEY

# Run
npm run dev:api

Deploy to Fly.io

bash
fly apps create my-ci-api
fly postgres create --name my-ci-db
fly postgres attach my-ci-db
fly secrets set OPENAI_API_KEY=sk-...
fly deploy

Then point the MCP server to your instance:

json
{
  "env": {
    "CI_API_KEY": "your-key",
    "CI_API_URL": "https://your-app.fly.dev"
  }
}

Architecture

text
central-intelligence/
├── packages/
│   ├── api/            # Backend API (Hono + PostgreSQL)
│   │   └── src/
│   │       ├── db/           # Schema, migrations, connection
│   │       ├── middleware/   # Auth, rate limiting
│   │       ├── routes/       # API endpoints
│   │       └── services/     # Business logic (memories, embeddings, auth)
│   ├── mcp-server/     # MCP server (npm: central-intelligence-mcp)
│   ├── cli/            # CLI tool (npm: central-intelligence-cli)
│   ├── node-sdk/       # Node.js/TypeScript SDK (npm: central-intelligence-sdk)
│   ├── python-sdk/     # Python SDK (PyPI: central-intelligence)
│   └── openclaw-skill/ # OpenClaw skill file
├── landing/            # Landing page
├── Dockerfile          # API container
├── fly.toml            # Fly.io config
└── README.md

Pricing

TierPriceMemoriesAgents
Free$05001
Pro$29/mo50,00020
Team$99/mo500,000Unlimited

Contributing

Contributions welcome. Open an issue or PR.

License

MIT

Learn More