RAGnificent


NameRAGnificent JSON
Version 1.0 PyPI version JSON
download
home_pagehttps://github.com/Abul-Farhad/simple-rag
SummaryA simple RAG chatbot supporting multiple LLM providers
upload_time2025-07-17 10:48:10
maintainerNone
docs_urlNone
authorK. M. Abul Farhad-Ibn-Alam
requires_python>=3.9
licenseCustom
keywords llm chatbot rag openai groq gemini
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # RAGnificent - Your Magnificent RAG-Powered Chatbot Toolkit

![Python](https://img.shields.io/badge/python-3.9+-blue.svg)
![License](https://img.shields.io/badge/license-MIT-green.svg)
![RAG](https://img.shields.io/badge/arch-RAG-ff69b4.svg)
![LLM Compatible](https://img.shields.io/badge/LLM-OpenAI_Compatible-blueviolet.svg)

RAGnificent 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 RAGnificent?

- **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:

```bash
pip install path/to/RAGnificent-<version>-py3-none-any.whl
```

## Quick Start

```python
from RAGnificent 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

```python
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

**RAGnificent** is licensed under the **RAGnificent-License**:  

```text
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.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/Abul-Farhad/simple-rag",
    "name": "RAGnificent",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "llm chatbot rag openai groq gemini",
    "author": "K. M. Abul Farhad-Ibn-Alam",
    "author_email": "abulfarhad.ibnalam@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/80/51/10187e777e43b83851958e6030df99c550c548cedd8b97cbb9d628589273/ragnificent-1.0.tar.gz",
    "platform": null,
    "description": "# RAGnificent - Your Magnificent RAG-Powered Chatbot Toolkit\n\n![Python](https://img.shields.io/badge/python-3.9+-blue.svg)\n![License](https://img.shields.io/badge/license-MIT-green.svg)\n![RAG](https://img.shields.io/badge/arch-RAG-ff69b4.svg)\n![LLM Compatible](https://img.shields.io/badge/LLM-OpenAI_Compatible-blueviolet.svg)\n\nRAGnificent 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.\n\n## Why RAGnificent?\n\n- **LLM Agnostic** - Works with Groq, OpenAI, Gemini, and any OpenAI-compatible API\n- **Easy Tool Integration** - Add custom functions as tools with minimal code\n- **Flexible Configuration** - Support for both cloud and self-hosted LLMs\n- **Conversation Management** - Efficient short-term memory management with summarization technique\n- **Prompt Customization** - Flexible system and summary prompts\n- **Lightweight** - Minimal dependencies, maximum functionality\n\n## Installation\n\n1. Download the package from GitHub\n2. Install using pip:\n\n```bash\npip install path/to/RAGnificent-<version>-py3-none-any.whl\n```\n\n## Quick Start\n\n```python\nfrom RAGnificent import ChatAI, AgentParams\nimport os\n\n\ndef add(x: int, y: int) -> int:\n    \"\"\"Add two numbers together.\"\"\"\n    return x + y\n\n\ntools = [add]\n\n# For OpenAI-compatible endpoints\nrag = ChatAI()\nchatbot = rag.initiate_chatbot(\n    params=AgentParams(\n        model=\"gpt-3.5-turbo\",  # Or any other model\n        api_key=\"your_api_key\",\n        base_url=\"https://api.openai.com/v1\",  # Or your custom endpoint\n        system_prompt=\"You are a helpful AI assistant.\",\n        summary_prompt=\"Summarize the conversation concisely.\",\n        thread_id='1',\n        tools=tools,  # Optional\n        temperature=0.7  # Optional\n    )\n)\n\nwhile True:\n    user_input = input(\"You (q to quit): \")\n    if user_input.lower() == 'q':\n        break\n    response = chatbot.run(messages=user_input)\n    print(\"AI:\", response)\n```\n\n## Configuration Options\n\n### AgentParams\n\n| Parameter         | Type           | Description                                  | Required |\n|-------------------|----------------|----------------------------------------------|----------|\n| `model`           | str            | Model name (e.g. \"gpt-3.5-turbo\")           | Yes      |\n| `api_key`         | str            | Your API key                                | Yes      |\n| `base_url`        | str            | API base URL (default: OpenAI)              | No       |\n| `system_prompt`   | str            | Initial system prompt                       | Yes      |\n| `summary_prompt`  | str            | Prompt for conversation summaries           | Yes      |\n| `thread_id`       | str            | Conversation thread identifier              | Yes      |\n| `user_information`| dict           | User metadata for personalization           | No       |\n| `tools`          | list[callable] | Custom tools/functions to integrate         | No       |\n\n## Supported LLM Providers\n\n- OpenAI (including Azure OpenAI)\n- Groq\n- Gemini\n- Any OpenAI-compatible API (LocalAI, vLLM, etc.)\n- Anthropic Claude (via OpenAI compatibility layer)\n\n## Adding Custom Tools\n\n```python\ndef multiply(a: int, b: int) -> int:\n    \"\"\"Multiply two numbers together.\"\"\"\n    return a * b\n\ndef get_weather(city: str) -> str:\n    \"\"\"Get current weather for a given city.\"\"\"\n    return f\"Weather in {city}: Sunny\"\n\ntools = [multiply, get_weather]\n```\n\n## Best Practices\n\n1. Use environment variables for API keys\n2. Include clear docstrings for your tools\n3. Use type hints for better tool understanding\n4. Keep system prompts concise but descriptive\n5. Handle sensitive user information appropriately\n\n\n## License\n\n**RAGnificent** is licensed under the **RAGnificent-License**:  \n\n```text\nCopyright (c) 2025 [K. M. Abul Farhad-Ibn-Alam]\n\nPermission is hereby granted to any person obtaining a copy of this software\nand associated documentation files (the \"Software\") to use, modify, and distribute\nthe Software for any purpose, subject to the following conditions:\n\n1. Redistributions must retain this copyright notice.\n2. Commercial use requires written permission from the author.\n3. The author is not liable for any damages arising from Software use.\n\nAll rights not expressly granted are reserved by the author.\n",
    "bugtrack_url": null,
    "license": "Custom",
    "summary": "A simple RAG chatbot supporting multiple LLM providers",
    "version": "1.0",
    "project_urls": {
        "Homepage": "https://github.com/Abul-Farhad/simple-rag",
        "Source": "https://github.com/Abul-Farhad/simple-rag"
    },
    "split_keywords": [
        "llm",
        "chatbot",
        "rag",
        "openai",
        "groq",
        "gemini"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "c9388040e4d88aac85c461192804ef8e55fed5ebbbcef26528902bd23c6a8c7c",
                "md5": "e8e443a1bc4e8b92f454f3f1750abc4f",
                "sha256": "e8589dcd7ab9f94f1cf3bd10953540f3b02372ea61a45cdb015435a019af2209"
            },
            "downloads": -1,
            "filename": "ragnificent-1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e8e443a1bc4e8b92f454f3f1750abc4f",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 8957,
            "upload_time": "2025-07-17T10:48:08",
            "upload_time_iso_8601": "2025-07-17T10:48:08.510909Z",
            "url": "https://files.pythonhosted.org/packages/c9/38/8040e4d88aac85c461192804ef8e55fed5ebbbcef26528902bd23c6a8c7c/ragnificent-1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "805110187e777e43b83851958e6030df99c550c548cedd8b97cbb9d628589273",
                "md5": "62c5cd8a98f6ec0310761d8a2c140253",
                "sha256": "cf9a3bd9279e17e7fd4d9cc6818ad1e17ded374f2d10acfbca8fcddff3fa7edd"
            },
            "downloads": -1,
            "filename": "ragnificent-1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "62c5cd8a98f6ec0310761d8a2c140253",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 7083,
            "upload_time": "2025-07-17T10:48:10",
            "upload_time_iso_8601": "2025-07-17T10:48:10.206666Z",
            "url": "https://files.pythonhosted.org/packages/80/51/10187e777e43b83851958e6030df99c550c548cedd8b97cbb9d628589273/ragnificent-1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-17 10:48:10",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Abul-Farhad",
    "github_project": "simple-rag",
    "github_not_found": true,
    "lcname": "ragnificent"
}
        
Elapsed time: 1.87269s