{"repo":"danny-avila/rag_api","free":true,"listed":false,"github":"https://github.com/danny-avila/rag_api","clone":"git clone https://github.com/danny-avila/rag_api.git","description":"ID-based RAG FastAPI: Integration with Langchain and PostgreSQL/pgvector","language":"Python","stars":885,"topics":["api","api-rest","embeddings","fastapi","langchain","pgvector","postgresql","psql","python","rag"],"license":"MIT","category":"ai-agents","readme_excerpt":"# ID-based RAG FastAPI Overview This project integrates Langchain with FastAPI in an Asynchronous, Scalable manner, providing a framework for document indexing and retrieval, using PostgreSQL/pgvector. Files are organized into embeddings by file id . The primary use case is for integration with LibreChat, but this simple API can be used for any ID-based use case. The main reason to use the ID approach is to work with embeddings on a file-level. This makes for targeted queries when combined with file metadata stored in a database, such as is done by LibreChat. The API will evolve over time to employ different querying/re-ranking methods, embedding models, and vector stores. Features - Document Management : Methods for adding, retrieving, and deleting documents. - Vector Store : Utilizes Langchain's vector store for efficient document retrieval. - Asynchronous Support : Offers async operations for enhanced performance. Retrieval scope Chunks are owned. Every route that reads or removes stored content resolves the caller's owner set from the verified token and puts it into the store query before ranking, so a chunk outside that set is never read into the process. The owner set is built in one place — app/scope.py — rather than re-derived per route. Before this release these routes addressed the store by caller-supplied file id alone, or authorized a whole result set from the first hit returned: - GET /ids listed every file id in the deployment. - POST /query multiple performed n","default_branch":null,"files":null,"tree":[],"storefront":"/r/danny-avila","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/danny-avila/rag_api/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}