This guide covers the complete Cortex development setup. For the short path, start with the root README.
- Python 3.11+
- uv
- Node.js and npm
- Docker with Docker Compose
- Credentials for at least one supported LLM provider
- Supabase credentials for authenticated sessions, uploads, and session-scoped RAG
uv sync
cp .env.example .envarxiv-mcp-server is installed with the backend dependencies. The API launches it over stdio when needed, so it does not require a separate service. Backend startup validates that it can load the arXiv tools and fails early if the package is unavailable.
Optional dependency groups:
uv sync --extra evals # DeepEval, DSPy, and evaluation data tooling
uv sync --extra finetune # router dataset and Hugging Face toolingdocker compose up -dThis starts:
- Redis on
localhost:6379 - Neo4j Bolt on
localhost:7687 - Neo4j Browser at
http://localhost:7474 - Local Neo4j credentials:
neo4j/devpassword
The backend creates the required Neo4j indexes and constraints on first connection.
Choose an LLM provider in .env:
LLM_PROVIDER=openai
OPENAI_API_KEY=...
OPENAI_MODEL=...Supported alternatives:
- OpenRouter:
OPENROUTER_API_KEYandOPENROUTER_MODEL - Ollama:
OLLAMA_BASE_URLandOLLAMA_MODEL
Local GraphRAG defaults:
EMBEDDING_PROVIDER=ollama
EMBEDDING_MODEL=nomic-embed-text
EMBEDDING_DIMENSIONS=768
NEO4J_URI=bolt://localhost:7687
NEO4J_USERNAME=neo4j
NEO4J_PASSWORD=devpassword
NEO4J_DATABASE=neo4j
REDIS_URL=redis://localhost:6379/0The embedding dimensions must match the Neo4j vector index. Production normally uses OpenAI text-embedding-3-small with 1,536 dimensions; do not point local development at that database while using the 768-dimensional local model.
For market data, configure:
ASSET_PRICE_PROVIDER=alphavantage_mcp
ALPHA_VANTAGE_API_KEY=...ALPHA_VANTAGE_MCP_TOOL_REFRESH_SECONDS controls the in-memory MCP tool-catalog refresh interval. ALPHA_VANTAGE_MCP_URL can override the complete remote MCP URL.
See .env.example for the complete development configuration and Production configuration for deployed environments.
uv run uvicorn src.api.endpoints:app --host 0.0.0.0 --port 8010 --reloadUseful endpoints:
- API:
http://localhost:8010 - Process liveness:
http://localhost:8010/health - Dependency readiness:
http://localhost:8010/ready
cd ui
npm install
npm run devThe UI runs at http://localhost:5173.
Run the Inngest development server in another terminal:
npx --ignore-scripts=false inngest-cli@latest dev \
-u http://127.0.0.1:8010/api/inngest \
--no-discoveryIt invokes the outbox-dispatcher cron every two minutes. No separate dispatcher process is needed locally.
To flush pending outbox events immediately:
uv run python scripts/dispatch_outbox.py --limit 100Run the core checks:
uv run pytest -v
uv run ruff check src
uv run mypy srcSee Testing and quality for coverage, UI, browser, security, and load-test commands.
| Local development | Production | |
|---|---|---|
| Instance | Docker (bolt://localhost:7687) |
Neo4j Aura (neo4j+s://...) |
| Database | neo4j |
Aura database name |
| Embedding model | nomic-embed-text |
text-embedding-3-small |
| Dimensions | 768 | 1,536 |
On first connection Cortex creates:
- Vector index
chunk_embedding_indexonChunk.embedding - B-tree index on
Chunk.run_id - B-tree index on
Document.resource_id - B-tree index on
Entity.normalized_name