Get Cortex running locally in just a few minutes using Docker Compose.
Prerequisites
Before you begin, make sure you have:
- Docker and Docker Compose installed
- Git for cloning the repository
- An OpenAI API key (or Anthropic/local LLM)
Installation
Step 1: Clone the Repository
Code
Step 2: Configure Environment
The lowest-friction start is the recommended config that ships with the repo:
Code
.env.recommended is the bench-validated starting point. Fill in the secrets block at the top and your LLM API key — that's it. Everything else (extraction budgets, concurrency, chunking) runs on production-tuned code defaults:
Code
Set
ENCRYPTION_KEYfor real deployments — it encrypts user-supplied secrets at rest (git connector tokens, secret-typed skill config). Left empty, those are stored in plaintext (Cortex logs a startup warning); setting a key later auto-encrypts existing secrets on the next boot. Generate one with:python -c "from cryptography.fernet import Fernet; print(Fernet.generate_key().decode())"
LLM Configuration
Cortex speaks the OpenAI protocol everywhere, so any model from any OpenAI-compatible API works — Venice, OpenRouter, OpenAI, or self-hosted vLLM/Ollama. Five model slots (primary, extraction, relationship, vision, embeddings) are independently configurable, and every slot inherits the primary's API base + key unless overridden.
The recommended stack, pre-filled in .env.recommended:
- Primary agent — Gemma4 26B A4B (
google-gemma-4-26b-a4b-it): fast MoE with a 256K window; drives Q&A, research, and chat. - Knowledge-graph generation — Qwen3.6 27B (
qwen3-6-27b): entity/relationship extraction and image analysis from a single endpoint. - Embeddings —
text-embedding-3-small(1536-dim; the code default).
Code
To point a tier at a different provider, uncomment its *_API_BASE / *_API_KEY pair in .env.recommended. You do not need to set context windows for the extraction or vision models — ingestion runs on its own fine-tuned budgets (16000/16000 by default, sized to provider decode speed rather than the model window). Only OPENAI_MAX_CONTEXT should match your primary model's window.
Running on OpenRouter or your own GPUs instead of Venice? The LLM Deployment Templates page has a tested stack per provider, including fallback model recommendations.
Or configure each tier independently:
Code
Performance Tuning
Controls how much work runs in parallel:
Code
BATCH_PROCESSING_CONCURRENCYcontrols how many documents go through the pipeline simultaneously. Within each document,CONCURRENT_EXTRACTIONSsizes the entity extraction thread pool andCONCURRENT_RELATIONScontrols per-chunk relationship extraction concurrency.VISION_MAX_CONCURRENTindependently caps the background image analysis pipeline across all documents.PARALLEL_RELATIONSHIP_BATCHESis the most impactful lever for speeding up cross-document relationship analysis — increase it to run multiple LLM calls concurrently.
See the Configuration Reference for all 50+ environment variables.
Step 3: Start Services
Code
This starts all services:
| Service | URL | Description |
|---|---|---|
| Frontend | http://localhost:3000 | Next.js web interface |
| Backend API | http://localhost:8000 | FastAPI REST API |
| Neo4j Browser | http://localhost:7474 | Database admin UI |
| Neo4j Bolt | bolt://localhost:7687 | Database connection |
Step 4: Verify Installation
Check that all containers are running:
Code
Test the API health endpoint:
Code
Expected response:
Code
Step 5: Access the Web Interface
Open http://localhost:3000 in your browser and log in with your admin credentials.
First Steps
1. Upload Your First Document
- Navigate to the Documents page
- Click the Upload button to open the upload modal
- Drag and drop a PDF, TXT, MD, or DOCX file
- Click Start Processing to begin — you'll be taken back to the Documents page where you can watch progress in real-time
2. Explore Your Knowledge Base
- Go to the Explore section
- Use the Knowledge Graph tab to visualize entities and relationships
- Use the Deep Research tab for multi-step reasoning over your documents
- Use the Chat tab to ask questions and get AI-generated answers with source citations
Common Commands
Code
Troubleshooting
Container won't start
Check if ports are already in use:
Code
Neo4j connection failed
Wait 30-60 seconds for Neo4j to fully initialize, then restart the backend:
Code
OpenAI API errors
Verify your API key is valid:
Code
Next Steps
- Configuration Reference - All 50+ environment variables
- Document Upload Guide - Supported formats and options
- Deployment Guide - Production deployment with Coolify
- API Reference - Full API documentation