AI · Self-hosted LLM and RAG
Syntax Chat Assistant: Self-hosted LLM chat with RAG search
A self-hosted chat assistant that answers from the company’s own documents. The language models run on Ollama on company servers, with retrieval over a ChromaDB document store.



Overview
The product and my role.
The challenge
The team wanted an assistant that could answer questions from internal documents. Those documents could not be sent to a hosted AI service, so the language models had to run on the company’s own servers.
My role
Lead Engineer at Syntax Technologies. I designed the system, led the team that built it and wrote parts of the pipeline and the chat application myself.
What I built
- A retrieval pipeline: PDF and text documents are read from a shared drive, split into chunks and stored in ChromaDB. Each question is ranked against the chunks with BM25, with TF-IDF as an alternative, and the best matches go to the model as context.
- Grounded answers: the prompt tells the model to answer only from the retrieved context and to say so when the answer is not there.
- Self-hosted inference on Ollama, so documents and conversations stay on company servers.
- A React and TypeScript chat application with conversation history, starred chats, Markdown and code rendering, and a screen to pull, inspect and remove models.
- A Flask API with JWT sign-in that stores users and conversations in MongoDB.
- Language models served by Ollama on company servers
- Answers grounded in documents retrieved from ChromaDB
- Chat app with history, model management and sign-in
Stack
The stack, layer by layer.
Backend6
- Python
- Flask
- RAG pipeline
- BM25 and TF-IDF retrieval
- PyMuPDF
- JWT
AI and data science4
- Ollama
- ChromaDB
- scikit-learn
- NLTK
Data and messaging1
- MongoDB
Frontend6
- React
- TypeScript
- Vite
- Tailwind CSS
- Radix UI
- TanStack Query
Integrations1
- Google Drive API