# Selectools

> Selectools is a production-ready Python library for building AI agents with tool calling, RAG, and multi-agent orchestration. One pip install. No DSL. Supports OpenAI, Azure OpenAI, Anthropic, Gemini, Ollama, and 100+ models via LiteLLM. v0.27.2, 7700+ tests at 95% coverage, Apache-2.0.

Selectools uses a single `Agent` class with native tool calling. No chains, no expression language, no complex abstractions. It includes built-in features that other frameworks charge for or split into separate packages: 50 evaluators, hybrid RAG search (BM25 + vector), guardrails, audit logging, multi-agent orchestration, and a visual drag-drop builder. Free, local, MIT-compatible.

Install: `pip install selectools`

```python
from selectools import Agent, tool
from selectools.providers import OpenAIProvider

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

agent = Agent(tools=[search], provider=OpenAIProvider())
result = agent.run("Find our refund policy")
# result.content -> the response text
# result.trace   -> structured execution timeline
# result.usage   -> token counts and dollar cost
```

## Getting Started

- [Quickstart](https://selectools.dev/QUICKSTART/): 5-minute setup guide with first agent
- [Migration Guide](https://selectools.dev/MIGRATION/): Coming from LangChain
- [Architecture](https://selectools.dev/ARCHITECTURE/): System design overview
- [Visual Builder](https://selectools.dev/builder/): Drag-drop graph editor in the browser (zero install)

## Core API

- [Agent](https://selectools.dev/modules/AGENT/): Agent class, AgentConfig, AgentResult — the central orchestrator
- [Tools](https://selectools.dev/modules/TOOLS/): @tool decorator, Tool class, ToolLoader, ToolRegistry
- [Toolbox](https://selectools.dev/modules/TOOLBOX/): 56 pre-built tools (file I/O, HTTP/web, data parsing, datetime, text, code execution, search, GitHub, database, calculator, email, PDF, Slack, Notion, Linear, Discord, S3, browser, image generation)
- [Memory](https://selectools.dev/modules/MEMORY/): ConversationMemory with sliding window and summarize-on-trim
- [Streaming](https://selectools.dev/modules/STREAMING/): Token-level astream() with tool call support

## RAG

- [RAG Pipeline](https://selectools.dev/modules/RAG/): Document loading, chunking, retrieval
- [Hybrid Search](https://selectools.dev/modules/HYBRID_SEARCH/): BM25 + vector fusion with RRF
- [Embeddings](https://selectools.dev/modules/EMBEDDINGS/): OpenAI, Anthropic, Gemini, Cohere embedding providers
- [Vector Stores](https://selectools.dev/modules/VECTOR_STORES/): Memory, SQLite, Chroma, Pinecone, FAISS, Qdrant, pgvector backends

## Providers

- [Providers](https://selectools.dev/modules/PROVIDERS/): OpenAI, Azure OpenAI, Anthropic, Gemini, Ollama, LiteLLM (100+ models) + FallbackProvider + RouterProvider (cost-optimized routing)
- [Models](https://selectools.dev/modules/MODELS/): 115 models with built-in pricing data

## Multi-Agent

- [Orchestration](https://selectools.dev/modules/ORCHESTRATION/): AgentGraph engine with routing, parallel, checkpoints
- [Supervisor](https://selectools.dev/modules/SUPERVISOR/): SupervisorAgent with 4 coordination strategies
- [Pipeline](https://selectools.dev/modules/PIPELINE/): Composable pipelines with @step + | + parallel() + branch()
- [Patterns](https://selectools.dev/modules/PATTERNS/): PlanAndExecute, Reflective, Debate, TeamLead agents

## Security

- [Guardrails](https://selectools.dev/modules/GUARDRAILS/): PII redaction, prompt-injection detection, toxicity, topic blocking, format validation
- [Audit](https://selectools.dev/modules/AUDIT/): JSONL audit logging with 4 privacy levels
- [Security](https://selectools.dev/modules/SECURITY/): Prompt injection screening (15 patterns)

## Evaluation

- [Evals](https://selectools.dev/modules/EVALS/): 50 evaluators, EvalSuite, A/B testing, regression detection, HTML reports

## Optional

- [Sessions](https://selectools.dev/modules/SESSIONS/): JSON, SQLite, Redis, Supabase, MongoDB, DynamoDB session backends
- [Scheduled Agents](https://selectools.dev/modules/SCHEDULER/): Run an agent on a cron or interval schedule (AgentScheduler, cron, every)
- [Reasoning Tools](https://selectools.dev/modules/REASONING_TOOLS/): think/analyze tools that make reasoning explicit and bounded
- [Benchmarks](https://selectools.dev/modules/BENCHMARKS/): Framework overhead measurements and methodology
- [Entity Memory](https://selectools.dev/modules/ENTITY_MEMORY/): LLM-based entity extraction
- [Knowledge Graph](https://selectools.dev/modules/KNOWLEDGE_GRAPH/): Triple extraction and storage
- [MCP](https://selectools.dev/modules/MCP/): Model Context Protocol client/server
- [Semantic Cache](https://selectools.dev/modules/SEMANTIC_CACHE/): Embedding-based response caching
- [Reasoning Strategies](https://selectools.dev/modules/REASONING_STRATEGIES/): ReAct, CoT, Plan-Then-Act
- [Builder Docs](https://selectools.dev/modules/builder/): Visual builder reference
- [Templates](https://selectools.dev/modules/TEMPLATES/): YAML agent configuration
- [FAISS](https://selectools.dev/modules/FAISS/): In-process FAISS vector index with disk persistence (v0.21.0)
- [Qdrant](https://selectools.dev/modules/QDRANT/): Qdrant vector database connector with REST + gRPC (v0.21.0)
- [pgvector](https://selectools.dev/modules/PGVECTOR/): PostgreSQL-backed vector store using the pgvector extension (v0.21.0)
- [Azure OpenAI](https://selectools.dev/modules/AZURE_OPENAI/): Azure OpenAI Service provider with AAD auth and deployment routing (v0.21.0)
- [OpenTelemetry](https://selectools.dev/modules/OTEL/): GenAI semantic-convention spans for agent runs, LLM calls, tool executions (v0.21.0)
- [Langfuse](https://selectools.dev/modules/LANGFUSE/): Send traces, generations, and spans to Langfuse Cloud or self-hosted (v0.21.0)
- [Multimodal Messages](https://selectools.dev/modules/MULTIMODAL/): ContentPart, image_message(), text_content() (v0.21.0)
- [Loop Detection](https://selectools.dev/modules/LOOP_DETECTION/): LoopDetector flags repeat, stall, and ping-pong tool-call patterns (v0.22.0)
- [Sessions](https://selectools.dev/modules/SESSIONS/): SessionStore protocol with 4 backends — JSON, SQLite, Redis, Supabase (v0.23.0)
- [Visual Builder](https://selectools.dev/modules/builder/): Drag-drop AgentGraph builder with first-class Retriever (RAG) + Session Store nodes (v0.23.0)
- [Agent-as-API](https://selectools.dev/modules/SERVE/): AgentAPI — production REST endpoints (chat, SSE streaming, session CRUD, bearer auth) from any agent (v0.24.0)
- [A2A Protocol](https://selectools.dev/modules/A2A/): Agent Card discovery + JSON-RPC 2.0 agent-to-agent messaging (v0.24.0)
- [Unified Memory](https://selectools.dev/modules/UNIFIED_MEMORY/): Tiered conversation/knowledge/entity/episodic memory with auto-promotion and compaction (v0.24.0)
- [Knowledge Memory](https://selectools.dev/modules/KNOWLEDGE/): Cross-session knowledge with Supabase/Redis blob backends (v0.24.0)
- [Sessions](https://selectools.dev/modules/SESSIONS/): Cross-session search() on all 4 backends (v0.24.0)
- [Stability Markers](https://selectools.dev/modules/STABILITY/): @stable, @beta, @deprecated
- [Changelog](https://selectools.dev/CHANGELOG/): Release history
- [Examples Gallery](https://selectools.dev/examples/): 111 runnable scripts with categories
