# π¦ AI-Parrot
**A unified Python library for building intelligent agents, chatbots, and LLM-powered applications**
AI-Parrot simplifies working with Large Language Models by providing a cohesive framework for creating conversational agents, managing tools, implementing RAG systems, and orchestrating complex AI workflowsβall without the bloat of traditional frameworks.
## β¨ Key Features
### π€ Multi-Provider LLM Support
Connect seamlessly to multiple AI providers through a unified interface:
- **OpenAI** (GPT-4, GPT-3.5)
- **Anthropic Claude** (Claude 3.5 Sonnet, Opus)
- **Google GenAI** (Gemini models)
- **Groq** (Fast inference)
### π οΈ Intelligent Agent System
Build sophisticated agents with built-in tool support and orchestration:
- **Tool Manager**: Share tools across multiple agents
- **Agent Registry**: Decorator-based agent creation and registration
- **Python Tool Calling**: Native support for calling Python functions as tools
- **Complex Toolkits**: Compose multiple tools into reusable toolkits
### π¬ Chatbot Creation
Create production-ready chatbots with minimal code:
- Conversational context management
- Multi-turn dialogue support
- Streaming responses
- Custom personality and behavior configuration
### ποΈ Knowledge Base & RAG
Implement Retrieval-Augmented Generation with enterprise-grade components:
- **PgVector Integration**: PostgreSQL-based vector storage for semantic search
- **Document Loaders**: Transform any document format into AI-ready context
- **Open-Source Embeddings**: Hugging Face Transformers integration
- **Structured Outputs**: Type-safe responses from your LLMs
### π API & Server Capabilities
Deploy your AI applications with ease:
- **Bot Manager**: Centralized management for multiple bot instances
- **REST API**: Expose your agents and chatbots via HTTP endpoints
- **MCP Server**: Model Context Protocol support for standardized agent communication
### β° Task Scheduling
Orchestrate agent actions over time:
- Schedule periodic agent tasks
- Trigger-based automation
- Asynchronous execution support
- Task dependency management
## π Quick Start
### Installation
```bash
pip install ai-parrot
```
### Create Your First Chatbot
```python
from ai_parrot import ChatBot, OpenAIClient
# Initialize LLM client
client = OpenAIClient(api_key="your-api-key")
# Create a chatbot
bot = ChatBot(
name="assistant",
client=client,
system_prompt="You are a helpful AI assistant."
)
# Have a conversation
response = bot.chat("What's the weather like today?")
print(response)
```
### Build an Agent with Tools
```python
from ai_parrot import Agent, tool
from ai_parrot.registry import agent_registry
@tool
def calculate_sum(a: int, b: int) -> int:
"""Add two numbers together."""
return a + b
@tool
def get_current_time() -> str:
"""Get the current time."""
from datetime import datetime
return datetime.now().strftime("%H:%M:%S")
# Register an agent with tools
@agent_registry.register("math_agent")
class MathAgent(Agent):
def __init__(self):
super().__init__(
name="Math Helper",
tools=[calculate_sum, get_current_time]
)
# Use the agent
agent = agent_registry.get("math_agent")
result = agent.run("What's 42 plus 58? Also, what time is it?")
```
### Implement RAG with Vector Store
```python
from ai_parrot import RAGChatBot, PgVectorStore
from ai_parrot.loaders import PDFLoader, TextLoader
# Initialize vector store
vector_store = PgVectorStore(
connection_string="postgresql://user:pass@localhost/db"
)
# Load and index documents
loader = PDFLoader()
documents = loader.load("./docs/manual.pdf")
vector_store.add_documents(documents)
# Create RAG-enabled chatbot
rag_bot = RAGChatBot(
client=client,
vector_store=vector_store,
top_k=5
)
# Query with context
response = rag_bot.chat("How do I configure the settings?")
```
### Expose via API
```python
from ai_parrot import BotManager, create_api
# Create bot manager
manager = BotManager()
manager.register_bot("assistant", bot)
manager.register_agent("math_helper", agent)
# Create and run API server
app = create_api(manager)
# Run with: uvicorn main:app --reload
```
### Schedule Agent Tasks
```python
from ai_parrot import TaskScheduler
scheduler = TaskScheduler()
# Schedule a daily summary
@scheduler.schedule(cron="0 9 * * *") # Every day at 9 AM
async def daily_summary():
summary = await agent.run("Generate a summary of yesterday's activities")
send_email(summary)
# Run the scheduler
scheduler.start()
```
## ποΈ Architecture
AI-Parrot is designed with modularity and extensibility in mind:
```
βββββββββββββββββββββββββββββββββββββββββββ
β Application Layer β
β (Chatbots, Agents, Custom Logic) β
ββββββββββββββββ¬βββββββββββββββββββββββββββ
β
ββββββββββββββββΌβββββββββββββββββββββββββββ
β AI-Parrot Core β
β β’ Agent Registry β’ Tool Manager β
β β’ Bot Manager β’ Task Scheduler β
ββββββββββββββββ¬βββββββββββββββββββββββββββ
β
ββββββββββββββββΌβββββββββββββββββββββββββββ
β Provider Integrations β
β β’ OpenAI β’ Claude β’ Gemini β
β β’ Groq β’ Hugging Face β
ββββββββββββββββ¬βββββββββββββββββββββββββββ
β
ββββββββββββββββΌβββββββββββββββββββββββββββ
β Storage & Infrastructure β
β β’ PgVector β’ Document Loaders β
β β’ MCP Server β’ API Layer β
βββββββββββββββββββββββββββββββββββββββββββ
```
## π― Use Cases
- **Customer Support Bots**: Build intelligent support agents with knowledge base integration
- **Research Assistants**: Create agents that can search, analyze, and synthesize information
- **Automation Workflows**: Schedule and orchestrate AI-powered tasks
- **Internal Tools**: Expose LLM capabilities through APIs for your team
- **Multi-Agent Systems**: Coordinate multiple specialized agents working together
## πΊοΈ Roadmap
- β
**Langchain Independence**: Removed heavyweight dependencies
- π§ **Complex Toolkits**: Advanced tool composition and chaining
- π§ **Model Interoperability**: Seamless LLM + Hugging Face model integration
- π **Non-LLM Models**: Support for classification, NER, and other ML models
- π **MCP Full Integration**: Complete Model Context Protocol implementation
- π **Graph-Based RAG**: Knowledge graphs with ArangoDB for advanced reasoning
## π€ Contributing
Contributions are welcome! Whether it's bug fixes, new features, or documentation improvements, we appreciate your help in making AI-Parrot better.
## π License
MIT License.
## π Documentation
For detailed documentation, examples, and API reference, see the examples/ folder.
## π¬ Community & Support
- **Issues**: [GitHub Issues](your-github-repo/issues)
- **Discussions**: [GitHub Discussions](your-github-repo/discussions)
---
Built with β€οΈ for developers who want powerful AI tools without the complexity.
Raw data
{
"_id": null,
"home_page": null,
"name": "ai-parrot",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10.1",
"maintainer_email": null,
"keywords": "asyncio, asyncpg, aioredis, aiomcache, artificial intelligence, ai, chatbot, agents",
"author": null,
"author_email": "Jesus Lara <jesuslara@phenobarbital.info>",
"download_url": null,
"platform": null,
"description": "# \ud83e\udd9c AI-Parrot\n\n**A unified Python library for building intelligent agents, chatbots, and LLM-powered applications**\n\nAI-Parrot simplifies working with Large Language Models by providing a cohesive framework for creating conversational agents, managing tools, implementing RAG systems, and orchestrating complex AI workflows\u2014all without the bloat of traditional frameworks.\n\n## \u2728 Key Features\n\n### \ud83e\udd16 Multi-Provider LLM Support\nConnect seamlessly to multiple AI providers through a unified interface:\n- **OpenAI** (GPT-4, GPT-3.5)\n- **Anthropic Claude** (Claude 3.5 Sonnet, Opus)\n- **Google GenAI** (Gemini models)\n- **Groq** (Fast inference)\n\n### \ud83d\udee0\ufe0f Intelligent Agent System\nBuild sophisticated agents with built-in tool support and orchestration:\n- **Tool Manager**: Share tools across multiple agents\n- **Agent Registry**: Decorator-based agent creation and registration\n- **Python Tool Calling**: Native support for calling Python functions as tools\n- **Complex Toolkits**: Compose multiple tools into reusable toolkits\n\n### \ud83d\udcac Chatbot Creation\nCreate production-ready chatbots with minimal code:\n- Conversational context management\n- Multi-turn dialogue support\n- Streaming responses\n- Custom personality and behavior configuration\n\n### \ud83d\uddc4\ufe0f Knowledge Base & RAG\nImplement Retrieval-Augmented Generation with enterprise-grade components:\n- **PgVector Integration**: PostgreSQL-based vector storage for semantic search\n- **Document Loaders**: Transform any document format into AI-ready context\n- **Open-Source Embeddings**: Hugging Face Transformers integration\n- **Structured Outputs**: Type-safe responses from your LLMs\n\n### \ud83c\udf10 API & Server Capabilities\nDeploy your AI applications with ease:\n- **Bot Manager**: Centralized management for multiple bot instances\n- **REST API**: Expose your agents and chatbots via HTTP endpoints\n- **MCP Server**: Model Context Protocol support for standardized agent communication\n\n### \u23f0 Task Scheduling\nOrchestrate agent actions over time:\n- Schedule periodic agent tasks\n- Trigger-based automation\n- Asynchronous execution support\n- Task dependency management\n\n## \ud83d\ude80 Quick Start\n\n### Installation\n\n```bash\npip install ai-parrot\n```\n\n### Create Your First Chatbot\n\n```python\nfrom ai_parrot import ChatBot, OpenAIClient\n\n# Initialize LLM client\nclient = OpenAIClient(api_key=\"your-api-key\")\n\n# Create a chatbot\nbot = ChatBot(\n name=\"assistant\",\n client=client,\n system_prompt=\"You are a helpful AI assistant.\"\n)\n\n# Have a conversation\nresponse = bot.chat(\"What's the weather like today?\")\nprint(response)\n```\n\n### Build an Agent with Tools\n\n```python\nfrom ai_parrot import Agent, tool\nfrom ai_parrot.registry import agent_registry\n\n@tool\ndef calculate_sum(a: int, b: int) -> int:\n \"\"\"Add two numbers together.\"\"\"\n return a + b\n\n@tool\ndef get_current_time() -> str:\n \"\"\"Get the current time.\"\"\"\n from datetime import datetime\n return datetime.now().strftime(\"%H:%M:%S\")\n\n# Register an agent with tools\n@agent_registry.register(\"math_agent\")\nclass MathAgent(Agent):\n def __init__(self):\n super().__init__(\n name=\"Math Helper\",\n tools=[calculate_sum, get_current_time]\n )\n\n# Use the agent\nagent = agent_registry.get(\"math_agent\")\nresult = agent.run(\"What's 42 plus 58? Also, what time is it?\")\n```\n\n### Implement RAG with Vector Store\n\n```python\nfrom ai_parrot import RAGChatBot, PgVectorStore\nfrom ai_parrot.loaders import PDFLoader, TextLoader\n\n# Initialize vector store\nvector_store = PgVectorStore(\n connection_string=\"postgresql://user:pass@localhost/db\"\n)\n\n# Load and index documents\nloader = PDFLoader()\ndocuments = loader.load(\"./docs/manual.pdf\")\nvector_store.add_documents(documents)\n\n# Create RAG-enabled chatbot\nrag_bot = RAGChatBot(\n client=client,\n vector_store=vector_store,\n top_k=5\n)\n\n# Query with context\nresponse = rag_bot.chat(\"How do I configure the settings?\")\n```\n\n### Expose via API\n\n```python\nfrom ai_parrot import BotManager, create_api\n\n# Create bot manager\nmanager = BotManager()\nmanager.register_bot(\"assistant\", bot)\nmanager.register_agent(\"math_helper\", agent)\n\n# Create and run API server\napp = create_api(manager)\n\n# Run with: uvicorn main:app --reload\n```\n\n### Schedule Agent Tasks\n\n```python\nfrom ai_parrot import TaskScheduler\n\nscheduler = TaskScheduler()\n\n# Schedule a daily summary\n@scheduler.schedule(cron=\"0 9 * * *\") # Every day at 9 AM\nasync def daily_summary():\n summary = await agent.run(\"Generate a summary of yesterday's activities\")\n send_email(summary)\n\n# Run the scheduler\nscheduler.start()\n```\n\n## \ud83c\udfd7\ufe0f Architecture\n\nAI-Parrot is designed with modularity and extensibility in mind:\n\n```\n\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n\u2502 Application Layer \u2502\n\u2502 (Chatbots, Agents, Custom Logic) \u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n \u2502\n\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u25bc\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n\u2502 AI-Parrot Core \u2502\n\u2502 \u2022 Agent Registry \u2022 Tool Manager \u2502\n\u2502 \u2022 Bot Manager \u2022 Task Scheduler \u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n \u2502\n\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u25bc\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n\u2502 Provider Integrations \u2502\n\u2502 \u2022 OpenAI \u2022 Claude \u2022 Gemini \u2502\n\u2502 \u2022 Groq \u2022 Hugging Face \u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n \u2502\n\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u25bc\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n\u2502 Storage & Infrastructure \u2502\n\u2502 \u2022 PgVector \u2022 Document Loaders \u2502\n\u2502 \u2022 MCP Server \u2022 API Layer \u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n```\n\n## \ud83c\udfaf Use Cases\n\n- **Customer Support Bots**: Build intelligent support agents with knowledge base integration\n- **Research Assistants**: Create agents that can search, analyze, and synthesize information\n- **Automation Workflows**: Schedule and orchestrate AI-powered tasks\n- **Internal Tools**: Expose LLM capabilities through APIs for your team\n- **Multi-Agent Systems**: Coordinate multiple specialized agents working together\n\n## \ud83d\uddfa\ufe0f Roadmap\n\n- \u2705 **Langchain Independence**: Removed heavyweight dependencies\n- \ud83d\udea7 **Complex Toolkits**: Advanced tool composition and chaining\n- \ud83d\udea7 **Model Interoperability**: Seamless LLM + Hugging Face model integration\n- \ud83d\udccb **Non-LLM Models**: Support for classification, NER, and other ML models\n- \ud83d\udccb **MCP Full Integration**: Complete Model Context Protocol implementation\n- \ud83d\udccb **Graph-Based RAG**: Knowledge graphs with ArangoDB for advanced reasoning\n\n## \ud83e\udd1d Contributing\n\nContributions are welcome! Whether it's bug fixes, new features, or documentation improvements, we appreciate your help in making AI-Parrot better.\n\n## \ud83d\udcc4 License\n\nMIT License.\n\n## \ud83d\udcda Documentation\n\nFor detailed documentation, examples, and API reference, see the examples/ folder.\n\n## \ud83d\udcac Community & Support\n\n- **Issues**: [GitHub Issues](your-github-repo/issues)\n- **Discussions**: [GitHub Discussions](your-github-repo/discussions)\n\n---\n\nBuilt with \u2764\ufe0f for developers who want powerful AI tools without the complexity.\n",
"bugtrack_url": null,
"license": null,
"summary": "Chatbot services for Navigator, based on Langchain",
"version": "0.15.10",
"project_urls": {
"Documentation": "https://github.com/phenobarbital/ai-parrot/",
"Funding": "https://paypal.me/phenobarbital",
"Homepage": "https://github.com/phenobarbital/ai-parrot",
"Say Thanks!": "https://saythanks.io/to/phenobarbital",
"Source": "https://github.com/phenobarbital/ai-parrot",
"Tracker": "https://github.com/phenobarbital/ai-parrot/issues"
},
"split_keywords": [
"asyncio",
" asyncpg",
" aioredis",
" aiomcache",
" artificial intelligence",
" ai",
" chatbot",
" agents"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "e7cce86d4bd529bb41ec972afd9d4c8c6c8e5304d46272dd5810123faecd6a4c",
"md5": "7a224cb29359cecfe3e0a2b4dc466407",
"sha256": "4287e10e0caf59742f5459b0435fe784baeb7d4224ed5e0070a19f4744b407dc"
},
"downloads": -1,
"filename": "ai_parrot-0.15.10-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl",
"has_sig": false,
"md5_digest": "7a224cb29359cecfe3e0a2b4dc466407",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": ">=3.10.1",
"size": 2095035,
"upload_time": "2025-10-24T01:04:19",
"upload_time_iso_8601": "2025-10-24T01:04:19.936370Z",
"url": "https://files.pythonhosted.org/packages/e7/cc/e86d4bd529bb41ec972afd9d4c8c6c8e5304d46272dd5810123faecd6a4c/ai_parrot-0.15.10-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "d87e26e687b0616b5a87407b8480d95b7da99b00efe8197db20955862ae5951e",
"md5": "c399df64a61ddde60b3bb83a5eb6b50b",
"sha256": "70eab1e64c9ed85073af6c09b4abd5d6c385505b57736f4e353f30fb2368a428"
},
"downloads": -1,
"filename": "ai_parrot-0.15.10-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl",
"has_sig": false,
"md5_digest": "c399df64a61ddde60b3bb83a5eb6b50b",
"packagetype": "bdist_wheel",
"python_version": "cp311",
"requires_python": ">=3.10.1",
"size": 2144066,
"upload_time": "2025-10-24T01:04:22",
"upload_time_iso_8601": "2025-10-24T01:04:22.055992Z",
"url": "https://files.pythonhosted.org/packages/d8/7e/26e687b0616b5a87407b8480d95b7da99b00efe8197db20955862ae5951e/ai_parrot-0.15.10-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "03d989c5f6bd99b4013be335213add64dc0ae6de2a3331f60512f547c5ac325c",
"md5": "672b57007ba11d8f8760b57925dbb9c0",
"sha256": "0d8388b77fcc462e303ce06fe417d67360b787acca22bdafabab89829fd21d3d"
},
"downloads": -1,
"filename": "ai_parrot-0.15.10-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl",
"has_sig": false,
"md5_digest": "672b57007ba11d8f8760b57925dbb9c0",
"packagetype": "bdist_wheel",
"python_version": "cp312",
"requires_python": ">=3.10.1",
"size": 2220492,
"upload_time": "2025-10-24T01:04:24",
"upload_time_iso_8601": "2025-10-24T01:04:24.107603Z",
"url": "https://files.pythonhosted.org/packages/03/d9/89c5f6bd99b4013be335213add64dc0ae6de2a3331f60512f547c5ac325c/ai_parrot-0.15.10-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-10-24 01:04:19",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "phenobarbital",
"github_project": "ai-parrot",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"tox": true,
"lcname": "ai-parrot"
}