2.1 KiB
2.1 KiB
What was implemented
- Replaced the previous Qdrant‑based vector store with a lightweight wrapper around ChromaDB (
src/vector_store.py). - Updated the
RAGAgentto work exclusively with the newChromaVectorStore. - Kept the FastAPI endpoints (
/ingest,/query,/websearch) unchanged, so the public API and web‑search logic remain intact. - Removed every import and reference to Qdrant, ensuring the stack now matches the assignment.
Why the main parts satisfy the requirements
ChromaVectorStorecreates a Chroma client and a collection, then exposesadd_documentsandsimilarity_searchthat match the original Qdrant interface.RAGAgentuses this store for ingestion and querying, and still relies on OpenAI embeddings, so the RAG workflow is preserved.- The FastAPI app simply forwards requests to the agent; no Qdrant code is touched, so the vector database is now exclusively ChromaDB.
- Web‑search utilities (
src/web_search.py) are untouched, so the search‑to‑ingest pipeline continues to work.
Key code excerpts
src/vector_store.py – Chroma client and collection creation
self.client = chromadb.Client()
self.collection = self.client.get_or_create_collection(name=collection_name)
src/rag_agent.py – ingestion uses the new store
self.vector_store.add_documents(docs_with_embeddings)
src/main.py – FastAPI endpoint that calls the agent
@app.post("/ingest")
def ingest(request: IngestRequest):
docs = [doc.dict() for doc in request.documents]
rag_agent.ingest(docs)
src/web_search.py – still feeds results into the agent
agent.ingest(docs_to_ingest)
Honest limitations
- ChromaDB is used in its default in‑memory mode; data will not persist across server restarts unless a persistent storage path is configured.
- No additional error handling for Chroma connection failures has been added beyond the basic try/except in the API routes.
Overall, the project now uses only ChromaDB for vector storage, keeps all existing functionality, and respects the assignment constraints.