This project is a real-time Retrieval-Augmented Generation (RAG) system, powered by OpenAI's LLMs, integrated with a FastAPI backend and a multimodal ingestion pipeline. It enables users to interact with enterprise knowledge through document upload, querying, and support ticketing, all while leveraging vector search via Qdrant.
- RAG (Retrieval-Augmented Generation) using OpenAI and Qdrant
- Multimodal ingestion pipeline: Supports
.pdf
,.docx
,.png
- OpenAI Agent + Tool integration to dynamically call backend services
- FastAPI microservices for RAG & ticketing
- Support ticketing system with MongoDB
- Semantic vector search using OpenAI embeddings
- Client endpoints for interacting with the system in real-time
This system is composed of several interconnected services:
Endpoints to:
/query
: Search and retrieve knowledge with OpenAI + Qdrant/upload
: Bulk upload documents/update
: Update existing vector entries/delete
: Delete documents/llm-query
: Basic LLM RAG/mcp/query
: OpenAI Agent-based query routing with tools
Endpoints to:
/create-ticket
: Submit a new support request/tickets
: View all tickets/tickets/{userId}
: View user-specific tickets
Uses:
search_docs
: Queries knowledge baseadd_docs
: Uploads new documentsupdate_doc
: Updates vectorized entriesdelete_doc
: Removes documents from the vector DB
Handles file ingestion and embedding:
- Text extraction (
pytesseract
,python-docx
) - Embedding with
text-embedding-3-small
- Insertion into Qdrant
- Result logging to JSON
- Qdrant Cloud: Vector database for storing embeddings
- MongoDB Atlas: Stores tickets and user interactions
git clone https://github.com/anivenk25/Cervello.git
cd Cervello_server
We use uv
for virtual env management.
Ensure Python >= 3.10 is installed.
- For macOs/Linux
curl -LsSf https://astral.sh/uv/install.sh | sh
- For windows
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
- Using pip
pip install uv
Create a .env
file in the root and configure: (refer to env.local
OPENAI_API_KEY=your_openai_key
QDRANT_API_KEY=your_qdrant_key
QDRANT_URL=https://your-qdrant-url
MONGO_URI=mongodb+srv://...
- For windows
.venv\Scripts\activate
- For Linux
source .venv/bin/activate
uv pip install -r requirements.txt
- To run the server for queries and db updation/deletion
uvicorn mcp_server:app --reload --log-level debug
- To run the server for ticketing
uvicorn tickets:app --reload --log-level debug
.
├── main_app/
│ ├── app.py # FastAPI RAG endpoints
│ ├── ingestion/ # File parsing and embedding
│ └── agents/ # OpenAI agent tools
| └── tickets.py
| └── mcp_server.py
├── tickets/
│ └── tickets.py # Ticketing FastAPI service
├── examples/
│ └── gpt_4o_multimodal_rag/ # Demo apps and workflows
├── .env # Environment variables
├── pyproject.toml # Poetry config
└── README.md
- Send
.pdf
,.docx
, or.png
files to the/upload
endpoint. - Text will be extracted and embedded via OpenAI.
- Stored in Qdrant for semantic retrieval.
- Hit
/query
with a natural language question. - Top-k relevant documents retrieved from Qdrant.
- OpenAI responds with a generated answer.
- Use
/mcp/query
for enhanced query with tool calling. - OpenAI auto-selects appropriate tool like upload/search/update.
- The system may suggest creating a ticket.
- User can edit and submit via
/create-ticket
. - Stored in MongoDB and retrievable anytime.
- Python ≥ 3.10
- Poetry
- MongoDB Atlas account
- Qdrant Cloud account
- OpenAI API Key
Component | Technology |
---|---|
API Backend | FastAPI |
Vector Store | Qdrant |
Embeddings | OpenAI text-embedding-3-small |
Agent LLM | OpenAI GPT-3.5/GPT-4o |
Database | MongoDB Atlas |
Text Parsing | Pathway, pytesseract, python-docx |
Frontend Client | (Optional) Chat interface or Postman |
We welcome PRs, feedback, and issues. Please:
- Fork this repo
- Create a new branch
- Push your changes
- Open a Pull Request
MIT License
Feel free to reach out with questions or collaboration requests:
- Anirudh Venkateswaran
- Srishty M
- Rishi Das
- Organization: Cerevello