Cortex
Plug'n'play persistent memory for AI agents, powered by Convex
License: FSL-1.1-Apache-2.0 TypeScript Convex Status
๐ Security Scanningโ
CodeQL Semgrep Trivy Gitleaks Bandit OpenSSF Scorecard
โ Build & Testsโ
TypeScript SDK Python SDK Vercel AI Provider Socket.dev
**๐ cortexmemory.dev | ๐ docs.cortexmemory.dev**
๐ Status: Production Readyโ
Cortex v0.27.x is production-ready with comprehensive features and battle-tested stability.
What you get:
- โ Stable APIs - TypeScript and Python SDKs with consistent interfaces
- โ Comprehensive Testing - 124 test files with 18,460+ assertions
- โ CLI Tooling - Complete project management and development workflow
- โ Security Scanning - CodeQL, Semgrep, Trivy, Gitleaks, Bandit, OpenSSF Scorecard
- โ Production Demo - Interactive Vercel AI quickstart with live visualization
- โ Complete Documentation - Getting started guides, API reference, and tutorials
Ready to use in production. Join developers building AI agents with persistent memory.
Want to follow along?
- ๐ cortexmemory.dev - Official website and project information
- ๐ docs.cortexmemory.dev - Complete documentation and guides
- ๐ฌ GitHub Discussions - Share ideas, ask questions, propose features
- ๐ GitHub Issues - Report bugs, request features, track progress
๐ฏ The Visionโ
Cortex brings enterprise-grade persistent memory to any AI agent system. Built on Convex, it provides flexible, scalable memory that works with any LLM or framework.
The Problem We're Solving:
Traditional memory solutions force you to choose between vector databases (Pinecone, Weaviate) or simple storage (Redis), manage complex infrastructure, write custom multi-agent coordination logic, and handle user profiles separately. It's fragmented, complex, and time-consuming.
The Cortex Solution:
A unified memory system that gives you everything in one package - production-ready memory that scales automatically, works with any LLM framework, supports any embedding provider, and requires zero infrastructure management.
๐ Quick Startโ
Get started in under 5 minutes:
Install & Initializeโ
# Install CLI
npm install -g @cortexmemory/cli
# Create project
cortex init my-agent
# Start building
cd my-agent
cortex start
What gets set up:
- โ Cortex SDK with TypeScript support
- โ Convex backend functions (deployed automatically)
- โ Environment configuration (.env.local)
- โ Example code to get you started
- โ Optional graph database integration
- โ
Deployment saved to
~/.cortexrcfor CLI management
๐ฌ Try the Interactive Quickstartโ
The fastest way to see Cortex in action - complete working demo:
# Option 1: Via CLI
cortex init demo --template vercel-ai-quickstart
cd demo && cortex start
# Open http://localhost:3000
# Option 2: From monorepo
cd packages/vercel-ai-provider/quickstart
npm install && npm run dev
See a production-ready chat app featuring:
- ๐ Real-time memory orchestration visualization
- ๐ Layer flow diagram (Memory Space โ User โ Agent โ Conversation โ Vector โ Facts โ Graph)
- ๐ Memory space switching (multi-tenant isolation)
- โก Streaming with progressive storage
- ๐งน Belief revision (facts update when user changes their mind)
Your First Memoryโ
import { Cortex } from "@cortexmemory/sdk";
const cortex = new Cortex({
convexUrl: process.env.CONVEX_URL!,
});
// Store a memory
await cortex.memory.remember({
memorySpaceId: "user-123-personal",
conversationId: "conv-1",
userMessage: "I prefer dark mode",
agentResponse: "I'll remember that!",
userId: "user-123",
userName: "User",
});
// Search your memories
const results = await cortex.memory.search(
"user-123-personal",
"what are the user's preferences?",
);
That's it! Your AI agent now has persistent memory.
Next steps: Getting Started Guide | CLI Reference
โจ Featuresโ
Cortex provides a complete memory system for AI agents:
- ๐ง Flexible Memory - Remember anything without hardcoded topics or schemas โ
- ๐ Memory Space Isolation - Flexible boundaries (per user, team, or project) โ
- โพ๏ธ Infinite Context - Never run out via retrieval (up to 99% token reduction) โ
- ๐ Semantic Search - AI-powered retrieval with multi-strategy fallback โ
- โฑ๏ธ Automatic Versioning - Updates preserve history, never lose data (10 versions default) โ
- ๐ฅ User Profiles - Rich user context with GDPR cascade deletion โ
- ๐ Hive Mode - Multi-tool memory sharing (MCP ready) โ
- ๐ก๏ธ Resilience Layer - Overload protection with circuit breakers โ
- ๐ง CLI Tools - Complete project management (init, start, dev, deploy) โ
- ๐ฆ Vercel AI Integration - Production-ready with interactive demo โ
- ๐ Sessions - Multi-session tracking with configurable lifecycle โ
- ๐ Governance - Compliance templates (GDPR, HIPAA, SOC2, FINRA) โ
- ๐ง Fact Extraction - LLM-powered extraction for 60-90% storage savings โ
- ๐ Belief Revision - Intelligent conflict resolution for facts โ
- โก Streaming - Native streaming support with progressive storage โ
- ๐ธ๏ธ Graph Integration - Optional Neo4j/Memgraph with orphan detection โ
- ๐ Context Chains - Hierarchical context sharing across memory spaces โ
- ๐ Access Analytics - Built-in statistics and insights โ
- ๐ฏ Agent Registry - Optional metadata for discovery and cascade cleanup โ
- ๐ Embedding Agnostic - Works with OpenAI, Cohere, local models, or any provider โ
- ๐ Multi-Tenancy - Complete tenant isolation with auth context โ
- โ Client-Side Validation - Instant error feedback (<1ms) for all APIs โ
โจ Latest Releasesโ
v0.27.x - Multi-Tenancy & Authentication (Dec 2025 - Jan 2026)
- Complete auth context with automatic tenantId propagation
- Sessions API with configurable lifecycle
- Multi-session tracking and management
- Vercel AI SDK v6 Agent architecture support
v0.24.0 - Belief Revision System (Nov 2025)
- Automatic fact conflict resolution
- Semantic conflict detection
- Intelligent superseding of outdated facts
v0.21.0 - Memory Orchestration (Oct 2025)
- Automatic entity registration
- CLI-first onboarding with interactive dev mode
- Multi-deployment management
v0.16.0 - Resilience Layer (Sep 2025)
- Production-ready overload protection
- Rate limiting and circuit breakers
- Priority queue for critical operations
See What's New for complete release history.
โจ Key Differentiatorsโ
๐ Infinite Contextโ
- Never run out of context again
- Recall from millions of past messages via retrieval
- Up to 99% token reduction vs traditional accumulation
- Works with any LLM (smaller models perform like SOTA with perfect memory)
๐ Hive Modeโ
- Multiple AI tools share one memory space
- Zero duplication (Cursor + Claude + custom tools)
- Cross-application memory via MCP
- Your memory follows you everywhere
๐ข Enterprise-Readyโ
- Complete ACID audit trails
- Automatic versioning (temporal queries)
- One-click GDPR cascade deletion
- Governance policies built-in
๐ค Multi-Agent Orchestrationโ
- Context Chains for workflow coordination
- A2A communication protocol
- Hive Mode (shared space) OR Collaboration Mode (separate spaces)
- Flexible isolation models
๐ง Developer Experienceโ
- Single database (Convex - no polyglot complexity)
- Framework-agnostic (LangChain, Vercel AI, custom)
- Embedding-agnostic (OpenAI, Cohere, local models)
- TypeScript-first with full type safety
- CLI-first workflow with interactive dev mode
๐ Unified Architectureโ
- 4-layer hybrid design (ACID + Vector + Facts + Graph)
- Graph-Lite built-in, native Neo4j/Memgraph optional
- Facts extraction (DIY or Cloud auto)
- All data in one place (Convex)
๐๏ธ Architecture Overviewโ
Cortex is designed with two deployment modes:
Direct Mode (Open Source)โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Your Application โ
โ (Next.js, Express, LangChain, etc.) โ
โโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Cortex SDK (Open Source) โ
โ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโ โ
โ โ Memory โ โ Context โ โ User โ โ
โ โ Operations โ โ Chains โ โ Profiles โ โ
โ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Your Convex Instance โ
โ โข Convex Cloud (managed) โ
โ โข Self-hosted (local or your infrastructure) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Perfect for: Getting started, prototyping, and self-managed deployments.
Cloud Mode (Managed Service - Coming Q3 2026)โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Your Application โ
โโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Cortex SDK (same code!) โ
โโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Cortex Cloud API โ
โ โข Analytics & Insights โข Team Management โ
โ โข Cost Optimization โข Advanced Features โ
โ โข Migration Tools โข Priority Support โ
โโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ (using your Convex credentials)
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Your Convex Instance โ
โ โข Convex Cloud (managed) โ
โ โข Self-hosted (local or your infrastructure) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Perfect for: Production deployments with advanced management and analytics.
Key Design Decisionsโ
- Built on Convex: Leverages Convex's reactive backend for optimal performance
- 4-Layer Architecture: ACID conversations + vector search + facts extraction + graph integration (all working together)
- Any Convex deployment: Works with Convex Cloud, localhost, or self-hosted infrastructure
- Embedding-agnostic: Optional embeddings from any provider (OpenAI, Cohere, local models)
- Progressive enhancement: Works with raw content (text search) or embeddings (semantic search)
- Flexible agents: Start simple with string IDs, add structure when needed
- Flexible dimensions: Support for any vector dimension (768, 1536, 3072+)
- Your data, your instance: Whether direct or cloud mode, data lives in your Convex deployment
๐ Use Casesโ
- Chatbots - Remember user preferences and conversation history
- Multi-agent Systems - Coordinate between specialized agents
- RAG Pipelines - Store and retrieve relevant context for LLM prompts
- Customer Support - Maintain customer context across interactions
- Personal Assistants - Long-term memory of user preferences and habits
- Knowledge Management - Organizational memory across teams
๐ How Cortex Comparesโ
| Feature | Cortex | Pinecone | Weaviate | Redis |
|---|---|---|---|---|
| Vector Search | โ | โ | โ | โ |
| ACID Transactions | โ | โ | โ | โ |
| Facts Extraction | โ | โ | โ | โ |
| Graph Integration | โ | โ | โ | โ |
| Real-time Updates | โ | โ | โ | โ |
| Versioning | โ | โ | โ | โ |
| Temporal Queries | โ | โ | โ | โ |
| Serverless | โ | โ | โ | โ |
| Context Chains | โ | โ | โ | โ |
| Agent Management | โ | โ | โ | โ |
| User Profiles | โ | โ | โ | โ |
| Open Source Core | โ | โ | โ | โ |
| Self-Hostable | โ | โ | โ | โ |
| All-in-One | โ | โ | โ | โ |
๐ Documentationโ
**๐ docs.cortexmemory.dev** - Complete documentation, guides, and API reference
Getting Startedโ
- Installation Guide - Multiple installation methods
- Five-Minute Quickstart - Build your first agent
- Core Concepts - Understand the fundamentals
- Configuration - Customize Cortex
Referenceโ
- API Reference - Full API documentation
- CLI Reference - Complete command documentation
- System Architecture - How it works
- Local Documentation - Repository documentation
๐ค Get Involvedโ
We're building Cortex in public and would love your input!
๐ฌ Join the Conversationโ
- GitHub Discussions - Best for:
- ๐ก Sharing feature ideas and use cases
- ๐ค Asking questions about architecture decisions
- ๐ฃ Providing feedback on the API design
- ๐ฏ Discussing roadmap priorities
- GitHub Issues - Best for:
- ๐ Reporting bugs
- โจ Requesting specific features
- ๐ Tracking development progress
- ๐ Following implementation work
๐ ๏ธ Ways to Contributeโ
- Share Your Use Case - Tell us how you'd use Cortex in your AI agent system
- Review the Architecture - Check our docs and provide feedback on the design
- Propose Features - What would make Cortex perfect for your needs?
- Test Builds - Try out releases and report issues
- Improve Documentation - Help us make the docs clearer and more comprehensive
- Spread the Word - Star the repo, share with others building AI agents
See CONTRIBUTING.md for detailed contribution guidelines.
๐ฆ Roadmapโ
Production Ready (Now Available):
- โ Core SDK (TypeScript + Python)
- โ CLI tooling with interactive dev mode
- โ Vercel AI integration with quickstart demo
- โ Complete documentation site
- โ Multi-tenancy and authentication
- โ Sessions management
- โ GDPR compliance features
- โ Fact extraction and belief revision
- โ Graph database integration (Neo4j/Memgraph)
- โ Resilience layer with circuit breakers
Coming Soon:
- ๐ MCP Server (Q1 2026) - Cross-application memory sharing
- ๐ LangChain Integration (Q2 2026)
- ๐ LlamaIndex Integration (Q2 2026)
- ๐ Cloud Mode Preview (Q3 2026) - Analytics, team management, advanced features
Follow our progress:
- Check Project Boards for current work
- Read Development Updates for milestone announcements
๐ Security & Privacyโ
- Data Isolation: Each agent's memories are completely isolated
- Your Infrastructure: Deploy to your own Convex instance
- No External Calls: Cortex never sends data outside your Convex deployment
- Flexible Access Control: Implement your own auth layer on top
- Open Source Core: Audit the code yourself - full transparency
Automated Security Scanningโ
- โ CodeQL - Static analysis for vulnerabilities
- โ Trivy - Dependency vulnerability scanning
- โ Gitleaks - Secret detection
- โ Semgrep - API security & OWASP Top 10
- โ Bandit & Safety - Python security scanning
- โ OpenSSF Scorecard - Supply chain security rating
- โ Dependency Review - Automated PR checks
Supply Chain Transparencyโ
Socket.dev may flag "network access" in this package. This is expected and safe:
- The SDK requires network access to communicate with Convex (cloud database)
- All network calls go to
*.convex.cloudendpoints only - This is documented, audited, and necessary for core functionality
- See
[.socket.dev.yml](https://github.com/SaintNick1214/Project-Cortex/blob/main/.socket.dev.yml)for our security policy
Report Security Issues:
- ๐ Email: security@cortexmemory.dev
- ๐ See SECURITY.md for our security policy
๐ฆ Publishing Releasesโ
Cortex SDK uses dual release workflows:
๐ค Automated (Production - recommended):
- Bump version in
package.jsonโ Push tomainโ GitHub Action publishes automatically - Full details: RELEASE-GUIDE.md
๐ป Manual (Beta/hotfix - full control):
- Run
npm run releasefor interactive publishing - See: scripts/release.ps1
Setup: .github/SETUP-AUTOMATED-RELEASES.md
๐ Licenseโ
Functional Source License (FSL-1.1-Apache-2.0)
Cortex uses the same license as Convex - the Functional Source License with Apache 2.0 future license.
Permitted Uses:
- Internal use and access within your organization
- Non-commercial education and research
- Professional services provided to licensees
- Building applications that use Cortex as a dependency
Restrictions: You may NOT use Cortex to create a competing commercial product or service that offers the same or substantially similar functionality.
Future Apache 2.0: Each version automatically becomes Apache 2.0 licensed two years after release.
See LICENSE.md for full details.
Cortex Cloud: Commercial service (future)
- Optional managed features and analytics
- Free tier planned
- Pay only for advanced features and support
๐ Acknowledgmentsโ
Cortex is built on the shoulders of giants:
- Convex - The reactive backend platform powering Cortex
- Project Constellation - The original inspiration for this system
- The open source AI community - For pushing the boundaries of what's possible
๐ฏ Origin Storyโ
Cortex was born out of building Project Constellation, an enterprise multi-agent AI system for Microsoft Teams. While building Constellation, we realized the memory system we needed didn't exist - so we're extracting and open-sourcing it as Cortex.
What makes Cortex different:
- Designed for real-world production use (not a prototype)
- Battle-tested patterns from building multi-agent systems
- Built by developers who needed it, for developers who need it
- Focus on developer experience and simplicity
๐ฎ Contact & Supportโ
- ๐ Website: cortexmemory.dev
- ๐ Documentation: docs.cortexmemory.dev
- ๐ง Email: support@cortexmemory.dev
- ๐ฌ Discussions: GitHub Discussions
- ๐ Issues: GitHub Issues
- ๐ฆ Twitter: @cortexmemory (coming soon)
โญ Star this repo if you're building AI agents with persistent memory โญ
Built with โค๏ธ for the AI agent community by Nicholas Geil / Saint Nick LLC
Cortex is production-ready. Join Discussions to share your use case and help shape the future of AI agent memory.