Skip to main content

A simple RAG chatbot supporting multiple LLM providers

Reason this release was yanked:

wrong github source added mistakenly

Project description

RAGnificentAI - Your Magnificent RAG-Powered Chatbot Toolkit

Python License RAG LLM Compatible

RAGnificentAI is a Python package that enables developers to quickly build powerful chatbots with seamless tool integration and Retrieval-Augmented Generation (RAG) capabilities, supporting any OpenAI-compatible LLM.

Why RAGnificentAI?

  • LLM Agnostic - Works with Groq, OpenAI, Gemini, and any OpenAI-compatible API
  • Easy Tool Integration - Add custom functions as tools with minimal code
  • Flexible Configuration - Support for both cloud and self-hosted LLMs
  • Conversation Management - Efficient short-term memory management with summarization technique
  • Prompt Customization - Flexible system and summary prompts
  • Lightweight - Minimal dependencies, maximum functionality

Installation

  1. Download the package from GitHub
  2. Install using pip:
pip install path/to/RAGnificentAI-<version>-py3-none-any.whl

Quick Start

from RAGnificentAI import ChatAI, AgentParams
import os


def add(x: int, y: int) -> int:
    """Add two numbers together."""
    return x + y


tools = [add]

# For OpenAI-compatible endpoints
rag = ChatAI()
chatbot = rag.initiate_chatbot(
    params=AgentParams(
        model="gpt-3.5-turbo",  # Or any other model
        api_key="your_api_key",
        base_url="https://api.openai.com/v1",  # Or your custom endpoint
        system_prompt="You are a helpful AI assistant.",
        summary_prompt="Summarize the conversation concisely.",
        thread_id='1',
        tools=tools,  # Optional
        temperature=0.7  # Optional
    )
)

while True:
    user_input = input("You (q to quit): ")
    if user_input.lower() == 'q':
        break
    response = chatbot.run(messages=user_input)
    print("AI:", response)

Configuration Options

AgentParams

Parameter Type Description Required
model str Model name (e.g. "gpt-3.5-turbo") Yes
api_key str Your API key Yes
base_url str API base URL (default: OpenAI) No
system_prompt str Initial system prompt Yes
summary_prompt str Prompt for conversation summaries Yes
thread_id str Conversation thread identifier Yes
user_information dict User metadata for personalization No
tools list[callable] Custom tools/functions to integrate No

Supported LLM Providers

  • OpenAI (including Azure OpenAI)
  • Groq
  • Gemini
  • Any OpenAI-compatible API (LocalAI, vLLM, etc.)
  • Anthropic Claude (via OpenAI compatibility layer)

Adding Custom Tools

def multiply(a: int, b: int) -> int:
    """Multiply two numbers together."""
    return a * b

def get_weather(city: str) -> str:
    """Get current weather for a given city."""
    return f"Weather in {city}: Sunny"

tools = [multiply, get_weather]

Best Practices

  1. Use environment variables for API keys
  2. Include clear docstrings for your tools
  3. Use type hints for better tool understanding
  4. Keep system prompts concise but descriptive
  5. Handle sensitive user information appropriately

License

RAGnificentAI is licensed under the RAGnificentAI Custom License:

Copyright (c) 2025 [K. M. Abul Farhad-Ibn-Alam]

Permission is hereby granted to any person obtaining a copy of this software
and associated documentation files (the "Software") to use, modify, and distribute
the Software for any purpose, subject to the following conditions:

1. Redistributions must retain this copyright notice.
2. Commercial use requires written permission from the author.
3. The author is not liable for any damages arising from Software use.

All rights not expressly granted are reserved by the author.

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

ragnificentai-1.0.tar.gz (7.1 kB view details)

Uploaded Source

Built Distribution

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

ragnificentai-1.0-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

Details for the file ragnificentai-1.0.tar.gz.

File metadata

  • Download URL: ragnificentai-1.0.tar.gz
  • Upload date:
  • Size: 7.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for ragnificentai-1.0.tar.gz
Algorithm Hash digest
SHA256 60be29738e0b0f5ba2620a1d285d684e477b75c0c60a615b0c40f0ef6509fb81
MD5 c2cf2c475a507d97f4795b16edb38dad
BLAKE2b-256 f92a54cfe9b503aa4c92264c424cfbc94a3c2ad8dfdeece48a3c7c040c942ae0

See more details on using hashes here.

File details

Details for the file ragnificentai-1.0-py3-none-any.whl.

File metadata

  • Download URL: ragnificentai-1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for ragnificentai-1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8928b10316a6e9cf3ffb4fdbc06cf22d7a5cfc9447d97734d52f6a5259322b08
MD5 ad6db2c060aebe5f84ac2be08e802161
BLAKE2b-256 c47eb7677e6b36db69148568f27369ababcbe82d9445ea01ffdd7b634ef96d54

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