Skip to main content

Ergonomic LLM Agents

Project description

Agentia: Ergonomic LLM Agents

Ergonomic LLM Agents with MCP and Skills support.

Getting Started

Run agents with tools, MCP, and Skills

from agentia import Agent, MCP
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 = MCP(name="calculator", command="uvx", args=["mcp-server-calculator"])

# Create an agent
# This will load the function tool, the calculator MCP, and all skills under $CWD/.skills
agent = Agent(model="openai/gpt-5-nano", tools=[get_weather, calc], skills=True)

# Run the agent with the mcp
response = await agent.run("Calculate 234 ** 3")

print(response.text)

# Output: The result of 234 raised to the power of 3 is 12,812,904.

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

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.16.tar.gz (33.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.16-py3-none-any.whl (44.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for agentia-0.1.16.tar.gz
Algorithm Hash digest
SHA256 558c068c9d97bb4c4cc2bcb2d91bc52519144d797991ea0f8e728c1a33681564
MD5 135028475820f15f2f710ce6ab01b80e
BLAKE2b-256 a2a0d8a01e3ebe121c8f8ee0fd1081e59b50355f984b673ea0544f9e8831d947

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for agentia-0.1.16-py3-none-any.whl
Algorithm Hash digest
SHA256 71f247942a7e61b9e767e8ef0b51851e77fdcca15b2f71e400c8ebd07caad792
MD5 f584810d067c51ce95fe2f5fc6542f37
BLAKE2b-256 c2e95d7163547703987868b7699ae84fa5b25cd146003375bb2a459582ecd8c3

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