Skip to main content

Build, debug, evaluate, and operate AI agents. The only SDK with fork-and-rerun Agent Replay.

Project description

FastAIAgent SDK

Build, debug, evaluate, and operate AI agents. The only SDK with Agent Replay — fork-and-rerun debugging for AI agents.

Works standalone or connected to the FastAIAgent Platform for visual editing, production monitoring, and team collaboration.

PyPI License Tests Python


Debug a failing agent in 30 seconds

from fastaiagent.trace import Replay

# Load a trace from a production failure
replay = Replay.load("trace_abc123")

# Step through to find the problem
replay.step_through()
# Step 3: LLM hallucinated the refund policy ← found it

# Fork at the failing step, fix, rerun
forked = replay.fork_at(step=3)
forked.modify_prompt("Always cite the exact policy section...")
result = forked.rerun()

No other SDK can do this.

Evaluate agents systematically

from fastaiagent.eval import evaluate

results = evaluate(
    agent_fn=my_agent.run,
    dataset="test_cases.jsonl",
    scorers=["correctness", "relevance"]
)
print(results.summary())
# correctness: 92% | relevance: 88%

Trace any agent — yours or LangChain/CrewAI

import fastaiagent
fastaiagent.integrations.langchain.enable()

# Your existing LangChain agent, now with full tracing
result = langchain_agent.invoke({"input": "..."})
# → Traces stored locally or pushed to FastAIAgent Platform

Build agents with guardrails and cyclic workflows

from fastaiagent import Agent, Chain, LLMClient, Guardrail
from fastaiagent.guardrail import no_pii, json_valid

agent = Agent(
    name="support-bot",
    system_prompt="You are a helpful support agent...",
    llm=LLMClient(provider="openai", model="gpt-4o"),
    tools=[search_tool, refund_tool],
    guardrails=[no_pii(), json_valid()]
)

# Chains with loops (retry until quality is good enough)
chain = Chain("support-pipeline", state_schema=SupportState)
chain.add_node("research", agent=researcher)
chain.add_node("evaluate", agent=evaluator)
chain.add_node("respond", agent=responder)
chain.connect("research", "evaluate")
chain.connect("evaluate", "research", max_iterations=3, exit_condition="quality >= 0.8")
chain.connect("evaluate", "respond", condition="quality >= 0.8")

result = chain.execute({"message": "My order is late"}, trace=True)

Connect to FastAIAgent Platform (optional)

from fastaiagent import FastAI

fa = FastAI(api_key="sk-...", project="customer-support")

# Push your agent to the platform — see it in the visual editor
fa.push(chain)

# Traces appear in the platform dashboard
# Prompts sync between code and platform
# Eval results visible in the platform

SDK works standalone. Platform adds: visual chain editor, production monitoring, advanced KB intelligence, prompt optimization, team collaboration, HITL approval workflows.

Free tier available →


Install

pip install fastaiagent

With optional integrations:

pip install "fastaiagent[openai]"       # OpenAI auto-tracing
pip install "fastaiagent[langchain]"    # LangChain auto-tracing
pip install "fastaiagent[kb]"           # Local knowledge base
pip install "fastaiagent[all]"          # Everything

Documentation

Contributing

We welcome contributions! See CONTRIBUTING.md for guidelines.

License

Apache 2.0 — see LICENSE.

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

fastaiagent-0.1.0a6.tar.gz (177.4 kB view details)

Uploaded Source

Built Distribution

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

fastaiagent-0.1.0a6-py3-none-any.whl (93.0 kB view details)

Uploaded Python 3

File details

Details for the file fastaiagent-0.1.0a6.tar.gz.

File metadata

  • Download URL: fastaiagent-0.1.0a6.tar.gz
  • Upload date:
  • Size: 177.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for fastaiagent-0.1.0a6.tar.gz
Algorithm Hash digest
SHA256 fd956013600419a5a4b5722e86a30845f508960d0cf4372f174dd7a69004008d
MD5 8758ad1a7cc617df1d22330c415a583a
BLAKE2b-256 24154a9b42cee723a7cb020e14d3d08872e87c1497420d26bd2576a42b5c28de

See more details on using hashes here.

File details

Details for the file fastaiagent-0.1.0a6-py3-none-any.whl.

File metadata

  • Download URL: fastaiagent-0.1.0a6-py3-none-any.whl
  • Upload date:
  • Size: 93.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for fastaiagent-0.1.0a6-py3-none-any.whl
Algorithm Hash digest
SHA256 e667bf63c2c69ffffc418615f43a68db4655d53bc149d28b57bad501ce5d61b0
MD5 143367007600266c713b37dc83c5dacd
BLAKE2b-256 8c5b7ea63e37284951a10f6dd32f3623f79d61fe66e39e92f11d68fdba5d0ced

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