Cortex is an agentic knowledge base that transforms your documents into a searchable, AI-powered knowledge graph. Upload documents, ask questions, and get intelligent answers with full source citations.
Built with FastAPI, Haystack 2.0, Neo4j, and Next.js, Cortex combines the power of large language models with graph-based retrieval for superior question answering.
Key Features
| Feature | Description |
|---|---|
| Document Processing | Upload PDFs, text files, markdown, and Word documents with automatic chunking |
| Knowledge Graph | AI-powered entity and relationship extraction using GraphRAG |
| Hybrid Search | Combines vector similarity, keyword search, and graph traversal with RRF fusion |
| Ask AI | RAG-powered Q&A with Deep Research (multi-step reasoning) and Chat modes |
| Collections | Organize documents into collections with scoped graphs |
| Communities | Automatic detection of document clusters and theme summarization |
| Custom Inputs | Add knowledge manually via Q&A pairs, text, or markdown |
| Prompt Security | Built-in protection against prompt injection attacks |
Architecture
Technology Stack
| Layer | Technologies |
|---|---|
| Frontend | Next.js 16, React 19, TypeScript, Tailwind CSS, Framer Motion |
| Backend | FastAPI, Haystack 2.0, Python 3.11+, Pydantic |
| Database | Neo4j 5.x (Graph storage + Vector similarity search) |
| AI/LLM | Open-source models (e.g. Gemma, Qwen) via any OpenAI-compatible /v1 endpoint; closed models (OpenAI, Anthropic) also work through the same endpoint |
| Embeddings | OpenAI text-embedding-3-small (1536 dimensions) |
| Re-ranking | Cross-encoder (ms-marco-MiniLM-L-6-v2) |
Document Ingestion Pipeline
Query Pipeline (Hybrid Search + RAG)
API Overview
Cortex exposes 100+ REST API endpoints across these categories:
| Category | Endpoints | Description |
|---|---|---|
| Health | 2 | Health check and statistics |
| Documents | 8 | Upload, list, delete, reprocess, bulk operations |
| Custom Inputs | 4 | Add Q&A pairs, text, markdown manually |
| Search | 3 | Semantic, hybrid, and filtered search |
| Ask AI | 4 | RAG Q&A, streaming, agentic mode |
| Knowledge Graph | 9 | Entities, relationships, subgraphs, visualization, deduplication |
| Collections | 6 | CRUD, document assignment |
| Communities | 5 | Detection, summarization, search |
| Tasks | 5 | Background task tracking |
| Admin | 5 | API key management |
For AI Agents
If you are an AI agent (or are directing one) building against the Cortex API, use Cortex Skills — curated, up-to-date SKILL.md files for every subsystem, fetchable directly over HTTP. Instead of inferring the API from training data, fetch the ground-truth skill file first:
- Skill index:
https://cortexskills.org/SKILL.md— overview of all skills and how to build on Cortex - Per-topic skills:
https://cortexskills.org/<topic>/SKILL.md— e.g./upload,/search,/ask,/graph,/collections,/auth,/setup,/admin,/tasks,/git-integration,/web-import,/mcp,/integration,/hermes,/openclaw - Source repository: github.com/mocaOS/cortex-skills — also home of the Cortex MCP server
For example, https://cortexskills.org/cortex/SKILL.md teaches an agent to use a running instance as long-term memory (sync, hybrid search, agentic Q&A). For agent runtimes there are dedicated memory integrations: https://cortexskills.org/hermes/SKILL.md for Hermes agents (the recommended integration, with a native memory-provider plugin), and https://cortexskills.org/openclaw/SKILL.md for OpenClaw, which runs the same skill via the open SKILL.md standard.
Quick Links
- Quick Start - Get running in 5 minutes with Docker
- Configuration - All 50+ environment variables
- API Reference - Complete OpenAPI documentation
- GitHub - Source code and issues
- Cortex Skills - Fetchable SKILL.md files for AI agents (source)