Skip to main content

RagChat transforms unstructured data for LLM interaction.

Project description

RagChat

RagChat enables interaction between large language models and unstructured data. It addresses challenges such as dynamic content updates, varied data sources, and retrieval accuracy by using an upsert-first architecture, filtering mechanisms, and a combination of knowledge graphs with vector search. It supports multi-user, custom models, and self-hosting to provide operational control.


Features

  • Upsert-first design: Supports constant updates.
  • Flexible metadata filtering: Information retrieval allows using custom fields.
  • Efficient knowledge graph: Graph is built using small models, promoting efficiency and scalability.
  • Multiuser support: Knowledge bases can be isolated or shared.
  • Language consistency: Prompts and examples use the specified language, improving reliability.
  • Async batch processing: Ingestion of multiple documents can be done in parallel with streaming progress updates.
  • Pluggable LLMs and Embedding models: Supports the use of custom models or connection to API endpoints; providers are easily swappable.
  • Open source & self-hostable: Operation occurs locally in Docker or directly on a machine, ensuring privacy.

Use Cases

  • Casual chat sessions with memories
  • Technical documentation search
  • Chat+file hybrid RAG with citations
  • Personal use
  • Multi-user setups

Quick start

Docker Compose is required for the easiest setup.

Install RagChat with pip:

pip install ragchat-ai

Recommended local models:

  • bge-m3 for embeddings
  • qwen3:4b or qwen3:8b for LLM -- Make sure 8k context length is supported.

Configure environment variables:

git clone https://github.com/raul3820/ragchat.git
cd ragchat
cp .env.example .env

Example: Open Webui

Run dependencies with:

docker compose up --build

After startup, the web chat UI is accessible at http://localhost:3001 (refer to .env for port).

Retrieval will be applied to all models. Two flows are presented:

  • Casual chat with memories (default)
  • Formal RAG with citations (triggered by writing # in the chat and selecting a file)

For file ingestion use: http://localhost:3001/workspace/knowledge

Example: Lihua benchmark with Python SDK

Run dependencies with:

docker compose up neo4j qdrant --build

Once the DB has started, run the file ingestion with:

python -m examples.lihua.step0_index --full

and the Q&A with

python -m examples.lihua.step1_qa --test recall --limit 5

Contributing

Contributions welcomed! Please see the CONTRIBUTING.md file for details on how to contribute.

  • Bug reports (issues)
  • Feature suggestions
  • Pull requests (inclusion of tests requested)
Roadmap

Performance:

  • Quick retrieval
  • Hybrid search
  • Multi-hop fact search
  • Query intent classification
  • Recency weighting
  • Better reranking
  • Structured aggregates
  • 3 phase ingestion (bm25, summaries, fact-entities)
  • Graph traversal
  • Custom tuning

Flows:

  • Chat
  • File
  • Group chat
  • Code
  • Web search

Integrations:

  • Python SDK
  • REST API server
  • Neo4j
  • Qdrant
  • Memgraph? (lower priority)
  • Docling
  • MCP
  • Open-Webui (pipelines)

Testing & Evals:

  • LiHua benchmark setup
  • LiHua benchmark comparison with other libraries
  • Integration test
  • Increase test coverage

Security:

  • Custom fields sanitization

Documentation:

  • Readme/Quick start
  • Library documentation
  • API documentation

Open Source & License

RagChat is MIT-licensed (see LICENSE). Self-hosting and extension are permitted. Certain features may require user-provided LLM/API keys.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ragchat_ai-0.3.0.tar.gz (64.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ragchat_ai-0.3.0-py3-none-any.whl (67.9 kB view details)

Uploaded Python 3

File details

Details for the file ragchat_ai-0.3.0.tar.gz.

File metadata

  • Download URL: ragchat_ai-0.3.0.tar.gz
  • Upload date:
  • Size: 64.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.11

File hashes

Hashes for ragchat_ai-0.3.0.tar.gz
Algorithm Hash digest
SHA256 b3168a78efa3f4406aaadc45e7e75cd5f43a21e3162122ed7478f22bb72533e2
MD5 6030b95648a27bc8dbe26c7b3d52d3de
BLAKE2b-256 f4a37b708a0ad8364529dbd52686e2495be153ed2d047bf24f8fe775165b559d

See more details on using hashes here.

File details

Details for the file ragchat_ai-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: ragchat_ai-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 67.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.11

File hashes

Hashes for ragchat_ai-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 906532bc81ce3d359d7d47212fba2032461d0a01d9cae8bf7a48e41f1771d637
MD5 76d9b53d0f8954f9ecc4cc41d180224c
BLAKE2b-256 cae9ad772713e1e837d5fe614f4f72d44a701a820e6e4160cf7fc358dff16186

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page