Skip to main content

🚀 TUG (TheUltimateRAG)

A Modular, Production-Ready Foundation for Next-Generation AI Applications

Build scalable, secure, and intelligent RAG (Retrieval-Augmented Generation) systems without reinventing the wheel.

Python 3.10+ FastAPI LangChain License: MIT

🔗 Official Website & Documentation
👉 https://ultimaterag.vercel.app/

Key Features • Architecture • Getting Started • Visualizer • API • Contributing


📖 What is TUG (TheUltimateRAG)?

TUG (TheUltimateRAG) is a real-world, production-grade RAG framework, not just another tutorial or demo project.

It is designed to solve common problems developers face when moving from simple prototypes to scalable AI systems, such as:

  • Multi-user data separation
  • Long-term memory handling
  • Organizational knowledge sharing
  • Clean, modular architecture

Whether you’re building:

  • A corporate knowledge assistant
  • A legal or research AI
  • A personal second-brain
  • Or a multi-tenant SaaS AI platform

👉 TUG (TheUltimateRAG) gives you a strong, extensible backend foundation.

For a complete walkthrough, architecture deep-dives, and usage examples,
📘 visit the official documentation:
https://ultimaterag.vercel.app/

🔐 Environment Configuration for TheUltimateRAG

To run TheUltimateRAG correctly, you must create and configure a .env file.
This file stores environment-specific settings such as API keys, database configs, and runtime options.

The project uses Pydantic Settings + python-dotenv, so all variables defined in .env are automatically loaded at startup.


📁 Step 1: Create the .env File

At the root of the project, create a file named:

.env

⚙️ Step 2: Required & Optional Environment Variables

Below is a complete reference of supported environment variables, grouped by purpose.

You only need to configure the parts relevant to your setup.


🧩 Core Application Settings

APP_NAME=TheUltimateRAG
APP_ENV=development        # development | production
DEBUG=true
Variable Description
APP_NAME Application name
APP_ENV Runtime environment
DEBUG Enable/disable debug logs

🤖 LLM & Embedding Providers

LLM_PROVIDER=openai        # openai | ollama | anthropic
EMBEDDING_PROVIDER=openai # openai | ollama | huggingface
MODEL_NAME=gpt-3.5-turbo
Variable Description
LLM_PROVIDER LLM backend to use
EMBEDDING_PROVIDER Embedding model provider
MODEL_NAME Chat model name

🔑 API Keys (Required Based on Provider)

OpenAI

OPENAI_API_KEY=sk-xxxxxxxxxxxxxxxx

Anthropic

ANTHROPIC_API_KEY=sk-ant-xxxxxxxxxxxx

⚠️ Note: If LLM_PROVIDER or EMBEDDING_PROVIDER is set to openai, OPENAI_API_KEY must be provided, otherwise a warning will be shown.


🧠 Ollama Configuration (Local Models)

OLLAMA_BASE_URL=http://localhost:11434

Use this only if you are running Ollama locally.


🗂️ Vector Database Configuration

ChromaDB (Default – Local)

VECTOR_DB_TYPE=chroma
VECTOR_DB_PATH=./chroma_db_data
EMBEDDING_DIMENSION=1536

PostgreSQL + PGVector

VECTOR_DB_TYPE=postgres
POSTGRES_HOST=localhost
POSTGRES_PORT=5432
POSTGRES_DB=vector_db
POSTGRES_USER=postgres
POSTGRES_PASSWORD=postgres
Variable Description
VECTOR_DB_TYPE chroma or postgres
VECTOR_DB_PATH Local ChromaDB storage path
EMBEDDING_DIMENSION Vector embedding size

🧠 Memory & Conversation Storage (Redis)

MEMORY_WINDOW_SIZE=10
MEMORY_WINDOW_LIMIT=10

REDIS_HOST=localhost
REDIS_PORT=6379
REDIS_DB=0
REDIS_USER=default
REDIS_PASSWORD=

The system automatically builds the Redis connection URL internally.


🔄 How .env Is Loaded

The project uses:

  • python-dotenv
  • pydantic-settings
load_dotenv()
settings = Settings()

So no manual loading is required.


✅ Minimal .env (Quick Start)

If you want to get started quickly, this is enough:

OPENAI_API_KEY=sk-xxxxxxxxxxxxxxxx
LLM_PROVIDER=openai
EMBEDDING_PROVIDER=openai
VECTOR_DB_TYPE=chroma

⚠️ Important Notes

  • Do NOT commit .env to Git
  • Add .env to .gitignore
  • Use different .env files for dev & prod if needed

📘 Need More Help?

For advanced configuration, architecture details, and examples, visit:

👉 https://theultimaterag.vercel.app/


Metadata

Release files for ultimaterag 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ultimaterag 0.1.1
File Size Uploaded
ultimaterag-0.1.1.tar.gz 33.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ultimaterag 0.1.1
File Interpreter ABI Platform
ultimaterag-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 68.6 kB

Release files / ultimaterag-0.1.1.tar.gz

Download URL ultimaterag-0.1.1.tar.gz
Size 33.8 kB
Tags Source
SHA-256 checksum
How to use checksums
a2f9fdf803ea2bdef60b63604a9d35ef55a5abb857214a31d980ec9081f79db5
BLAKE2b-256 checksum
How to use checksums
962cdf1140eb68e1cc72c53eaf71651afd7c22eefd1cd185743d179db3ef271f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.2

Release files / ultimaterag-0.1.1-py3-none-any.whl

Download URL ultimaterag-0.1.1-py3-none-any.whl
Size 34.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
12971f5231d3d13c8e36c7a86a742a4a49a515754e074a6c307569e0082539e1
BLAKE2b-256 checksum
How to use checksums
e70e51d349b1e53770373c16a547c95c95cc20eabbb877ce969ec27c770d0970
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.2

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page