Open source from NichevLabs

Multi-Agent Orchestration in Plain Python

Build agent graphs. Compose pipelines with |. Deploy with one command. No DSL, no compile step, no paid debugger. Built-in guardrails, eval framework, and cost tracking. Works with OpenAI, Anthropic, Gemini, and Ollama.

Read the Docs GitHub
OpenAI Anthropic Gemini Ollama 152 Models 39 Evaluators 2529 Tests Multi-Agent Composable Pipelines

See the Difference

The same 3-agent pipeline. One framework wraps it in a DSL. The other stays out of your way.

LangGraph — 25 lines
from langgraph.graph import StateGraph, START, END
from typing_extensions import TypedDict

class State(TypedDict):
    text: str

def planner(state): return {"text": "planned"}
def writer(state): return {"text": "written"}
def reviewer(state): return {"text": "reviewed"}

g = StateGraph(State)
g.add_node("planner", planner)
g.add_node("writer", writer)
g.add_node("reviewer", reviewer)
g.add_edge(START, "planner")
g.add_edge("planner", "writer")
g.add_edge("writer", "reviewer")
g.add_edge("reviewer", END)
app = g.compile()
result = app.invoke({"text": "prompt"})
selectools — 1 line
from selectools import AgentGraph

result = AgentGraph.chain(planner, writer, reviewer).run("prompt")
Plain Python — no StateGraph, no TypedDict, no compile()
HITL resumes at yield point — doesn't restart your node
Zero extra deps — no langchain-core required
Deploy: selectools serve agent.yaml

Why Selectools?

Three problems every team building AI agents hits — and how Selectools solves them out of the box.

🔍

"I can't see what my agent is doing"

Every run() returns result.trace + result.reasoning — a structured timeline of every LLM call, tool pick, and execution. No paid SaaS required.

🛡

"No guardrails until something breaks in prod"

Built-in PII redaction, topic blocking, toxicity detection, and prompt injection screening with 15 patterns. Plus LLM-based coherence checking.

💰

"I don't know what my agents cost"

result.usage.total_cost — automatic per-call token counts and dollar costs across all providers. 152 models with built-in pricing data.

5 Lines to a Production Agent

Guardrails, audit logging, and injection defense — configured, not bolted on.

agent.py
from selectools import Agent, AgentConfig, tool
from selectools.providers import OpenAIProvider
from selectools.guardrails import GuardrailsPipeline, PIIGuardrail
from selectools.audit import AuditLogger, PrivacyLevel

@tool
def search_docs(query: str) -> str:
    """Search the knowledge base."""
    return db.search(query)

agent = Agent(
    provider=OpenAIProvider(),
    tools=[search_docs],
    config=AgentConfig(
        model="gpt-4.1-mini",
        guardrails=GuardrailsPipeline(
            input=[PIIGuardrail(action="redact")],
        ),
        screen_tool_output=True,
        coherence_check=True,
        audit=AuditLogger(
            path="./audit",
            privacy=PrivacyLevel.HASH,
        ),
    ),
)

result = agent.run("Find our refund policy")

result.content

"Our refund policy allows returns within 30 days..."

result.reasoning

"User asked about refund policy → search_docs is the right tool"

result.trace

llm_call tool_selection tool_execution llm_call

result.usage

847 tokens · $0.0012

What's Included

Everything you need for production AI agents — in one package.

5 Providers

OpenAI, Anthropic, Gemini, Ollama + auto-failover with circuit breaker

🎯

152 Models

Type-safe constants with built-in pricing data for all providers

🔎

Hybrid RAG

BM25 + vector search with RRF fusion and cross-encoder reranking

🛡

Guardrails

PII redaction, toxicity, topic blocking, format and length validation

📋

Audit Logging

JSONL trail with 4 privacy levels and daily rotation

🐘

Entity Memory

Auto-extract entities + knowledge graph with SQLite storage

🔧

24 Built-in Tools

Files, web, data, datetime, text — ready to use out of the box

📊

39 Evaluators

Built-in agent testing: tool use, correctness, safety, LLM-as-judge, regression detection

🤖

Multi-Agent Orchestration

AgentGraph for directed agent graphs with plain Python routing. 4 SupervisorAgent strategies. HITL resumes at yield point (not node restart). Parallel execution, checkpointing, subgraph composition.

🚀

Composable Pipelines

Pipeline + @step + | operator + parallel() + branch() — chain agents, tools, and transforms with plain Python. Also: AgentGraph.chain(a, b, c).run(prompt) for one-line multi-agent pipelines.

Built-in Agent Evaluation

The only agent framework with a built-in eval suite. No separate install, no SaaS account, no external dependencies. 39 evaluators out of the box.

test_agent.py
from selectools.evals import EvalSuite, TestCase

suite = EvalSuite(agent=agent, cases=[
    TestCase(
        input="Cancel my subscription",
        expect_tool="cancel_sub",
        expect_contains="cancelled",
        expect_no_pii=True,
    ),
    TestCase(
        input="What's my balance?",
        expect_tool="check_balance",
        expect_latency_ms_lte=500,
        expect_cost_usd_lte=0.01,
    ),
])

report = suite.run()
print(report.accuracy)     # 1.0
print(report.latency_p50)  # 142ms
print(report.total_cost)   # $0.002

report.to_html("report.html")

21 Deterministic Evaluators

ToolUse ToolOrder Contains Output Structured Performance JSON Python SQL URLs Markdown Length Words PII Injection Refusal Sentiment Custom

18 LLM-as-Judge Evaluators

Correctness Relevance Faithfulness Hallucination Toxicity Safety Coherence Completeness Conciseness Grammar Tone ContextRecall ContextPrecision Bias Summary Custom Rubric

Infrastructure

Interactive HTML report with charts and filtering
JUnit XML for CI (GitHub Actions, Jenkins)
Regression detection with baseline comparison
Dataset loading from JSON/YAML files
GitHub Action with automatic PR comments

How We Compare

Choose LangChain for ecosystem breadth. Choose Selectools when multi-agent orchestration, compliance, observability, and evaluation aren't optional.

Agent Framework Comparison

Capability Selectools LangChain CrewAI
Execution traces Built-in LangSmith (paid) Limited logging
Guardrails Built-in (5 types) NeMo (separate) Not built-in
Audit logging Built-in (4 privacy levels) DIY Not built-in
Agent evaluation Built-in (39 evaluators) LangSmith (paid) Not built-in
Cost tracking Automatic per-call Manual Not built-in
Injection defense 15 patterns + coherence Not included Not included
Setup 1 package 5+ packages 1 package
Multi-agent AgentGraph + Supervisor LangGraph Core feature
HITL resume Exact yield point Restarts entire node Not built-in
Composable pipelines @step + | + parallel + branch LCEL (complex) Not built-in
Checkpointing 3 backends (Memory, File, SQLite) SQLite, Postgres Limited
Parallel execution 3 merge policies + custom Fan-out + Send API Per-task async only
Zero extra dependencies Pure Python orchestration langchain-core required chromadb bundled
Deployment CLI selectools serve LangServe (separate) Enterprise only
Agent templates 5 built-in + YAML config Not built-in Not built-in
Trace persistence 3 backends (free) LangSmith (paid) Not built-in
Community Growing Massive Large
1 line
3-agent pipeline
vs 25 lines (LangGraph)
<0.5ms
framework overhead
per agent call (measured)
2566
tests passing
40 real API evals
$0.03
per eval run
40 tests, 3 providers

Eval Framework Comparison

Capability Selectools DeepEval Promptfoo LangSmith
Install Built-in Separate pip Node.js CLI pip + account
Evaluators 39 50+ ~20 ~8
A/B testing PairwiseEval No Side-by-side Experiments
Snapshot testing SnapshotStore No No No
Regression detection Local (JSON) Cloud only CLI + GitHub SaaS only
HTML report Interactive (charts) Cloud only Self-contained SaaS UI
Works offline Yes Partial Yes No
Price Free Free + SaaS Free $39/seat/mo

Who It's For

ML / AI Engineers

You're building agents at work and need observability, cost control, and audit trails. Not another prototype framework.

Regulated Industries

Fintech, healthtech, edtech. Your compliance team will ask about guardrails and audit logs. Have the answer ready.

Teams Outgrowing LangChain

You've hit the ceiling on LangChain's observability and want traces, reasoning, and cost tracking without paying for LangSmith.

Get Started in 60 Seconds

1. Install: pip install selectools
2. Add your provider API key to a .env file (OpenAI, Anthropic, Gemini, or Ollama)
3. Run the example above — or start with the Quickstart guide