Skip to main content

A streamlined framework for building powerful LLM-powered agents that can solve complex tasks through tool execution, orchestration, and dynamic capability creation.

Project description

tinyAgent

tinyAgent Logo

Turn any Python function into an AI‑powered agent in just a few lines:

from tinyagent import tool, ReactAgent

@tool
def multiply(a: float, b: float) -> float:
    """Multiply two numbers together."""
    return a * b

@tool
def divide(a: float, b: float) -> float:
    """Divide the first number by the second number."""
    return a / b

agent = ReactAgent(tools=[multiply, divide])
result = agent.run("What is 12 times 5, then divided by 3?")
# → 20

That's it! The agent automatically:

  • Understands it needs to perform multiple steps
  • Calls multiply(12, 5) → gets 60
  • Takes that result and calls divide(60, 3) → gets 20
  • Returns the final answer

Why tinyAgent?

  • Zero boilerplate – Just decorate functions with @tool
  • Automatic reasoning – Agent figures out which tools to use and in what order
  • Built-in LLM – Works out of the box with OpenRouter
  • Type safe – Full type hints and validation
  • Production ready – Error handling, retries, and observability

Installation

pip install tiny_agent_os

# With observability (recommended)
pip install "tiny_agent_os[traceboard]"

# With all features
pip install "tiny_agent_os[rag,traceboard]"

Quick Setup

  1. Get configuration files:
# Download config.yml
wget https://raw.githubusercontent.com/alchemiststudiosDOTai/tinyAgent/0.72/config.yml

# Download .env template
wget https://raw.githubusercontent.com/alchemiststudiosDOTai/tinyAgent/0.72/.envexample -O .env
  1. Add your API key to .env:
OPENROUTER_API_KEY=your_key_here

Get your key at openrouter.ai

More Examples

Multi-step reasoning

from tinyagent import tool, ReactAgent

@tool
def calculate_percentage(value: float, percentage: float) -> float:
    """Calculate what percentage of a value is."""
    return value * (percentage / 100)

@tool
def subtract(a: float, b: float) -> float:
    """Subtract b from a."""
    return a - b

agent = ReactAgent(tools=[calculate_percentage, subtract])
result = agent.run("If I have 15 apples and give away 40%, how many are left?")
print(result)  # → "You have 9 apples left."

Behind the scenes:

  1. Agent calculates 40% of 15 → 6
  2. Subtracts 6 from 15 → 9
  3. Returns a natural language answer

Key Features

ReactAgent (Recommended)

  • Multi-step reasoning - Breaks down complex problems automatically
  • Clean API - Simple, ergonomic interface
  • Error handling - Built-in retry logic and graceful failures
  • Observability - Optional tracing to see what the agent is doing
  • Customizable prompts - Pass custom system prompts via system_prompt parameter

Tools Philosophy

Every function can be a tool. Keep them:

  • Atomic - Do one thing well
  • Typed - Use type hints for parameters
  • Documented - Docstrings help the LLM understand usage

Documentation

Status

BETA - Actively developed and used in production. Breaking changes possible until v1.0.

Found a bug? Have a feature request? Open an issue!

License

Business Source License 1.1

  • ✅ Free for individuals and small businesses (< $1M revenue)
  • 📧 Enterprise license required for larger companies

Contact: info@alchemiststudios.ai


Made by @tunahorse21 | alchemiststudios.ai

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

tiny_agent_os-0.72.16.tar.gz (2.5 MB view details)

Uploaded Source

Built Distribution

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

tiny_agent_os-0.72.16-py3-none-any.whl (166.9 kB view details)

Uploaded Python 3

File details

Details for the file tiny_agent_os-0.72.16.tar.gz.

File metadata

  • Download URL: tiny_agent_os-0.72.16.tar.gz
  • Upload date:
  • Size: 2.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for tiny_agent_os-0.72.16.tar.gz
Algorithm Hash digest
SHA256 e51f2a009c445aa9bc49ce996a174f6b18814136cf08c07e4359870d0eb3f6a0
MD5 320b099d181d094922342b2c1d3669a9
BLAKE2b-256 deeb8b0d6575d87575c92559c03a36a3387c64c3a4810e20d45fe2b504d8d4c9

See more details on using hashes here.

File details

Details for the file tiny_agent_os-0.72.16-py3-none-any.whl.

File metadata

File hashes

Hashes for tiny_agent_os-0.72.16-py3-none-any.whl
Algorithm Hash digest
SHA256 4a87885d03552f828d6c52d8d7cecb9164a0a6f64e7b2eb541e53b8fab364fda
MD5 83d085ac8ba87c1f9053204957d1576b
BLAKE2b-256 077100b14acd1a47bab95da03596c5ad7d93f76a4239e2e6128a4a810872b077

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