Skip to content

dsantoreis/cortex

Cortex

CI License: MIT Release Docs

RAG-powered knowledge retrieval — ingest docs, query in natural language, get cited answers.

Cortex is a production-ready RAG platform with a Python FastAPI backend and Next.js chat + admin frontend. Built for teams that need grounded AI answers from their own knowledge base, with zero hallucination risk on enterprise content.


Before vs After

Without Cortex With Cortex
Find an answer in internal docs Search, skim 10 pages, guess Natural language query, cited answer in <1s
Onboard new team member 2-week ramp reading wikis Ask Cortex, get authoritative answers
Keep answers accurate Docs drift, answers go stale Re-ingest on change, always current
Deploy to production Custom infra from scratch docker compose up, add k8s manifests

Quickstart (3 commands)

git clone https://github.com/dsantoreis/cortex.git && cd cortex
docker compose up --build
curl -X POST http://localhost:8000/api/v1/ingest \
  -H 'Content-Type: application/json' \
  -d '{"text": "Cortex is a RAG platform for grounded knowledge retrieval.", "source": "intro"}'

Then query:

curl -X POST http://localhost:8000/api/v1/query \
  -H 'Content-Type: application/json' \
  -d '{"question": "What is Cortex?"}'

Open the chat UI at http://localhost:3000.


Architecture

flowchart LR
  DOCS[Documents] --> INGEST[Ingest API]
  INGEST --> EMBED[Embedding Pipeline]
  EMBED --> STORE[Vector Store]
  QUERY[User Query] --> RETRIEVE[Retrieval Engine]
  STORE --> RETRIEVE
  RETRIEVE --> LLM[LLM + Citation]
  LLM --> UI[Next.js Chat UI]
Loading
  • backend/ — FastAPI (Python) with /api/v1/ingest, /api/v1/query, /health
  • frontend/ — Next.js App Router chat + admin dashboard
  • k6/ — load test suite
  • k8s/ — Kubernetes deployment manifests
  • docs-site/ — full documentation

API Reference

Endpoint Method Description
/health GET Health check
/api/v1/ingest POST Ingest document text with source metadata
/api/v1/query POST Query knowledge base, returns answer + citations

Tests

cd backend && pytest -q        # unit + integration
cd frontend && npm test        # Vitest component tests
k6 run k6/stress.js            # load test

Docker

docker compose up --build

Kubernetes

kubectl apply -f k8s/

Roadmap

  • Multi-tenant workspace isolation
  • Streaming query responses (SSE)
  • Source freshness tracking and auto-reingest
  • Slack / Teams integration for in-chat queries

Contributing

See CONTRIBUTING.md. Issues and PRs welcome.

Security

Report vulnerabilities via SECURITY.md.

License

MIT — see LICENSE.


If Cortex saves your team hours on knowledge retrieval, star the repo and open an issue with your use case.

About

RAG knowledge engine: document ingestion, vector embeddings, semantic search, LLM-powered Q&A. Production-ready.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors