Open source from NichevLabs
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.
The same 3-agent pipeline. One framework wraps it in a DSL. The other stays out of your way.
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"})
from selectools import AgentGraph
result = AgentGraph.chain(planner, writer, reviewer).run("prompt")
selectools serve agent.yaml
Three problems every team building AI agents hits — and how Selectools solves them out of the box.
Every run() returns result.trace + result.reasoning — a structured timeline of every LLM call, tool pick, and execution. No paid SaaS required.
Built-in PII redaction, topic blocking, toxicity detection, and prompt injection screening with 15 patterns. Plus LLM-based coherence checking.
result.usage.total_cost — automatic per-call token counts and dollar costs across all providers. 152 models with built-in pricing data.
Guardrails, audit logging, and injection defense — configured, not bolted on.
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
result.usage
847 tokens · $0.0012
Everything you need for production AI agents — in one package.
OpenAI, Anthropic, Gemini, Ollama + auto-failover with circuit breaker
Type-safe constants with built-in pricing data for all providers
BM25 + vector search with RRF fusion and cross-encoder reranking
PII redaction, toxicity, topic blocking, format and length validation
JSONL trail with 4 privacy levels and daily rotation
Auto-extract entities + knowledge graph with SQLite storage
Files, web, data, datetime, text — ready to use out of the box
Built-in agent testing: tool use, correctness, safety, LLM-as-judge, regression detection
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.
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.
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.
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")
Choose LangChain for ecosystem breadth. Choose Selectools when multi-agent orchestration, compliance, observability, and evaluation aren't optional.
| 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 |
| 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 |
You're building agents at work and need observability, cost control, and audit trails. Not another prototype framework.
Fintech, healthtech, edtech. Your compliance team will ask about guardrails and audit logs. Have the answer ready.
You've hit the ceiling on LangChain's observability and want traces, reasoning, and cost tracking without paying for LangSmith.
.env file (OpenAI, Anthropic, Gemini, or Ollama)