Upload your codebase, ask questions in plain English, and get cited answers.
Built with Endee vector database at its core.
| # | Feature | Description | Endee Usage |
|---|---|---|---|
| 1 | Ingest Codebase | Upload ZIP or individual code files. System chunks, embeds, and indexes everything. | index.upsert() β store code chunk vectors with metadata |
| 2 | RAG Chat | Ask questions about your code in plain English, get cited answers. | index.query() β retrieve relevant chunks for context |
| 3 | Semantic Search | Describe what you're looking for, find relevant files by meaning. | index.query() β similarity search across all chunks |
| 4 | Recommendations | Select a file, see similar files from the codebase. | index.query() β mean-vector similarity + filtering |
| 5 | Agentic Q&A | Complex questions: agent decomposes β multi-search β synthesize. | index.query() Γ N β multiple searches per sub-question |
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β FRONTEND β
β Next.js 15 (App Router) + Tailwind + shadcn/ui β
β β
β βββββββββββββββββββββββββββββ ββββββββββββββββββββββββββββββ β
β β Public Routes β β Protected Routes β β
β β / (Landing Page) β β /dashboard β β
β β /login (Auth Forms) β β Requires valid JWT token β β
β βββββββββββββββ¬ββββββββββββββ βββββββββββββββ¬βββββββββββββββ β
β β AuthContext (State & Token) β β
β ββββββββββββββββββββββββββββββββ β
β ββββββββββββββββ ββββββββββββββββ ββββββββββββββββββββββββ β
β β Upload Panel β β Tab Bar β β File Card β β
β β β’ Drag & Dropβ β Ask|Search| β β β’ Recommendations β β
β β β’ File List β β Agent β β β’ Similar files β β
β ββββββββ¬ββββββββ ββββββββ¬ββββββββ ββββββββββββ¬ββββββββββββ β
β β β β β
β βββββββββββ¬ββββββββ΄βββββββββββββββββββββββ β
β β Next.js API Routes (proxy w/ Auth) β
βββββββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββββ
β HTTP / SSE (Bearer Token)
βββββββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββββ
β β BACKEND β
β β FastAPI (Python) β
β β β
β ββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββββββ β
β β main.py β Routes β β
β β POST /auth/register POST /auth/login GET /auth/me β β
β β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β β
β β POST /ingest POST /ask POST /agent β β
β β GET /search GET /recommend GET /files β β
β ββββ¬βββββββββββββββββ¬βββββββββββββββββ¬βββββββββββββββββββ¬ββββ β
β β β β β β
β ββββΌβββββββ ββββββββΌβββββββ βββββββΌβββββββ βββββββΌββββ β
β βingestionβ β rag.py β β agent.py β β auth.py β β
β β .py β β EmbedβSearchβ β Decomposeβ β β JWT Gen β β
β β Chunkβ β β βPromptβ β β MultiSearchβ β Bcrypt β β
β β Embedβ β β Ollama β β βSynthesizeβ β Verify β β
β β Store β ββββββββ¬βββββββ βββββββ¬βββββββ βββββββ¬ββββ β
β ββββ¬βββββββ β β β β
β β β β ββββββββββββββΌβββββ β
β ββββΌβββββββββββββββββΌββββββββββββββββΌβββ β MongoDB β β
β β endee_client.py (SDK Wrapper) β β β’ User profiles β β
β β (Filters data by user_id) β β β’ Hashed PWs β β
β βββββββββββββββββββββ¬βββββββββββββββββββ βββββββββββββββββββ β
β β β
ββββββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββββββ
β HTTP
βββββββββββΌββββββββββ ββββββββββββββββββββ
β Endee Vector DB β β Ollama (local) β
β localhost:8080 β β localhost:11434 β
β 384-dim cosine β β codellama/llama3β
βββββββββββββββββββββ ββββββββββββββββββββ
| Layer | Technology | Purpose |
|---|---|---|
| Vector DB | Endee (Docker) | Store & search code embeddings |
| Embeddings | all-MiniLM-L6-v2 (384-dim) |
Convert code to vectors |
| LLM | Ollama (codellama / llama3) | Generate answers from context |
| Backend | FastAPI (Python 3.11+) | API server with SSE streaming |
| Frontend | Next.js 15 + Tailwind + shadcn/ui | Dark-themed developer UI |
- Docker β for Endee vector DB
- Python 3.11+ β for backend
- Node.js 18+ β for frontend
- Ollama β for local LLM
Before starting, create a .env file in the backend/ directory:
# MongoDB & Auth
MONGO_URL=mongodb://localhost:27017
MONGO_DB=codemind
JWT_SECRET=your-super-secret-key-change-me
JWT_ALGORITHM=HS256
JWT_EXPIRY_HOURS=72
# Endee Vector DB
ENDEE_HOST=http://localhost:8080
ENDEE_AUTH_TOKEN=
ENDEE_INDEX_NAME=codemind
ENDEE_DIM=384
# LLM & Embeddings
OLLAMA_HOST=http://localhost:11434
OLLAMA_MODEL=codellama
EMBEDDING_MODEL=all-MiniLM-L6-v2# Start Endee Server
docker run -p 8080:8080 -v endee-data:/data endeeio/endee-server:latest
# Start MongoDB (if not installed locally)
docker run -p 27017:27017 -d mongoollama pull codellama # or: ollama pull llama3
ollama serve # if not already runningcd backend
python -m venv .venv
# On Mac/Linux:
source .venv/bin/activate
# On Windows:
# .\venv\Scripts\activate
pip install -r requirements.txt
# Verify Endee connection
python test_endee.py
# Start API server
uvicorn main:app --host 0.0.0.0 --port 8000 --reloadcd frontend
pnpm install
pnpm run dev- Endee not reachable (
ConnectionRefusedError): Ensure Docker is running and the Endee container is started on port 8080. - Ollama model not found: Run
ollama pull codellamato download the model before starting the server. If using a different model, updateOLLAMA_MODELin your.env. - MongoDB connection failed: Ensure MongoDB is running locally on port 27017, or update
MONGO_URLto point to a cloud cluster like MongoDB Atlas. - Port conflicts: If ports 3000 (frontend), 8000 (backend), or 8080 (Endee) are in use, stop conflicting services or update your environment variables and API proxy targets accordingly.
codemind/
βββ backend/
β βββ main.py # FastAPI routes
β βββ config.py # All configuration
β βββ endee_client.py # Endee SDK wrapper
β βββ ingestion.py # File parsing β chunking β embedding β storing
β βββ rag.py # RAG pipeline (search β prompt β stream)
β βββ agent.py # Agentic pipeline (decompose β multi-search β synthesize)
β βββ test_endee.py # End-to-end Endee validation
β βββ requirements.txt
βββ frontend/
βββ app/
β βββ page.tsx # Main two-panel layout
β βββ layout.tsx # Root layout with dark theme
β βββ api/ # 6 proxy routes β backend
βββ components/
βββ UploadPanel.tsx # File upload + indexed files list
βββ ChatPanel.tsx # RAG chat with streaming
βββ SearchPanel.tsx # Semantic search results
βββ AgentPanel.tsx # Agentic Q&A with live steps
βββ FileCard.tsx # File recommendations
Each code file is split into 60-line chunks with 10-line overlap, embedded using all-MiniLM-L6-v2, and stored via index.upsert() with metadata {file_path, language, chunk_index, text}.
User question β model.encode() β index.query(top_k=6) β retrieved chunks become LLM context β Ollama generates cited answer.
Query β embed β index.query(top_k=8) β return ranked chunks with similarity scores. No LLM involved.
Select a file β retrieve all its chunks β compute mean embedding β index.query() β filter out same file β return top-4 similar files.
Complex question β Ollama decomposes into 3 sub-questions β index.query() for each sub-question β deduplicate chunks β Ollama synthesizes comprehensive answer with citations.
(Data routes require a valid JWT token in the Authorization: Bearer <token> header)
| Method | Endpoint | Description | Auth |
|---|---|---|---|
POST |
/auth/register |
Create user account | No |
POST |
/auth/login |
Login, get JWT | No |
GET |
/auth/me |
Get current user info | Yes |
POST |
/ingest |
Upload code file or ZIP | Yes |
POST |
/ask |
RAG Q&A (SSE stream) | Yes |
POST |
/agent |
Agentic Q&A (SSE stream) | Yes |
GET |
/search?q=...&top_k=8 |
Semantic search | Yes |
GET |
/recommend?file_path=...&top_k=4 |
File recommendations | Yes |
GET |
/files |
List all indexed files | Yes |
GET |
/health |
Health check | No |
All responses follow: {"success": true, "data": {...}, "error": null}
Demonstrating Semantic Search, RAG, Recommendations, and Agentic AI, all powered by the Endee vector database.

