Skip to main content

TAgent: Build Powerful AI Agents, Not Boilerplate

Python 3.8+ License: MIT Version

A developer-first framework for crafting everything from simple AI assistants to complex, multi-agent workflows with elegance and ease.

┌─────────────────────────────────────────────────────────────────────────────────┐
│                           TAgent Architecture                                   │
├─────────────────────────────────────────────────────────────────────────────────┤
│                                                                                 │
│  Simple Agent (run_agent)           Multi-Step Pipeline System                  │
│  ┌─────────────────────┐            ┌─────────────────────────────────────────┐ │
│  │                     │            │                                         │ │
│  │   Goal → Agent      │            │    Step 1 → Step 2 → Step 3             │ │
│  │      ↓              │            │      ↓       ↓       ↓                  │ │
│  │   [Tools]           │     →      │   [Tools]  [Tools]  [Tools]             │ │
│  │      ↓              │            │      ↓       ↓       ↓                  │ │
│  │    Result           │            │   Conditional Execution & Dependencies  │ │
│  │                     │            │      ↓       ↓       ↓                  │ │
│  └─────────────────────┘            │   Structured Outputs & State Flow       │ │
│                                     │                                         │ │
│  Perfect for:                       │  Perfect for:                           │ │
│  • Quick tasks                      │  • Complex workflows                    │ │
│  • Single-step operations           │  • Multi-step processes                 │ │
│  • Simple automations               │  • Conditional logic                    │ │
│                                     │  • Parallel execution                   │ │
│                                     │                                         │ │
│                                     └─────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────────────────────────┘

Why TAgent?

  • Focus on Your Logic: Stop wrestling with complex frameworks. Write standard Python functions, and TAgent's ToolExecutor intelligently adapts to them.
  • Build, Don't Just Prompt: Move beyond simple prompting. Create robust, stateful agents that can plan, execute, and learn from their actions.
  • Scale with Confidence: Start with a single agent for a simple task. As your needs grow, scale up to a multi-step, parallelized workflow with the powerful Pipelines engine.
  • Universal Compatibility: TAgent is model-agnostic. By using structured JSON outputs instead of proprietary function-calling, it works with hundreds of LLMs out-of-the-box.

Features at a Glance

  • 🧠 Task-Based Agents: Predictable, state-driven agents that plan and execute to achieve goals.
  • 🛠️ Developer-First Tools: Your Python functions are first-class citizens. No boilerplate required.
  • 🚀 Powerful Pipeline Engine: Orchestrate complex, multi-step workflows with dependencies, parallelism, and advanced data flow control.
  • 🔗 Smart Data Injection: Use read_data to automatically inject outputs from previous steps as tool parameters, enabling sophisticated prompt enhancement.
  • 🌐 Model Agnostic: Compatible with any LLM provider, including OpenAI, Google, Anthropic, and more via LiteLLM.
  • 🔒 Structured & Reliable: Enforces structured outputs for predictable, type-safe results using Pydantic.
  • 🤖 Simple & Scalable: Start with a few lines of code and grow to production-grade automations.

Quick Look

Simple Agent Tasks

See how easy it is to create an agent with custom tools for simple tasks.

from tagent import run_agent

# 1. Give your agent a goal
goal = "What is the current stock price for NVDA and should I buy it?"

# 2. Give it a tool (a simple Python function)
def get_stock_price(symbol: str):
    """A tool to get the latest stock price for a stock symbol."""
    print(f"--- Getting price for {symbol} ---")
    # (Your logic to call a real stock API would go here)
    if symbol == "NVDA":
        return "stock_price", {"symbol": "NVDA", "price": 950.00}
    return "stock_price", {"symbol": symbol, "price": "unknown"}

# 3. Run the agent
result = run_agent(
    goal=goal,
    tools=[get_stock_price],
    model="gpt-4o-mini"
)

print(result.final_output)

Multi-Step Workflows with Pipelines

For more complex scenarios, use TAgent's Pipeline system to build sophisticated workflows:

from tagent.pipeline import PipelineBuilder
from tagent.pipeline.conditions import IsGreaterThan, IsLessThan

from tagent.pipeline.executor import PipelineExecutor, PipelineExecutorConfig
from tagent.config import TAgentConfig

from pydantic import BaseModel, Field


# Define structured outputs
class SentimentAnalysis(BaseModel):
    score: float = Field(description="Sentiment score from 0-10")
    category: str = Field(description="positive, negative, or neutral")

class EmailDraft(BaseModel):
    subject: str = Field(description="Email subject line")
    body: str = Field(description="Email body content")

# Build a customer feedback pipeline
pipeline = PipelineBuilder(
    name="customer_feedback_pipeline",
    description="Process customer feedback and respond appropriately"
).step(
    name="analyze_sentiment",
    goal="Analyze the sentiment of customer feedback",
    output_schema=SentimentAnalysis
).step(
    name="send_thank_you",
    goal="Draft a thank you email for positive feedback",
    depends_on=["analyze_sentiment"],
    condition=IsGreaterThan("analyze_sentiment.score", 7.0),
    output_schema=EmailDraft
).step(
    name="escalate_complaint",
    goal="Create escalation ticket for negative feedback",
    depends_on=["analyze_sentiment"],
    condition=IsLessThan("analyze_sentiment.score", 4.0)
).build()

executor_config = PipelineExecutorConfig(
    max_concurrent_steps=3,
    enable_persistence=False
)

config = TAgentConfig(model="gpt-4o-mini")

executor = PipelineExecutor(pipeline, config, executor_config)
result = await executor.execute()

Installation

Get started in seconds. Install the core agent, or include optional extras like the Pipeline engine.

# Install the core agent
pip install tagent

# Install with the Pipeline engine
pip install "tagent[pipeline]"

# Install everything
pip install "tagent[all]"

Dive Deeper

This README is just a glimpse of what TAgent can do. For detailed guides, tutorials, and API references, please visit our full documentation.

➡️ Read the Full TAgent Documentation

Our documentation covers:

  • Core Agent: Getting started, creating tools, and configuration.
  • Pipelines: Building complex, multi-step workflows with dependencies, parallel execution, and advanced data flow features like read_data.
  • API References and more.

Contributing

We welcome contributions! Please see our contributing guide for details on how to get started.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Metadata

Release files for tagent 0.7.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tagent 0.7.1
File Size Uploaded Provenance
tagent-0.7.1.tar.gz 1.0 MB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for tagent 0.7.1
File Interpreter ABI Platform
tagent-0.7.1-py3-none-any.whl Python 3 none any Details

Total release size: 1.1 MB

Release files / tagent-0.7.1.tar.gz

Download URL tagent-0.7.1.tar.gz
Size 1.0 MB
Tags Source
SHA-256 checksum
How to use checksums
85315d46c15f95cdf3d060ea0a7c097ae6cf33e9622b0345065674db0d52b8aa
BLAKE2b-256 checksum
How to use checksums
f8cbed21247afb1cb44cf760d19276b413cf0daf35a03411373596f060fb638c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.4

Release files / tagent-0.7.1-py3-none-any.whl

Download URL tagent-0.7.1-py3-none-any.whl
Size 123.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f4a6f043b57a1147b390882d412de7e34ad28e831aaec654e8c666fb61780242
BLAKE2b-256 checksum
How to use checksums
5f8aa96f2940fbf586a2ff34df0a11de0c73bcce5bb9fa63fbc3325cad41704f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.4

Security for tagent 0.7.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page