Skip to main content

Ergonomic LLM Agents

Project description

Agentia: Ergonomic LLM Agents

Ergonomic LLM Agents, with chat messages fully compatible with Vercel AI SDK.

Getting Started

Run agents with tools and MCP.

from agentia import Agent, MCPServer, MCPContext
from typing import Annotated

# Define a tool as a python function
def get_weather(location: Annotated[str, "The city name"]):
    """Get the current weather in a given location"""
    return { "temperature": 72 }

# Declare a MCP server:
calc = MCPServer(name="calculator", command="uvx", args=["mcp-server-calculator"])

# Create an agent
agent = Agent(model="openai/gpt-5-mini", tools=[get_weather, calc])

# Run the agent with the tool
async with MCPContext(): # This line can be omitted if not using MCP
    response = await agent.run("What is the weather like in boston?")

print(response.text)

# Output: The current temperature in Boston is 72°F.

The Magic Decorator

Create agent-powered magic functions.

Support both plain types and pydantic models as input and output.

from agentia import magic
from pydantic import BaseModel

class Forcast(BaseModel):
    location: str
    temperature_celsius: int

@magic
async def get_weather(weather_forcast: str) -> Forcast:
    """Create weather forcase object based on the input string"""
    ...

forcast = await get_weather("The current temperature in Boston is 72°F")

print(forcast.location) # Output: Boston
print(forcast.temperature_celsius) # Output: 22

Supported Parameter and Result Types

  • Any types that can be passed to pydantic.TypeAdaptor:
    • Builtin types: int, float, str, bool, tuple[_], list[_], dict[_, _]
    • Enums: Literal['A', 'B', ...], StrEnum, IntEnum, and Enum
    • dataclasses
  • pydantic.BaseModel subclasses

Run agent as a REPL app

  1. Create a config file at ./robo.toml
[agent]
name = "Robo" # This is the only required field
icon = "🤖"
instructions = "You are a helpful assistant"
model = "openai/o3-mini"
plugins = ["clock"]

[mcp]
calc={ command = "uvx", args = ["mcp-server-calculator"] }
  1. Load the agent
agent = Agent.from_config("./robo.toml")

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

agentia-0.1.11.tar.gz (32.3 kB view details)

Uploaded Source

Built Distribution

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

agentia-0.1.11-py3-none-any.whl (43.4 kB view details)

Uploaded Python 3

File details

Details for the file agentia-0.1.11.tar.gz.

File metadata

  • Download URL: agentia-0.1.11.tar.gz
  • Upload date:
  • Size: 32.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.14

File hashes

Hashes for agentia-0.1.11.tar.gz
Algorithm Hash digest
SHA256 8e73386a4d92cbc5e391c10abf27a0a73b0a245b69d3a543628a0b291d5e56e8
MD5 2e022315ee0f7182c2d52eafaf22c5e8
BLAKE2b-256 984aa5cfe4a85e5fba7110976b54cf8d2421e4a7027b41734ed063bea8542e26

See more details on using hashes here.

File details

Details for the file agentia-0.1.11-py3-none-any.whl.

File metadata

  • Download URL: agentia-0.1.11-py3-none-any.whl
  • Upload date:
  • Size: 43.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.14

File hashes

Hashes for agentia-0.1.11-py3-none-any.whl
Algorithm Hash digest
SHA256 4e2e3eb1fd335c9763b65abf98116d1cef2a4904c1bf03e6850243f82ebf365a
MD5 a2f9e2bbe43c3e8fa9ad73643d05039f
BLAKE2b-256 74fbfa9b4084b703d403414feb1ea3619e57708370d36df53cbd152cc831c4c3

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