rag-api
View on GitHubID-based RAG FastAPI: Integration with Langchain and PostgreSQL/pgvector
FastAPI + LangChain RAG service that embeds documents per file_id and stores them in PostgreSQL/pgvector (or Atlas MongoDB). It exposes async add/query/delete routes with JWT-verified owner scoping, built mainly as the retrieval backend for LibreChat.
Use Cases
ID-based document indexing and retrieval APIBackend RAG service for LibreChat knowledge basesAgent knowledge base storage owned by entity_idSemantic search over uploaded files with owner-scoped resultsIngesting PDF, DOCX, XLSX, PPTX and other office formats into embeddingsOCR-based ingestion of scanned documentsMulti-tenant retrieval where callers only read their own chunksPluggable vector store (pgvector or Atlas MongoDB) for RAG pipelines
Built With
- Language
- Python
- Frameworks
- FastAPI · LangChain · SQLAlchemy · pgvector · MongoDB Atlas Vector Search · Uvicorn · Pydantic · sentence-transformers · PyJWT · Docker · Poetry/pip
Tags
rag · fastapi · langchain · pgvector · postgresql · embeddings · vector-database · document-retrieval · async · mongodb-atlas · jwt-auth · chunking · file-id-scoping · api · python · multi-tenant