Framework
aigc-apps/PAI-RAG avatar
aigc-apps/PAI-RAG

PAI-RAG for configurable document retrieval and chat

An easy-to-use framework for modular RAG

511 stars76 forksPythonMIT

At a glance

What is it?
PAI-RAG combines document ingestion, configurable retrieval and a chat API. Its storage choice shapes which search modes a deployment can use.
Who is it for?
Consider PAI-RAG if operators need to inspect indexed chunks and manage collections through a web interface. A service that already owns document ingestion and only needs vector lookup can keep that smaller surface.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 120 days ago.
What is it written in?
Mainly Python, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on November 25, 2026, and from our analysis. They are not legal advice.

Editorial analysis

PAI-RAG puts document ingestion and retrieval behind a web application

PAI-RAG serves teams that want to upload documents, configure how they are indexed and make the resulting collections available to a chat application. The repository places a Next.js interface above a FastAPI backend. Its architecture diagram distinguishes the chat API from the retrieval API and shows knowledge base search as one tool available to the ReAct engine. That matters when diagnosing a weak answer. The retrieval configuration determines which passages are available, while the chat run determines how those passages are used. For a handbook trial, start with a question whose answer sits under a known heading. Inspect the matching content before treating the chat response as a measure of retrieval quality. The repository documents chunk-level inspection and editing, so there is a place to examine the indexed text even when the final answer reads plausibly.

Indexing decisions belong to each knowledge base

The README describes sentence, token, paragraph and layout-aware splitting, among other strategies. For a handbook with numbered procedures, the choice affects whether adjacent instructions stay together in a result. Paragraph splitting is a reasonable first comparison for prose, while layout-aware splitting is worth evaluating if reading order depends on the page structure. Those are trial choices, and the repository does not establish which strategy wins for a particular collection. PAI-RAG also documents background ingestion via Celery and Redis. During a trial, distinguish accepting an upload from being able to find its content through retrieval. Using a document with a distinctive heading gives an operator a concrete way to check indexing before asking a more ambiguous question about the procedure.

The storage backend determines the available retrieval modes

The README lists vector retrieval, full-text retrieval and a hybrid mode that combines vectors with BM25. Its backend matrix marks local Chroma as vector-only and lists Milvus, Elasticsearch and PostgreSQL with pgvector as supporting all three modes. That makes a local Chroma install a useful way to examine the interface and try semantic search. A team evaluating exact matches for internal identifiers needs a backend that exposes the text mode before drawing conclusions about hybrid search. Run a query containing an exact identifier and a second query that paraphrases the associated text. The contrast tells the evaluator which cases to include when comparing modes. It does not establish a general performance ranking for the listed backends.

Bring up the documented Compose deployment

The README starts the Docker deployment from the repository's docker directory. The following commands fetch the repository and create the environment file in that directory. Edit the copy with the values for the intended deployment before starting the services.

bash
git clone https://github.com/aigc-apps/PAI-RAG.git
cd PAI-RAG/docker
cp .env.example .env

Once configured, the following starts the Compose services in the background. The README directs users to localhost on port 8680 for the web interface.

bash
docker compose up -d

For a first use, create a knowledge base with a small Markdown document containing a known answer. After indexing, ask about the answer and inspect the stored chunk. Keep the source small enough to identify where the passage begins and ends. This makes the initial run about the configured ingestion and retrieval path before adding web or database tools.

A retrieval-only application has a smaller operating surface

A direct application against PostgreSQL with pgvector is an alternative for a team that already owns its API and document processing. It can keep vector lookups within that application's database workflow, with the team responsible for parsing documents, building embeddings and presenting results. PAI-RAG already provides a knowledge base interface and puts retrieval alongside other tools in its agent design. That broader architecture is useful when the web interface and content management are part of the requirement. It adds configuration work for a team that only needs to embed and query a fixed set of documents. The example environment also distinguishes transaction storage, vector storage and file storage. Backups for a trial promoted to service use therefore need to follow the chosen settings for all three.

Read the deployment settings alongside the release history

The repository is marked MIT and lists v0.4.3 dated 2026-02-11. Its recorded last push is 2026-07-29. Repository instructions and deployed release behavior can differ because the clone command follows the default branch. Use the files at the deployed revision when checking configuration. The top-level layout also contains Alembic migrations, giving an operator a specific place to inspect database changes before an upgrade. The environment example distinguishes local files from OSS, while the documentation describes compatible model endpoints and external tools. A team making a data residency decision needs to verify the model and storage it configures. A locally running web interface alone says little about which service handles model input.

Editorial conclusion

Consider PAI-RAG if operators need to inspect indexed chunks and manage collections through a web interface. A service that already owns document ingestion and only needs vector lookup can keep that smaller surface. Before adopting PAI-RAG for mixed keyword and semantic queries, confirm hybrid support in the configured backend using the same indexed collection.

Frequently asked questions

Can PAI-RAG run with local Chroma?

The README lists local Chroma and documents vector search for it.

Which PAI-RAG backends list hybrid retrieval?

The README lists Milvus, Elasticsearch and PostgreSQL with pgvector for hybrid retrieval.

Where does PAI-RAG expose its Compose web interface?

The quickstart directs users to http://localhost:8680 after startup.

Official sources

  1. aigc-apps/PAI-RAG on GitHub
  2. Issues
  3. License: MIT
  4. README
  5. Releases

Was this useful?