T-AI-project


NameT-AI-project JSON
Version 0.1.0 PyPI version JSON
download
home_pageNone
SummaryA Simplified Agent Framework to create ai agent with tools,mcps and memory/deps management
upload_time2025-07-28 16:27:51
maintainerNone
docs_urlNone
authorNone
requires_python>=3.9
licenseMIT
keywords ai assistant google-ai mcp openai pydantic-ai
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # T_AI - AI Agent Framework

A powerful framework for building AI agents with **MCP (Model Context Protocol)** integration, **tools**, **memory management**, and **dependency handling**. T_AI simplifies the creation of sophisticated AI agents by providing a unified interface for multiple LLMs, external tools, and advanced conversation management.

## ๐Ÿš€ Key Features

- **๐Ÿ”— MCP Integration**: Seamless connection to external tools and services via Model Context Protocol
- **๐Ÿ› ๏ธ Tool System**: Built-in Google tools (image search, code execution) and easy custom tool integration  
- **๐Ÿง  Memory Management**: Intelligent conversation summarization for long-running sessions
- **๐Ÿ“ฆ Dependency Management**: Clean state management and user context handling
- **๐Ÿค– Multi-LLM Support**: Compatible with Google Gemini, OpenAI, and Anthropic models
- **๐Ÿ“ฑ Media Support**: Handle text, audio, images, and PDF files seamlessly
- **โšก Async/Await**: Full asynchronous support for optimal performance
- **๐Ÿ”Œ Extensible**: Easy to extend with custom tools and integrations

## ๐Ÿ“ฆ Installation

### Using UV (Recommended)

```bash
# Clone the repository
git clone <repository-url>
cd T_AI

# Install using UV
uv sync
```

### Using pip

```bash
pip install -e .
```

### Using pip with requirements.txt

```bash
pip install -r requirements.txt
```

## ๐Ÿ”ง Core Dependencies

- **pydantic-ai >= 0.4.0**: Core AI framework
- **tavily-python >= 0.5.1**: Web search capabilities

## ๐Ÿš€ Quick Start

### Basic Agent Creation

```python
import asyncio
from t_ai.t_agent import TAgent, Deps
from pydantic_ai.models.google import GoogleModel
from pydantic_ai.providers.google import GoogleProvider

# Initialize with Google Gemini
llm = GoogleModel('gemini-2.5-flash', provider=GoogleProvider(api_key="your-api-key"))
agent = TAgent(llm=llm)

# Simple conversation
async def main():
    async with agent:
        response = await agent.chat(["Hello, what can you help me with?"])
        print(f"UI Version: {response.ui_version}")
        print(f"Voice Version: {response.voice_version}")

asyncio.run(main())
```

### With OpenAI

```python
from pydantic_ai.models.openai import OpenAIModel
from pydantic_ai.providers.openai import OpenAIProvider

llm = OpenAIModel('gpt-4-mini', provider=OpenAIProvider(api_key="your-openai-key"))
agent = TAgent(llm=llm)
```

## ๐Ÿ› ๏ธ Framework Configuration

### TAgent Parameters

```python
agent = TAgent(
    llm=your_llm,                              # Required: pydantic-ai compatible model
    deps=custom_deps,                          # Optional: Custom dependencies object
    instructions="Custom instructions",        # Optional: Agent instructions
    tools=[],                                  # Optional: List of custom tools
    mcp_servers=[],                            # Optional: List of MCP servers
    summarizer=False,                          # Optional: Enable conversation summarization
    custom_summarizer_agent=None,              # Optional: Custom summarizer agent
    memory_length=20,                          # Optional: Messages before summarization
    memory_summarizer_length=15,               # Optional: Messages to summarize
    use_memory=True                            # Optional: Enable/disable memory
)
```

## ๐Ÿ”— MCP Server Integration

### Using MCP Helper (Recommended)

```python
from t_ai.utils.helper_functions import MCP_server_helper
from t_ai.t_agent import TAgent

# Create MCP helper
mcp_helper = MCP_server_helper()

# Add different types of MCP servers
mcp_helper.add_mpc_server(type='http', mpc_server_url='https://mcp.notion.com/mcp')
mcp_helper.add_mpc_server(type='sse', mpc_server_url='https://mcp.notion.com/sse')
mcp_helper.add_mpc_server(type='stdio', command='npx', args=['-y', 'mcp-remote', 'https://mcp.notion.com/mcp'])

# Initialize agent with MCP servers
agent = TAgent(llm=llm, mcp_servers=mcp_helper.get_mpc_servers())
```

### Direct MCP Server Setup

```python
from pydantic_ai.mcp import MCPServerStreamableHTTP, MCPServerSSE, MCPServerStdio

mcp_servers = [
    MCPServerStreamableHTTP(url='https://mcp.notion.com/mcp'),
    MCPServerSSE(url='https://mcp.notion.com/sse'),
    MCPServerStdio(command='npx', args=['-y', 'mcp-remote', 'https://mcp.notion.com/mcp'])
]

agent = TAgent(llm=llm, mcp_servers=mcp_servers)
```

## ๐Ÿ› ๏ธ Built-in Tools

### Google Image Search Tool

```python
from t_ai.PrebuiltTools.google_tools import search_images_tool

# Setup image search
image_tool = search_images_tool(
    api_key="your-google-api-key",
    search_engine_id="your-custom-search-engine-id"
)

agent = TAgent(llm=llm, tools=[image_tool])

# Usage
response = await agent.chat(["Find me an image of a sunset"])
```

### Google Code Execution Tool

```python
from t_ai.PrebuiltTools.google_tools import code_execution_tool

# Setup code execution  
code_tool = code_execution_tool(api_key="your-gemini-api-key")

agent = TAgent(llm=llm, tools=[code_tool])

# Usage
response = await agent.chat(["Calculate the factorial of 10 using Python"])
```

### Combined Tools Example

```python
from t_ai.PrebuiltTools.google_tools import search_images_tool, code_execution_tool

tools = [
    search_images_tool(api_key=google_api_key, search_engine_id=search_engine_id),
    code_execution_tool(api_key=google_api_key)
]

agent = TAgent(llm=llm, tools=tools)
```

## ๐Ÿ’พ Memory Management

### Enable Automatic Summarization

```python
agent = TAgent(
    llm=llm,
    summarizer=True,                    # Enable summarization
    memory_length=20,                   # Summarize after 20 messages
    memory_summarizer_length=15         # Summarize oldest 15 messages
)
```

### Custom Summarizer Agent

```python
from pydantic_ai import Agent

custom_summarizer = Agent(
    llm, 
    instructions='Create detailed technical summaries focusing on code and solutions.'
)

agent = TAgent(
    llm=llm,
    summarizer=True,
    custom_summarizer_agent=custom_summarizer
)
```

### Memory and State Management

```python
# Access conversation history
messages = agent.memory.messages

# Access agent dependencies
deps = agent.deps
user_name = agent.deps.user
agents_output = agent.deps.agents_output

# Reset agent state
agent.reset()
```

## ๐Ÿ“ฑ Media Support

### Text Input

```python
response = await agent.chat(["What's the weather like today?"])
```

### Image Input

```python
from pydantic_ai.messages import BinaryContent

# From file
with open("image.png", "rb") as f:
    image_data = f.read()

response = await agent.chat([
    "What do you see in this image?",
    BinaryContent(data=image_data, media_type='image/png')
])
```

### Audio Input

```python
# Audio file
with open("audio.wav", "rb") as f:
    audio_data = f.read()

response = await agent.chat([
    "Transcribe this audio",
    BinaryContent(data=audio_data, media_type='audio/wav')
])
```

### PDF Input

```python
# PDF file
with open("document.pdf", "rb") as f:
    pdf_data = f.read()

response = await agent.chat([
    "Summarize this document",
    BinaryContent(data=pdf_data, media_type='application/pdf')
])
```

## ๐Ÿ”ง Advanced Usage

### Context Manager (Recommended)

```python
async def main():
    async with TAgent(llm=llm, mcp_servers=mcp_servers) as agent:
        # MCP servers are automatically connected
        response = await agent.chat(["Help me with my Notion workspace"])
        print(response.ui_version)
        # MCP servers are automatically disconnected
```

### Manual Connection Management

```python
agent = TAgent(llm=llm, mcp_servers=mcp_servers)

# Connect manually
await agent.connect()

try:
    response = await agent.chat(["Hello"])
finally:
    # Disconnect manually
    await agent.disconnect()
```

### Custom Dependencies

```python
from t_ai.t_agent import Deps

# Create custom dependencies
custom_deps = Deps(
    agents_output={"previous_results": []},
    user="Alice"
)

agent = TAgent(llm=llm, deps=custom_deps)
```

### Custom Tools

```python
from pydantic_ai.tools import Tool

def custom_weather_tool(location: str) -> str:
    """Get weather information for a location"""
    # Your weather API logic here
    return f"Weather in {location}: Sunny, 25ยฐC"

weather_tool = Tool(
    custom_weather_tool,
    name='get_weather',
    description='Get current weather for any location'
)

agent = TAgent(llm=llm, tools=[weather_tool])
```

## ๐Ÿ“ Complete Framework Example

```python
import asyncio
import os
from dotenv import load_dotenv

from t_ai.t_agent import TAgent, Deps
from t_ai.utils.helper_functions import MCP_server_helper
from t_ai.PrebuiltTools.google_tools import search_images_tool, code_execution_tool

from pydantic_ai.models.google import GoogleModel
from pydantic_ai.providers.google import GoogleProvider
from pydantic_ai.messages import BinaryContent

# Load environment variables
load_dotenv()

async def main():
    # Setup LLM
    llm = GoogleModel('gemini-2.5-flash', 
                     provider=GoogleProvider(api_key=os.getenv('GOOGLE_API_KEY')))
    
    # Setup MCP servers
    mcp_helper = MCP_server_helper()
    mcp_helper.add_mpc_server(type='stdio', command='npx', 
                             args=['-y', '@modelcontextprotocol/server-filesystem', '/tmp'])
    
    # Setup tools
    tools = [
        search_images_tool(
            api_key=os.getenv('GOOGLE_API_KEY'),
            search_engine_id=os.getenv('GOOGLE_SEARCH_ENGINE_ID')
        ),
        code_execution_tool(api_key=os.getenv('GOOGLE_API_KEY'))
    ]
    
    # Setup custom dependencies
    deps = Deps(agents_output={}, user="Alice")
    
    # Initialize T_AI agent
    agent = TAgent(
        llm=llm,
        deps=deps,
        tools=tools,
        mcp_servers=mcp_helper.get_mpc_servers(),
        summarizer=True,
        memory_length=20,
        instructions="You are a helpful AI assistant with access to various tools and services."
    )
    
    # Use context manager for automatic connection handling
    async with agent:
        # Text conversation
        response = await agent.chat(["Hello, what can you help me with?"])
        print("Agent:", response.voice_version)
        
        # Math problem with code execution
        response = await agent.chat(["Calculate the sum of squares from 1 to 100"])
        print("Math Result:", response.ui_version)
        
        # Image search
        response = await agent.chat(["Find me an image of a beautiful landscape"])
        print("Image Search:", response.ui_version)
        
        # Check conversation history
        print(f"Total messages in memory: {len(agent.memory.messages)}")

if __name__ == "__main__":
    asyncio.run(main())
```

## ๐Ÿงช Testing and Development

Run the included Jupyter notebooks to test different features:

- `notebooks/cortana_test.ipynb`: Basic functionality testing
- `notebooks/cort_mcp_test.ipynb`: MCP server integration testing  
- `notebooks/cortana_voice_test.ipynb`: Voice/audio capabilities testing
- `notebooks/memory_handling.ipynb`: Memory management testing

## ๐Ÿ”‘ Environment Variables

Create a `.env` file in your project root:

```env
GOOGLE_API_KEY=your_google_api_key
GOOGLE_SEARCH_ENGINE_ID=your_custom_search_engine_id
OPENAI_API_KEY=your_openai_api_key
TAVILY_API_KEY=your_tavily_api_key
```

## ๐Ÿ—๏ธ Architecture

T_AI is built with a modular architecture:

- **Core Agent (`TAgent`)**: Main framework class handling LLM interactions, memory, and coordination
- **MCP Integration**: Support for Model Context Protocol servers (HTTP, SSE, stdio)
- **Tool System**: Extensible tool framework with built-in Google tools
- **Memory Management**: Intelligent conversation summarization and state management
- **Dependencies**: Clean dependency injection for user context and shared state

## ๐Ÿค Contributing

1. Fork the repository
2. Create a feature branch (`git checkout -b feature/amazing-feature`)
3. Make your changes
4. Add tests if applicable
5. Commit your changes (`git commit -m 'Add amazing feature'`)
6. Push to the branch (`git push origin feature/amazing-feature`)
7. Open a Pull Request

## ๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

## ๐Ÿ†˜ Support

For issues and questions:
1. Check the notebooks in the `notebooks/` directory for examples
2. Review the docstrings in the source code  
3. Open an issue on GitHub

## ๐Ÿ™ Acknowledgments

- Built on top of [pydantic-ai](https://github.com/pydantic/pydantic-ai)
- MCP (Model Context Protocol) integration
- Google AI and OpenAI API support

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "T-AI-project",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "ai, assistant, google-ai, mcp, openai, pydantic-ai",
    "author": null,
    "author_email": "Tristan Padiou <padioutristan@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/1c/71/ef9f36ee7e26adb00abaa6d2f576f8e61b5e9863f60604ebfc41b996073f/t_ai_project-0.1.0.tar.gz",
    "platform": null,
    "description": "# T_AI - AI Agent Framework\n\nA powerful framework for building AI agents with **MCP (Model Context Protocol)** integration, **tools**, **memory management**, and **dependency handling**. T_AI simplifies the creation of sophisticated AI agents by providing a unified interface for multiple LLMs, external tools, and advanced conversation management.\n\n## \ud83d\ude80 Key Features\n\n- **\ud83d\udd17 MCP Integration**: Seamless connection to external tools and services via Model Context Protocol\n- **\ud83d\udee0\ufe0f Tool System**: Built-in Google tools (image search, code execution) and easy custom tool integration  \n- **\ud83e\udde0 Memory Management**: Intelligent conversation summarization for long-running sessions\n- **\ud83d\udce6 Dependency Management**: Clean state management and user context handling\n- **\ud83e\udd16 Multi-LLM Support**: Compatible with Google Gemini, OpenAI, and Anthropic models\n- **\ud83d\udcf1 Media Support**: Handle text, audio, images, and PDF files seamlessly\n- **\u26a1 Async/Await**: Full asynchronous support for optimal performance\n- **\ud83d\udd0c Extensible**: Easy to extend with custom tools and integrations\n\n## \ud83d\udce6 Installation\n\n### Using UV (Recommended)\n\n```bash\n# Clone the repository\ngit clone <repository-url>\ncd T_AI\n\n# Install using UV\nuv sync\n```\n\n### Using pip\n\n```bash\npip install -e .\n```\n\n### Using pip with requirements.txt\n\n```bash\npip install -r requirements.txt\n```\n\n## \ud83d\udd27 Core Dependencies\n\n- **pydantic-ai >= 0.4.0**: Core AI framework\n- **tavily-python >= 0.5.1**: Web search capabilities\n\n## \ud83d\ude80 Quick Start\n\n### Basic Agent Creation\n\n```python\nimport asyncio\nfrom t_ai.t_agent import TAgent, Deps\nfrom pydantic_ai.models.google import GoogleModel\nfrom pydantic_ai.providers.google import GoogleProvider\n\n# Initialize with Google Gemini\nllm = GoogleModel('gemini-2.5-flash', provider=GoogleProvider(api_key=\"your-api-key\"))\nagent = TAgent(llm=llm)\n\n# Simple conversation\nasync def main():\n    async with agent:\n        response = await agent.chat([\"Hello, what can you help me with?\"])\n        print(f\"UI Version: {response.ui_version}\")\n        print(f\"Voice Version: {response.voice_version}\")\n\nasyncio.run(main())\n```\n\n### With OpenAI\n\n```python\nfrom pydantic_ai.models.openai import OpenAIModel\nfrom pydantic_ai.providers.openai import OpenAIProvider\n\nllm = OpenAIModel('gpt-4-mini', provider=OpenAIProvider(api_key=\"your-openai-key\"))\nagent = TAgent(llm=llm)\n```\n\n## \ud83d\udee0\ufe0f Framework Configuration\n\n### TAgent Parameters\n\n```python\nagent = TAgent(\n    llm=your_llm,                              # Required: pydantic-ai compatible model\n    deps=custom_deps,                          # Optional: Custom dependencies object\n    instructions=\"Custom instructions\",        # Optional: Agent instructions\n    tools=[],                                  # Optional: List of custom tools\n    mcp_servers=[],                            # Optional: List of MCP servers\n    summarizer=False,                          # Optional: Enable conversation summarization\n    custom_summarizer_agent=None,              # Optional: Custom summarizer agent\n    memory_length=20,                          # Optional: Messages before summarization\n    memory_summarizer_length=15,               # Optional: Messages to summarize\n    use_memory=True                            # Optional: Enable/disable memory\n)\n```\n\n## \ud83d\udd17 MCP Server Integration\n\n### Using MCP Helper (Recommended)\n\n```python\nfrom t_ai.utils.helper_functions import MCP_server_helper\nfrom t_ai.t_agent import TAgent\n\n# Create MCP helper\nmcp_helper = MCP_server_helper()\n\n# Add different types of MCP servers\nmcp_helper.add_mpc_server(type='http', mpc_server_url='https://mcp.notion.com/mcp')\nmcp_helper.add_mpc_server(type='sse', mpc_server_url='https://mcp.notion.com/sse')\nmcp_helper.add_mpc_server(type='stdio', command='npx', args=['-y', 'mcp-remote', 'https://mcp.notion.com/mcp'])\n\n# Initialize agent with MCP servers\nagent = TAgent(llm=llm, mcp_servers=mcp_helper.get_mpc_servers())\n```\n\n### Direct MCP Server Setup\n\n```python\nfrom pydantic_ai.mcp import MCPServerStreamableHTTP, MCPServerSSE, MCPServerStdio\n\nmcp_servers = [\n    MCPServerStreamableHTTP(url='https://mcp.notion.com/mcp'),\n    MCPServerSSE(url='https://mcp.notion.com/sse'),\n    MCPServerStdio(command='npx', args=['-y', 'mcp-remote', 'https://mcp.notion.com/mcp'])\n]\n\nagent = TAgent(llm=llm, mcp_servers=mcp_servers)\n```\n\n## \ud83d\udee0\ufe0f Built-in Tools\n\n### Google Image Search Tool\n\n```python\nfrom t_ai.PrebuiltTools.google_tools import search_images_tool\n\n# Setup image search\nimage_tool = search_images_tool(\n    api_key=\"your-google-api-key\",\n    search_engine_id=\"your-custom-search-engine-id\"\n)\n\nagent = TAgent(llm=llm, tools=[image_tool])\n\n# Usage\nresponse = await agent.chat([\"Find me an image of a sunset\"])\n```\n\n### Google Code Execution Tool\n\n```python\nfrom t_ai.PrebuiltTools.google_tools import code_execution_tool\n\n# Setup code execution  \ncode_tool = code_execution_tool(api_key=\"your-gemini-api-key\")\n\nagent = TAgent(llm=llm, tools=[code_tool])\n\n# Usage\nresponse = await agent.chat([\"Calculate the factorial of 10 using Python\"])\n```\n\n### Combined Tools Example\n\n```python\nfrom t_ai.PrebuiltTools.google_tools import search_images_tool, code_execution_tool\n\ntools = [\n    search_images_tool(api_key=google_api_key, search_engine_id=search_engine_id),\n    code_execution_tool(api_key=google_api_key)\n]\n\nagent = TAgent(llm=llm, tools=tools)\n```\n\n## \ud83d\udcbe Memory Management\n\n### Enable Automatic Summarization\n\n```python\nagent = TAgent(\n    llm=llm,\n    summarizer=True,                    # Enable summarization\n    memory_length=20,                   # Summarize after 20 messages\n    memory_summarizer_length=15         # Summarize oldest 15 messages\n)\n```\n\n### Custom Summarizer Agent\n\n```python\nfrom pydantic_ai import Agent\n\ncustom_summarizer = Agent(\n    llm, \n    instructions='Create detailed technical summaries focusing on code and solutions.'\n)\n\nagent = TAgent(\n    llm=llm,\n    summarizer=True,\n    custom_summarizer_agent=custom_summarizer\n)\n```\n\n### Memory and State Management\n\n```python\n# Access conversation history\nmessages = agent.memory.messages\n\n# Access agent dependencies\ndeps = agent.deps\nuser_name = agent.deps.user\nagents_output = agent.deps.agents_output\n\n# Reset agent state\nagent.reset()\n```\n\n## \ud83d\udcf1 Media Support\n\n### Text Input\n\n```python\nresponse = await agent.chat([\"What's the weather like today?\"])\n```\n\n### Image Input\n\n```python\nfrom pydantic_ai.messages import BinaryContent\n\n# From file\nwith open(\"image.png\", \"rb\") as f:\n    image_data = f.read()\n\nresponse = await agent.chat([\n    \"What do you see in this image?\",\n    BinaryContent(data=image_data, media_type='image/png')\n])\n```\n\n### Audio Input\n\n```python\n# Audio file\nwith open(\"audio.wav\", \"rb\") as f:\n    audio_data = f.read()\n\nresponse = await agent.chat([\n    \"Transcribe this audio\",\n    BinaryContent(data=audio_data, media_type='audio/wav')\n])\n```\n\n### PDF Input\n\n```python\n# PDF file\nwith open(\"document.pdf\", \"rb\") as f:\n    pdf_data = f.read()\n\nresponse = await agent.chat([\n    \"Summarize this document\",\n    BinaryContent(data=pdf_data, media_type='application/pdf')\n])\n```\n\n## \ud83d\udd27 Advanced Usage\n\n### Context Manager (Recommended)\n\n```python\nasync def main():\n    async with TAgent(llm=llm, mcp_servers=mcp_servers) as agent:\n        # MCP servers are automatically connected\n        response = await agent.chat([\"Help me with my Notion workspace\"])\n        print(response.ui_version)\n        # MCP servers are automatically disconnected\n```\n\n### Manual Connection Management\n\n```python\nagent = TAgent(llm=llm, mcp_servers=mcp_servers)\n\n# Connect manually\nawait agent.connect()\n\ntry:\n    response = await agent.chat([\"Hello\"])\nfinally:\n    # Disconnect manually\n    await agent.disconnect()\n```\n\n### Custom Dependencies\n\n```python\nfrom t_ai.t_agent import Deps\n\n# Create custom dependencies\ncustom_deps = Deps(\n    agents_output={\"previous_results\": []},\n    user=\"Alice\"\n)\n\nagent = TAgent(llm=llm, deps=custom_deps)\n```\n\n### Custom Tools\n\n```python\nfrom pydantic_ai.tools import Tool\n\ndef custom_weather_tool(location: str) -> str:\n    \"\"\"Get weather information for a location\"\"\"\n    # Your weather API logic here\n    return f\"Weather in {location}: Sunny, 25\u00b0C\"\n\nweather_tool = Tool(\n    custom_weather_tool,\n    name='get_weather',\n    description='Get current weather for any location'\n)\n\nagent = TAgent(llm=llm, tools=[weather_tool])\n```\n\n## \ud83d\udcdd Complete Framework Example\n\n```python\nimport asyncio\nimport os\nfrom dotenv import load_dotenv\n\nfrom t_ai.t_agent import TAgent, Deps\nfrom t_ai.utils.helper_functions import MCP_server_helper\nfrom t_ai.PrebuiltTools.google_tools import search_images_tool, code_execution_tool\n\nfrom pydantic_ai.models.google import GoogleModel\nfrom pydantic_ai.providers.google import GoogleProvider\nfrom pydantic_ai.messages import BinaryContent\n\n# Load environment variables\nload_dotenv()\n\nasync def main():\n    # Setup LLM\n    llm = GoogleModel('gemini-2.5-flash', \n                     provider=GoogleProvider(api_key=os.getenv('GOOGLE_API_KEY')))\n    \n    # Setup MCP servers\n    mcp_helper = MCP_server_helper()\n    mcp_helper.add_mpc_server(type='stdio', command='npx', \n                             args=['-y', '@modelcontextprotocol/server-filesystem', '/tmp'])\n    \n    # Setup tools\n    tools = [\n        search_images_tool(\n            api_key=os.getenv('GOOGLE_API_KEY'),\n            search_engine_id=os.getenv('GOOGLE_SEARCH_ENGINE_ID')\n        ),\n        code_execution_tool(api_key=os.getenv('GOOGLE_API_KEY'))\n    ]\n    \n    # Setup custom dependencies\n    deps = Deps(agents_output={}, user=\"Alice\")\n    \n    # Initialize T_AI agent\n    agent = TAgent(\n        llm=llm,\n        deps=deps,\n        tools=tools,\n        mcp_servers=mcp_helper.get_mpc_servers(),\n        summarizer=True,\n        memory_length=20,\n        instructions=\"You are a helpful AI assistant with access to various tools and services.\"\n    )\n    \n    # Use context manager for automatic connection handling\n    async with agent:\n        # Text conversation\n        response = await agent.chat([\"Hello, what can you help me with?\"])\n        print(\"Agent:\", response.voice_version)\n        \n        # Math problem with code execution\n        response = await agent.chat([\"Calculate the sum of squares from 1 to 100\"])\n        print(\"Math Result:\", response.ui_version)\n        \n        # Image search\n        response = await agent.chat([\"Find me an image of a beautiful landscape\"])\n        print(\"Image Search:\", response.ui_version)\n        \n        # Check conversation history\n        print(f\"Total messages in memory: {len(agent.memory.messages)}\")\n\nif __name__ == \"__main__\":\n    asyncio.run(main())\n```\n\n## \ud83e\uddea Testing and Development\n\nRun the included Jupyter notebooks to test different features:\n\n- `notebooks/cortana_test.ipynb`: Basic functionality testing\n- `notebooks/cort_mcp_test.ipynb`: MCP server integration testing  \n- `notebooks/cortana_voice_test.ipynb`: Voice/audio capabilities testing\n- `notebooks/memory_handling.ipynb`: Memory management testing\n\n## \ud83d\udd11 Environment Variables\n\nCreate a `.env` file in your project root:\n\n```env\nGOOGLE_API_KEY=your_google_api_key\nGOOGLE_SEARCH_ENGINE_ID=your_custom_search_engine_id\nOPENAI_API_KEY=your_openai_api_key\nTAVILY_API_KEY=your_tavily_api_key\n```\n\n## \ud83c\udfd7\ufe0f Architecture\n\nT_AI is built with a modular architecture:\n\n- **Core Agent (`TAgent`)**: Main framework class handling LLM interactions, memory, and coordination\n- **MCP Integration**: Support for Model Context Protocol servers (HTTP, SSE, stdio)\n- **Tool System**: Extensible tool framework with built-in Google tools\n- **Memory Management**: Intelligent conversation summarization and state management\n- **Dependencies**: Clean dependency injection for user context and shared state\n\n## \ud83e\udd1d Contributing\n\n1. Fork the repository\n2. Create a feature branch (`git checkout -b feature/amazing-feature`)\n3. Make your changes\n4. Add tests if applicable\n5. Commit your changes (`git commit -m 'Add amazing feature'`)\n6. Push to the branch (`git push origin feature/amazing-feature`)\n7. Open a Pull Request\n\n## \ud83d\udcc4 License\n\nThis project is licensed under the MIT License - see the LICENSE file for details.\n\n## \ud83c\udd98 Support\n\nFor issues and questions:\n1. Check the notebooks in the `notebooks/` directory for examples\n2. Review the docstrings in the source code  \n3. Open an issue on GitHub\n\n## \ud83d\ude4f Acknowledgments\n\n- Built on top of [pydantic-ai](https://github.com/pydantic/pydantic-ai)\n- MCP (Model Context Protocol) integration\n- Google AI and OpenAI API support\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A Simplified Agent Framework to create ai agent with tools,mcps and memory/deps management",
    "version": "0.1.0",
    "project_urls": {
        "Bug Tracker": "https://github.com/yourusername/cortana-agent/issues",
        "Documentation": "https://github.com/yourusername/cortana-agent#readme",
        "Homepage": "https://github.com/yourusername/cortana-agent",
        "Repository": "https://github.com/yourusername/cortana-agent"
    },
    "split_keywords": [
        "ai",
        " assistant",
        " google-ai",
        " mcp",
        " openai",
        " pydantic-ai"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "4b669a215ce40ae7079c0b865a86c299f53cf41f750eb56d8f8282c2fb75208f",
                "md5": "b100429ab12c7911bacc11475c52d51f",
                "sha256": "6479df4e2b647c60995eb2f9ba68eacd66423db5045a6e23385764aba9e916b5"
            },
            "downloads": -1,
            "filename": "t_ai_project-0.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "b100429ab12c7911bacc11475c52d51f",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 11656,
            "upload_time": "2025-07-28T16:27:50",
            "upload_time_iso_8601": "2025-07-28T16:27:50.767482Z",
            "url": "https://files.pythonhosted.org/packages/4b/66/9a215ce40ae7079c0b865a86c299f53cf41f750eb56d8f8282c2fb75208f/t_ai_project-0.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "1c71ef9f36ee7e26adb00abaa6d2f576f8e61b5e9863f60604ebfc41b996073f",
                "md5": "bc20825502e8f1f2aa452f7d56f581a0",
                "sha256": "ddc6659a39a33b4446847d26656b61873d4f98edb4468a629469805b76fc8b00"
            },
            "downloads": -1,
            "filename": "t_ai_project-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "bc20825502e8f1f2aa452f7d56f581a0",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 405219,
            "upload_time": "2025-07-28T16:27:51",
            "upload_time_iso_8601": "2025-07-28T16:27:51.862008Z",
            "url": "https://files.pythonhosted.org/packages/1c/71/ef9f36ee7e26adb00abaa6d2f576f8e61b5e9863f60604ebfc41b996073f/t_ai_project-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-28 16:27:51",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "yourusername",
    "github_project": "cortana-agent",
    "github_not_found": true,
    "lcname": "t-ai-project"
}
        
Elapsed time: 1.57771s