Skip to main content

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_schema pattern
  • 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_schema pattern
  • 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:

  1. Inherit from BaseAgent
  2. Implement ainfer() for async or infer() for sync
  3. Add tests in tests/

License

See main project LICENSE file.

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

rakam_systems_agent-0.1.2rc1.tar.gz (36.4 kB view details)

Uploaded Source

Built Distribution

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

rakam_systems_agent-0.1.2rc1-py3-none-any.whl (53.6 kB view details)

Uploaded Python 3

File details

Details for the file rakam_systems_agent-0.1.2rc1.tar.gz.

File metadata

File hashes

Hashes for rakam_systems_agent-0.1.2rc1.tar.gz
Algorithm Hash digest
SHA256 199e1a6d97a26f21f6a8f69cc54b7da68950eba9791adab38cc727f62ab92306
MD5 3cb8cf89134d3acde60c5227a259a4ea
BLAKE2b-256 1030cf39671da8fd345fc48224f4b9e873dd780f11dcff88196beab4e49ca8ea

See more details on using hashes here.

File details

Details for the file rakam_systems_agent-0.1.2rc1-py3-none-any.whl.

File metadata

File hashes

Hashes for rakam_systems_agent-0.1.2rc1-py3-none-any.whl
Algorithm Hash digest
SHA256 a14e82c4d78de4f4614d94f78ab25fb192e640133639552c68098b40faa00915
MD5 ef4975af7f6f42b4700cd286fccc645d
BLAKE2b-256 033b53a3d2378853049fa852dd7c946ef82f5d63b459b2275e6e4f2187d1226f

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