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

Why tinyAgent?

Turn any Python function into an AI‑powered agent in three lines:

from tinyagent.decorators import tool
from tinyagent.agent import tiny_agent

@tool                  # 1️⃣  function → tool
def add(a: int, b: int) -> int:
    return a + b

agent = tiny_agent(tools=[add])             # 2️⃣  tool → agent
print(agent.run("add 40 and 2"))           # 3️⃣  natural‑language call
# → 42
  • Zero boilerplate – just a decorator.
  • Built‑in LLM orchestration – validation, JSON I/O, retry, fallback.
  • ReAct Pattern Support – Advanced reasoning + acting pattern for complex multi-step tasks.
  • Scales as you grow – add more tools or plug into tiny_chain without rewrites.

Made by (x) @tunahorse21 | A product of alchemiststudios.ai


Heads Up

tinyAgent is in BETA until V1. It's working but still evolving! I can't guarantee it's 100% bug-free, but I'm actively improving it whenever I can between my day job and business.
Found something that could be better? Show off your skills and open an issue with a fix: I'd genuinely appreciate it!


Overview

tinyAgent is a streamlined framework for building powerful, LLM-powered agents that solve complex tasks through tool execution, orchestration, and dynamic capability creation. Convert any Python function into a useful tool and then into an agent with minimal configuration, unlocking a world of scalable, modular possibilities.


Installation & Setup

1. Install the Package

# Basic installation
pip install tiny_agent_os

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

# With all features (RAG + observability)
pip install "tiny_agent_os[rag,traceboard]"

2. Get the Configuration Files

After installation, you'll need two configuration files:

# Create a basic config.yml
python -m tinyagent.config init

# Or download the example config directly
wget https://raw.githubusercontent.com/alchemiststudiosDOTai/tinyAgent/v0.65/config.yml

Create a .env file with your API keys:

# Download the example .env file
wget https://raw.githubusercontent.com/alchemiststudiosDOTai/tinyAgent/v0.65/.envexample -O .env

# Edit with your API keys
nano .env  # or use any text editor

3. Quick Start Example

from tinyagent.decorators import tool
from tinyagent.agent import tiny_agent
from tinyagent.observability.tracer import configure_tracing  # For tracing support

# Define a tool
@tool
def add(a: int, b: int) -> int:
    return a + b

# Enable tracing (optional)
configure_tracing()  # This reads your config.yml

# Create an agent (with tracing enabled)
agent = tiny_agent(tools=[add], trace_this_agent=True)

# Run it!
result = agent.run("add 40 and 2")
print(result)  # → 42

4. ReAct Pattern Example (NEW!)

For complex multi-step reasoning tasks, use the ReAct agent:

from tinyagent.react.react_agent import ReActAgent
from tinyagent.decorators import tool
from tinyagent.agent import get_llm

# Define tools
@tool
def calculate(expression: str) -> float:
    """Evaluate a mathematical expression."""
    return eval(expression)

# Create ReAct agent
agent = ReActAgent()
agent.register_tool(calculate._tool)

# Run with reasoning steps
result = agent.run_react(
    query="If I have 15 apples and give away 40%, how many do I have left?",
    llm_callable=get_llm(),
    max_steps=3
)
print(result)  # → "You have 9 apples left"

Post-Installation Configuration

After installing (either via pip or from source), remember to configure your environment and .env files with relevant API keys from https://openrouter.ai

Both the config.yml and env work out of the box with a openrouter API, you can use any openai API, and the config has an example of a local LLM. The /documentation folder has more details and is being updated.

Features

  • Modular Design: Easily convert any function into a tool.
  • Flexible Agent Options: Use the simple orchestrator or advanced AgentFactory.
  • ReAct Pattern: Built-in support for Reasoning + Acting pattern for complex multi-step reasoning tasks.
  • Robust Error Handling: Improved debugging with custom exceptions and JSON parsing.
  • Structured Output: Enforce JSON formats for consistent outputs.
  • Comprehensive Observability: Built-in OpenTelemetry tracing with multiple exporters (console, OTLP, SQLite) and a web-based trace viewer.

Acknowledgments & Inspirations


Learn More



Contact

For questions, suggestions, or business inquiries:


License

Business Source License 1.1 (BSL) This project is licensed under the Business Source License 1.1. It is free for individuals and small businesses (with annual revenues under $1M). For commercial use by larger businesses, an enterprise license is required. For licensing or usage inquiries, please contact: info@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.11.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.11-py3-none-any.whl (165.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for tiny_agent_os-0.72.11.tar.gz
Algorithm Hash digest
SHA256 0ecd036eb8f43f1783bc65bf1ad9a178ca53981c4c30ea0c1f26ff9bfaa24e63
MD5 3b69f8af3be02daa2116996b4d74d8f4
BLAKE2b-256 c7f3087623d061c6f4ea705b293a0082218ed906b004750f79d743ff4495c881

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tiny_agent_os-0.72.11-py3-none-any.whl
  • Upload date:
  • Size: 165.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for tiny_agent_os-0.72.11-py3-none-any.whl
Algorithm Hash digest
SHA256 7fc6f026cfd64a9ea922140fed06baeea79b6e61b10e6d5994e20d4e805e8ac8
MD5 1ed70c50ce68123c0af65fd9a0c37978
BLAKE2b-256 e2f29b0b825ca8d4a34744676d7759d533822ab7c21acb3060ed008b8fc97ab6

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