AI Agents framework with Pydantic AI support and LLM Gateway integration
Project description
Rakam Systems Agent
The agent package of Rakam Systems providing AI agent implementations powered by Pydantic AI.
Overview
rakam-systems-agent provides flexible AI agents with tool integration, chat history, and LLM gateway abstractions. This package depends on rakam-systems-core.
Features
- Configuration-First Design: Change agents without code changes — just update YAML files
- Async/Sync Support: Full support for both synchronous and asynchronous agent operations
- Tool Integration: Easy tool definition and integration using the
Tool.from_schemapattern - Model Settings: Control model behavior including parallel tool calls, temperature, and max tokens
- Pydantic AI Powered: Built on top of Pydantic AI library
- Streaming Support: Both sync and async streaming interfaces
- Chat History: Multiple backends (JSON, SQLite, PostgreSQL)
- LLM Gateway: Unified interface for OpenAI and Mistral AI
Installation
pip install rakam-systems-agent
Available extras:
| Extra | What it adds |
|---|---|
llm-providers |
openai, mistralai, tiktoken |
all |
Everything above |
pip install rakam-systems-agent[all]
Quick Start
import asyncio
from rakam_systems_agent import BaseAgent
from rakam_systems_core.ai_core.interfaces import ModelSettings
from rakam_systems_core.ai_core.interfaces.tool import ToolComponent as Tool
async def get_weather(city: str) -> dict:
"""Get weather information for a city"""
return {"city": city, "temperature": 72, "condition": "sunny"}
agent = BaseAgent(
name="weather_agent",
model="openai:gpt-4o",
system_prompt="You are a helpful weather assistant.",
tools=[
Tool.from_schema(
function=get_weather,
name='get_weather',
description='Get weather information for a city',
json_schema={
'type': 'object',
'properties': {
'city': {'type': 'string', 'description': 'The city name'},
},
'required': ['city'],
'additionalProperties': False,
},
takes_ctx=False,
),
],
)
async def main():
result = await agent.arun(
"What's the weather in San Francisco?",
model_settings=ModelSettings(parallel_tool_calls=True),
)
print(result.output_text)
asyncio.run(main())
Core Components
- BaseAgent — Primary agent implementation powered by Pydantic AI, with tool support and streaming
- Tool — Wrapper for tool functions using
Tool.from_schemapattern - ModelSettings — Configure parallel tool calls, temperature, max tokens
- LLM Gateway — Provider-agnostic interface for OpenAI and Mistral (details)
- Chat History — JSON, SQLite, and PostgreSQL backends
- MCP Server — Message-based component registry for agent tools (details)
Package Structure
rakam-systems-agent/
├── src/rakam_systems_agent/
│ ├── components/
│ │ ├── base_agent.py # BaseAgent (Pydantic AI-powered)
│ │ ├── llm_gateway/ # LLM provider gateways
│ │ ├── chat_history/ # Chat history backends
│ │ ├── tools/ # Built-in tools
│ │ └── __init__.py # Exports
│ └── server/ # MCP server
└── pyproject.toml
Documentation
For API reference, advanced usage (dependencies, streaming, YAML config), and troubleshooting, see the official documentation.
Contributing
When adding new agent types:
- Inherit from
BaseAgent - Implement
ainfer()for async orinfer()for sync - Add tests in
tests/
License
See main project LICENSE file.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file rakam_systems_agent-0.1.2rc4.tar.gz.
File metadata
- Download URL: rakam_systems_agent-0.1.2rc4.tar.gz
- Upload date:
- Size: 36.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
20eccafc55f83b5c3598e66c3e8e851099f2eac3295085096bb30876c9ad968f
|
|
| MD5 |
abecb77414963900558b54e5f2a0686c
|
|
| BLAKE2b-256 |
a9b96d648f1bee96f0318e9d5dac87e6a7f44bcf0f38c0c1521d93e0e1983215
|
File details
Details for the file rakam_systems_agent-0.1.2rc4-py3-none-any.whl.
File metadata
- Download URL: rakam_systems_agent-0.1.2rc4-py3-none-any.whl
- Upload date:
- Size: 53.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6b0eea0b46987950305bfb244de6671954f8dc23ee80498250259693fd07dda0
|
|
| MD5 |
c8335c88052f3b9e6700375d3b579a3e
|
|
| BLAKE2b-256 |
e0cc75373f068bdb90f56d3590abfe29db1ab9d9bca80144e001401ed33b40f7
|