Open Source from NichevLabs

# AI agents that are just Python.

Multi-agent graphs, tool calling, RAG, 50 evaluators, one-line REST serving, and a drag-drop visual builder. All in one `pip install`. No DSL to learn. No SaaS to pay for. No vendor to depend on.

~/your-project
$pip install selectools
Try the Builder → Read the Docs
Works with
OpenAI Azure OpenAI Anthropic Gemini Ollama 100+ models via LiteLLM
115 models
7268 tests
90%+ coverage
111 examples
50 evaluators
9 providers
v0.27.2
See it run

## Watch agents work. In real time.

Pre-recorded traces from real selectools agents. Routing, tool calls, failover, RAG. No API key needed.

Customer Support Router ready
What is selectools?

## A Python framework for production AI agents.

One `pip install`. The whole stack. No DSL, no separate packages, no paid SaaS. Your code stays plain Python.

agent.py ~/selectools $
from selectools import Agent, tool from selectools.rag import HybridRAG from selectools.guardrails import PIIGuardrail from selectools.audit import AuditLogger @tool()def search(q): return rag.query(q) agent = Agent( tools=[search], rag=HybridRAG("./docs"), guardrails=[PIIGuardrail()], audit=AuditLogger(),)result = agent.run("refund policy?")

what you get

Multi-agent graphs Agent()
Hybrid RAG HybridRAG
Guardrails PIIGuardrail
Audit logging AuditLogger
Tool calling @tool()
50 evaluators tested
Visual builder /builder/
Why selectools?

## Three problems every agent team hits.

No paid debugger. No SaaS account. No bolt-on libraries. Just open the file, see the fix.

01

Your agent did something. You have no idea what.

langchain · what you see

    $ python agent.py
    [ERROR] AgentExecutionError
      at langchain_core.runnables...
      at langgraph.pregel.invoke...
      ?? which tool ran
      ?? what model called
      ?? where it broke
    $ open $LANGSMITH_DASHBOARD

selectools · what you get

    result = agent.run("refund?")

    >>> result.trace
    [llm_call      142ms]
    [tool_select   tool=search]
    [tool_exec     ok 218ms]
    [llm_call      198ms]

    >>> result.reasoning
    "User asked refund → search_docs"

Every `run()` returns `result.trace` and `result.reasoning`. Structured timeline of every LLM call, tool pick, and execution. Free, local, always on. Agent docs →

02

A user typed their SSN. Now it’s in your logs forever.

crewai · what happens

    # your agent code
    agent = Agent(role="support")
    result = agent.execute(user_input)

    # your logs at 2am
    [INFO] "my ssn is 123-45-6789"
    [INFO] "my email is jane@..."
    [INFO] sent to OpenAI: ^^^
    [ALERT] compliance review needed

selectools · what ships

    agent = Agent(
      guardrails=GuardrailsPipeline(
        input=[PIIGuardrail("redact")],
        output=[InjectionScreen()],
      ),
    )

    # your logs
    [INFO] "my ssn is [REDACTED]"
    [INFO] screened: 15 patterns ✓

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

03

It’s the 28th. Your OpenAI bill is a surprise.

other tools · the bill

    $ stripe receipts list
    2026-04-28  OpenAI       $2,847.10
    2026-04-28  Anthropic    $1,203.55
    2026-04-28  LangSmith    $  468.00

    # breakdown by agent?
      -> you don't have one
    # cost per call?
      -> manual SQL on raw logs

selectools · the answer

    result = agent.run(prompt)

    >>> result.usage
    UsageStats(
      prompt_tokens=1247,
      completion_tokens=438,
      total_cost=$0.00184,
      model="gpt-5-mini",
      provider="openai",
    )

    # 115 models, all priced

`result.usage.total_cost` gives you automatic per-call token counts and dollar costs across all providers. `115 models` with built-in pricing data. Usage tracking docs →

See the difference

## The same pipeline. Less ceremony.

A 3-agent workflow: planner → writer → reviewer. Same outcome. 25 lines of ceremony, or one.

← LangGraph · 25 lines selectools · 1 line →
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") # That's it. No StateGraph. No TypedDict. # No add_node, no add_edge, no compile(). # Just three callables and a chain. # Need branching? AgentGraph.router(...) # Need parallel? AgentGraph.parallel(...) # Need HITL? yield and resume. No node restart. # Need to deploy? selectools serve agent.yaml
move your cursor across
01 Plain Python. No `StateGraph`, no `TypedDict`, no `compile()`.
02 HITL resumes at yield point, not by restarting the node.
03 Zero extra deps. No `langchain-core` required.
04 Deploy with `selectools serve agent.yaml`.
Production-ready

## Guardrails in the constructor, not an afterthought.

PII redaction, audit logging, and injection defense, configured in one `AgentConfig`. Click any step to inspect what the agent produced.

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( tools=[search_docs], provider=OpenAIProvider(), config=AgentConfig( model="gpt-5-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.trace

→
→
→
`result.reasoning`
“The user is asking about the refund policy. I should search the knowledge base for the current terms before answering.”
step 1 of 4 llm: gpt-5-mini tokens: 124
`result.tool_calls[0]`
search_docs(query="refund policy")
step 2 of 4 tool: search_docs guardrails: ✓
`result.tool_outputs[0]`
“Returns within 30 days of purchase. Original packaging required. Refund issued to original payment method within 5 business days...”
step 3 of 4 screen_tool_output: passed pii: none
`result.content`
“Our refund policy allows returns within 30 days of purchase, in original packaging. Refunds go back to your original payment method within 5 business days.”
step 4 of 4 tokens: 847 cost: $0.0012
What’s included

## One install. Everything built in.

No `langchain-core`. No separate eval SDK. No paid debugger. `pip install selectools` gives you all of this, tested across Python 3.9 to 3.13.

Eval framework
50 Evaluators

Tool-use checks, correctness scoring, safety screening, LLM-as-judge, regression detection, A/B with PairwiseEval. 29 deterministic + 21 LLM-judge. Free, local, no SaaS account.

Deterministic
29
LLM-as-judge
21
Coverage tests
90
Orchestration
Multi-agent graphs, plain Python.

`AgentGraph` for directed graphs with conditional routing. `SupervisorAgent` with 4 strategies. HITL resumes at the yield point, not by restarting the node. Deferred confirmation for chat channels via `selectools.pending`. Parallel execution + checkpointing + subgraph composition.

{ }
Pipelines
Composable with the `|` operator.

`Pipeline` + `@step` + `parallel()` + `branch()`. Plus 4 advanced agent patterns: `PlanAndExecute`, `Reflective`, `Debate`, `TeamLead`.

|
Guardrails
15 injection patterns

PII redaction, topic blocking, toxicity, prompt injection screening, plus LLM coherence check. Loop detection and knowledge sanitizers that defang injection markers before they hit memory.

Usage
Cost on every call

Automatic token + dollar tracking across 115 models. No manual SQL on raw logs.

Retrieval
Hybrid RAG

BM25 + vector + RRF fusion + cross-encoder reranking. 7 store backends (in-memory, SQLite, Chroma, Pinecone, FAISS, Qdrant, pgvector). CSV / JSON / HTML / URL loaders.

Compliance
Audit + observability

JSONL audit trail with 4 privacy levels and daily rotation. Plus `OTelObserver` (GenAI semantic conventions) and `LangfuseObserver` for shipping traces to Datadog, Jaeger, Langfuse Cloud, or your OTLP backend. Ready for the compliance review.

Memory
Memory + Knowledge

`UnifiedMemory`: tiered conversation + knowledge + entity + episodic memory with auto-promotion and token-aware compaction. 6 session backends with cross-session search.

Toolbox
56 built-in tools

File I/O, web, data, datetime, text, Python + shell execution, search, GitHub, SQLite + Postgres, plus v0.24.0 additions: safe calculator, email, PDF extraction, Slack, Notion, Linear. Ready to wire into any agent.

Providers
9 providers, auto-failover

OpenAI, Azure OpenAI, Anthropic, Gemini, Ollama, 100+ models via LiteLLM. Cost-optimized RouterProvider + FallbackProvider circuit breaker.

Streaming
Native astream()

Token-level async streaming with structured tool-call objects yielded inline.

MCP
Model Context Protocol

Both client and server. Connect to any MCP server, expose your tools as one.

Serving
Agent-as-API

`AgentAPI(agent)` is a production REST API: `/v1/chat`, SSE streaming, session CRUD, bearer auth, per-user isolation. Or `selectools serve agent.yaml --api`.

Interop
A2A protocol

Agent card at `/.well-known/agent.json` + JSON-RPC 2.0 server and client. Your agents talk to other frameworks' agents.

Cost control
Anthropic prompt caching

One flag (`cache_system=True`) for ~90% off cached input tokens. Hit rates surface in `result.usage`.

Enterprise-ready

## Five things your security team will ask for first.

Not a checkbox row. Real artifacts: a coverage gauge, a test count, a version matrix, an SBOM, stability markers. Audited and shipped.

test coverage
90%+

Statement coverage, CI-gated at 90% on every commit.

tests passing
0

Unit, integration, and e2e. Green on every commit.

python supported
✓ 3.13 ✓ 3.12 ✓ 3.11 ✓ 3.10 ✓ 3.9

Five major versions, one wheel.

supply chain

CycloneDX SBOM published with every release. Security audit on file.

api stability
@stable 205 @beta 228 @deprecated 2 minors

433-symbol public API, 100% stability-marked, CI-enforced. v1.0 on the horizon.

Built-in evaluation

## Test your agents. Not just your code.

LangSmith charges $39/seat/mo for agent evaluation. DeepEval requires a separate install. Selectools ships 50 evaluators. Free, local, built in.

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, ), ]) report = suite.run() report.to_html("report.html") # report.accuracy → 1.0 # report.latency_p50 → 142ms # report.total_cost → $0.002
pytest test_agent.py running
accuracy 1.000
latency p50 142 ms
total cost $0.0020
ToolUse ToolOrder ToolEfficiency AgentTrajectory UniqueTools Contains Output StructuredOutput JsonValidity JsonSchema Length StartsWith EndsWith WordCount PIILeak InjectionResistance Refusal Sentiment PythonValidity SQLValidity URLValidity MarkdownFormat Readability SemanticSimilarity MultiTurnCoherence KeywordDensity ForbiddenWords Performance Custom ToolUse ToolOrder ToolEfficiency AgentTrajectory UniqueTools Contains Output StructuredOutput JsonValidity JsonSchema Length StartsWith EndsWith WordCount PIILeak InjectionResistance Refusal Sentiment PythonValidity SQLValidity URLValidity MarkdownFormat Readability SemanticSimilarity MultiTurnCoherence KeywordDensity ForbiddenWords Performance Custom
LLMJudge Correctness Relevance Faithfulness Hallucination Toxicity Coherence Completeness Bias Summary Conciseness InstructionFollowing Tone ContextRecall ContextPrecision Grammar Safety FactConsistency CustomRubric AnswerAttribution StepReasoning LLMJudge Correctness Relevance Faithfulness Hallucination Toxicity Coherence Completeness Bias Summary Conciseness InstructionFollowing Tone ContextRecall ContextPrecision Grammar Safety FactConsistency CustomRubric AnswerAttribution StepReasoning

Eval report preview

`report.to_html("report.html")`

Execution trace preview

`trace_to_html(result.trace)`

Visual Agent Builder Live · no server required

## Design workflows in the browser.

The only open-source agent builder that runs in the browser with zero installation. Drag nodes, connect agents, test with real APIs, export runnable Python. 49KB gzipped. No signup. No CDN. No Electron.

Best on desktop

### The visual builder needs more room.

The drag-and-drop canvas is designed for screens 768px and wider. Open it in a new tab to try it on a desktop, or come back from a laptop.

Open builder →
bundle size
selectools
49KB
electron
67MB
49KB
gzipped over the wire
1400x lighter than electron
package.json
"name": "builder", "version": "1.0.0", "dependencies": {}
0 deps
no React, no build step
single HTML file
built-in nodes
8 nodes
agent, loop, HITL, subgraph…
7 built-in templates
seat licenses
$39 / seat / mo $0 forever
vs LangGraph Studio
Apache-2.0, no signup
Open Full Builder → Live Simulations 111 Examples

Feature | selectools | LangGraph Studio | n8n | Flowise | Dify | Rivet
--- | --- | --- | --- | --- | --- | ---
Price | Free, forever | Paid (LangSmith) | €20/mo cloud | Free self-host | Free self-host | Free
Install | `pip install` | macOS desktop app | Docker | Docker | Docker | Desktop app
Self-hosted | Yes | No (desktop only) | Yes | Yes | Yes | No
No CDN/build step | Yes | N/A | No (React) | No (React) | No (React) | No (Electron)
Code export (Python) | Yes | No | No | No | No | No
Code export (YAML) | Yes | No | JSON only | JSON only | YAML | No
AI generation | Yes (NL to graph) | No | No | No | No | No
Live test from browser | Yes | Yes | Yes | Yes | Yes | Yes
Runs on GitHub Pages | Yes | No | No | No | No | No
Per-node cost preview | Yes | No | No | No | No | No
Built-in evals | 50 evaluators | LangSmith (paid) | No | No | No | No

scroll → for full comparison

How we compare

## What you get vs. what you pay for elsewhere.

LangChain has the ecosystem. We have everything it charges extra for (traces, evals, guardrails, builder) included and free.

Capability | Selectools | LangChain | CrewAI
--- | --- | --- | ---
Execution traces | Built-in | LangSmith (paid) | Limited logging
Guardrails | Built-in (5 types) | NeMo (separate) | Not built-in
Agent evaluation | Built-in (50 evals) | LangSmith (paid) | Not built-in
Cost tracking | Automatic per-call | Manual | Not built-in
Injection defense | 15 patterns + coherence | Not included | Not included
Visual builder | Built-in + GitHub Pages | LangGraph Studio (paid) | Not built-in
Multi-agent | AgentGraph + Supervisor | LangGraph | Core feature
HITL resume | Exact yield point | Restarts node | Not built-in
Composable pipelines | @step + | + parallel | LCEL (complex) | Not built-in
Setup | 1 package | 5+ packages | 1 package
Deploy CLI | `selectools serve` | LangServe (separate) | Enterprise only
Enterprise signals | SBOM + audit + 90%+ coverage | Not built-in | Not built-in
Migration guides | 4 frameworks | Not available | Not available
AI-agent docs (llms.txt) | Full index + content | Not available | Not available
Community | Growing | Massive | Large

scroll → for full comparison

3-agent pipeline
from selectools import AgentGraph result = AgentGraph.chain(planner, writer, reviewer).run("prompt") # That's it. No StateGraph, no compile().
1 line
three callables, one chain
25 lines (LangGraph) · 1 line (selectools)
framework overhead
<0.5ms
per agent call
measured across 1000 runs
tests passing
0
90%+ coverage
unit, integration, e2e
40 real API evals included
eval suite cost
40 test cases$0.018
3 providers$0.009
20 judge calls$0.003
total$0.03
full eval suite, all providers
vs $39/seat/mo (LangSmith)
Who it’s for

## Built for teams shipping agents to production.

I just want to know what my agent did and how much it cost. On every call.

ML / AI Engineer in production · automatically
You'll appreciate `result.trace`, `result.usage.total_cost`, and structured reasoning on every call. Not just while you're debugging. Always on, written to your store, queryable.

Where are the audit logs? And how are you preventing PII leakage?

Compliance Lead SBOM · SOC 2 · HIPAA
You'll appreciate `AuditLogger` with 4 privacy levels, daily JSONL rotation, `PIIGuardrail` with redaction-on-input, and 15 injection patterns screened on output. Published security audit + CycloneDX SBOM.

We're paying $39/seat/mo just to see what our agents are doing.

Team migrating off LangChain $0 · self-hosted
You'll appreciate Built-in traces, 50 evaluators, visual builder, and audit logging. All free, all local. No LangSmith subscription, no langchain-core, no separate eval SDK. `pip install selectools`.
Get started

## Three paths. Pick yours.

No API key needed for the builder or examples. Add one when you’re ready to go live.

Visual builder

### Drag, drop, deploy.

Design multi-agent graphs in the browser. Click ports to connect. Export runnable Python or YAML. No install. No CDN. No signup.

Open the builder →
$pip install selectools Successfully installed >>>from selectools import Agent >>>Agent().run("hi") 'Hello! How can I help?'
Code first

### One install. Plain Python.

Two lines from zero to first agent. No DSL, no compile step, no scaffolding. Use whatever editor you already have.

Read the quickstart →
01hello_world.py 14rag_basic.py 23multi_agent.py 31guardrails.py 42streaming.py 56plan_execute.py 01hello_world.py 14rag_basic.py 23multi_agent.py 31guardrails.py 42streaming.py 56plan_execute.py
19hybrid_search.py 27tool_caching.py 38session_redis.py 49eval_suite.py 63knowledge_graph.py 71budget_limit.py 19hybrid_search.py 27tool_caching.py 38session_redis.py 49eval_suite.py 63knowledge_graph.py 71budget_limit.py
07provider_failover.py 15vector_chroma.py 22supervisor.py 35audit_log.py 52reflective.py 68debate.py 07provider_failover.py 15vector_chroma.py 22supervisor.py 35audit_log.py 52reflective.py 68debate.py
Learn by example

### 111 examples, all runnable.

From hello-world to multi-agent debate. Browse, copy, run. Each one is self-contained with realistic mock data.

Browse the gallery →
Open in Colab Star on GitHub
FAQ

## Type a question. Or browse the docs.

docs >
? What is Selectools? getting-started
Selectools is an open-source Python library for building production-ready AI agents with tool calling, RAG (retrieval-augmented generation), and multi-agent orchestration. It supports 9 providers (OpenAI, Azure OpenAI, Anthropic, Gemini, Ollama, and 100+ models via LiteLLM, plus router, fallback, and local providers) with a single unified API. Install with: `pip install selectools`.
? How is Selectools different from LangChain? concepts
Selectools uses a single `Agent` class with native tool calling. No chains, no expression language, no complex abstractions. It includes built-in features that require separate paid services in LangChain: 50 evaluators (vs LangSmith at $39/seat/mo), hybrid RAG search, guardrails, audit logging, multi-agent orchestration, and a visual builder. One `pip install`, everything included, free.
? What LLM providers does Selectools support? providers
Nine providers: OpenAI (GPT-4, GPT-5, o-series), Azure OpenAI Service, Anthropic (Claude), Google Gemini, Ollama (local models), and LiteLLM (100+ models), plus a FallbackProvider for automatic failover with circuit breaker, a RouterProvider for cost-optimized routing, and a built-in `LocalProvider` for testing without any API key. Includes pricing data for 115 models.
? Does Selectools have a visual builder? concepts
Yes. Selectools ships a drag-and-drop visual agent builder that runs in the browser with zero installation. Design multi-agent workflows, test with mock or real APIs, and export runnable Python or YAML. Try it now →
? How do I install Selectools? getting-started
`pip install selectools`. For the visual builder with Starlette server: `pip install selectools[serve]`. For Chroma/Pinecone/FAISS/Qdrant vector stores (plus beautifulsoup4 for HTML loading): `pip install selectools[rag]`. For OpenTelemetry + Langfuse observers: `pip install selectools[observe]`. For pgvector: `pip install selectools[postgres]`. Requires Python 3.9+.
? Does Selectools support streaming? advanced
Yes. `astream()` provides token-level async streaming with native tool call support. Tool calls are yielded as structured `ToolCall` objects alongside text chunks, not mixed into the text stream.
? Does Selectools support RAG? advanced
Yes. The built-in RAG pipeline includes BM25 keyword search + vector semantic search, reciprocal rank fusion (RRF), cross-encoder reranking, semantic and contextual chunking, and 7 vector store backends (memory, SQLite, Chroma, Pinecone, FAISS, Qdrant, pgvector). Documents can be loaded from files, directories, PDFs, CSVs, JSON, HTML, or URLs.
? Can I use Selectools with local models? providers
Yes. Use the `OllamaProvider` to run agents with any Ollama-compatible local model (Llama, Mistral, Gemma, etc.). For testing without any API or model, use the built-in `LocalProvider` stub.
? Does Selectools support multi-agent orchestration? advanced
Yes. `AgentGraph` supports directed graph orchestration with conditional routing, parallel fan-out (3 merge policies), and checkpoint-backed state. `SupervisorAgent` provides 4 coordination strategies: plan-and-execute, round-robin, dynamic routing, and magentic-one. Higher-level patterns include PlanAndExecute, Reflective, Debate, and TeamLead agents.
? Is Selectools production-ready? concepts
Yes. 7,268 tests at 90%+ coverage (including 40 real API evaluations), published security audit, SBOM (CycloneDX 1.6), formal deprecation policy, `@stable`/`@beta` markers on all 433 public symbols (100% stability-marked, CI-enforced), and a compatibility matrix covering Python 3.9 to 3.13. Migration guides for LangChain, CrewAI, AutoGen, and LlamaIndex. Apache-2.0 licensed.
no questions match. try a broader search.