rag_api logo

rag_api

danny-avila/rag_api

ID-based RAG FastAPI: Integration with Langchain and PostgreSQL/pgvector

GraphCanon updated 4d · GitHub synced 4d

885 stars387 forksLast push 1w Python MIT

Decision brief

Key Insights for Using rag_api as an ID-based RAG FastAPI Tool with Langchain and PostgreSQL/pgvector Integration

Good fit when

  • When you need rapid integration of REST API services for Retrieval-Augmented Generation (RAG) with robust vector storage.
  • If your use case benefits from the efficiency of PostgreSQL/pgvector combination, where scalable vector search operations are required.

Avoid when

  • Avoid using if your project cannot leverage PostgreSQL/pgvector due to license or compatibility constraints.
  • Not recommended for scenarios where high-level orchestration of multiple APIs and services is necessary without a direct need for FastAPI's simplicity.

Observed Jul 11, 2026 · Source: enrich:decision_facts

Verify the decision

Maintenance and security

Full trust report
Maintenance
Very active (6d since push)
As of 4d
Provenance
Not a fork · Personal account
As of 4d
Security (OSV)
No lockfile
As of 1mo

Public GitHub metadata and optional OSV scans. Signals, not a guarantee. Trust methodology.

Install

pip install rag_api
PyPI

Similar tools

Same-category neighbours. No typed graph edges are catalogued for this tool yet.

Evidence and technical details

Sourced facts, taxonomy, compatibility claims, README excerpt, and machine-readable endpoints.

Overview

A FastAPI-based API for ID-based retrieval-augmented generation (RAG) systems, integrated with Langchain and using PostgreSQL/pgvector as the vector database.

Capability facts

Deploy
Self-host

Source: dockerfile:Dockerfile · Aug 21, 2026

Docker
Dockerfile present

Source: dockerfile:Dockerfile · Aug 21, 2026

Languages
python

Source: github.language · Aug 21, 2026

Categories

Compatibility

Sourced claims from the README excerpt - not unsourced marketing copy.

Python runtimePython

Source: README excerpt (regex_v1, Aug 21, 2026)

ollowing commands (preferably in a [virtual environment](https://realpython.com/python-virtual-environments-a-primer/))
Source link

Tags

README

Getting Started

  • Configure .env file based on section below
  • Setup pgvector database:
    • Run an existing PSQL/PGVector setup, or,
    • Docker: docker compose up (also starts RAG API)
      • or, use docker just for DB: docker compose -f ./db-compose.yaml up
  • Run API:
    • Docker: docker compose up (also starts PSQL/pgvector)
      • or, use docker just for RAG API: docker compose -f ./api-compose.yaml up
    • Local:
      • Make sure to setup DB_HOST to the correct database hostname
      • Run the following commands (preferably in a virtual environment)
pip install -r requirements.txt
uvicorn main:app

Clean Install (Local Development)

To do a clean reinstall of all dependencies (e.g., after updating requirements.txt):


---

### Cloud Installation Settings:

#### AWS:
Make sure your RDS Postgres instance adheres to this requirement:

`The pgvector extension version 0.5.0 is available on database instances in Amazon RDS running PostgreSQL 15.4-R2 and higher, 14.9-R2 and higher, 13.12-R2 and higher, and 12.16-R2 and higher in all applicable AWS Regions, including the AWS GovCloud (US) Regions.`

In order to setup RDS Postgres with RAG API, you can follow these steps:

* Create a RDS Instance/Cluster using the provided [AWS Documentation](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_CreateDBInstance.html).
* Login to the RDS Cluster using the Endpoint connection string from the RDS Console or from your IaC Solution output.
* The login is via the *Master User*.
* Create a dedicated database for rag_api:
``` create database rag_api;```.
* Create a dedicated user\role for that database:
``` create role rag;```

* Switch to the database you just created: ```\c rag_api```
* Enable the Vector extension: ```create extension vector;```
* Use the documentation provided above to set up the connection string to the RDS Postgres Instance\Cluster.

Notes:
  * Even though you're logging with a Master user, it doesn't have all the super user privileges, that's why we cannot use the command: ```create role x with superuser;```
  * If you do not enable the extension, rag_api service will throw an error that it cannot create the extension due to the note above.

For agents

This page has a .md twin and JSON over the API.

Was this helpful?

Anonymous feedback helps us improve pages and translations.