AI工作流框架 是 AI Skill Hub 本期精选Agent工作流之一。综合评分 8.0 分,整体质量较高。我们强烈推荐将其纳入你的 AI 工具库,帮助提升工作效率。
AI工作流框架 是一套完整的 AI Agent 自动化工作流方案。通过可视化的节点编排,将复杂的多步骤任务拆解为清晰的自动化流程,实现全程无人值守的智能处理。支持与数百种外部服务和 API 无缝集成,适合构建数据处理管线、业务自动化和 AI 辅助决策系统。
AI工作流框架 是一套完整的 AI Agent 自动化工作流方案。通过可视化的节点编排,将复杂的多步骤任务拆解为清晰的自动化流程,实现全程无人值守的智能处理。支持与数百种外部服务和 API 无缝集成,适合构建数据处理管线、业务自动化和 AI 辅助决策系统。
# 方式一:pip 安装(推荐)
pip install selectools
# 方式二:虚拟环境安装(推荐生产环境)
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install selectools
# 方式三:从源码安装(获取最新功能)
git clone https://github.com/johnnichev/selectools
cd selectools
pip install -e .
# 验证安装
python -c "import selectools; print('安装成功')"
# 命令行使用
selectools --help
# 基本用法
selectools input_file -o output_file
# Python 代码中调用
import selectools
# 示例
result = selectools.process("input")
print(result)
# selectools 配置文件示例(config.yml) app: name: "selectools" debug: false log_level: "INFO" # 运行时指定配置文件 selectools --config config.yml # 或通过环境变量配置 export SELECTOOLS_API_KEY="your-key" export SELECTOOLS_OUTPUT_DIR="./output"
┌─┐┌─┐┬ ┌─┐┌─┐┌┬┐┌─┐┌─┐┬ ┌─┐
└─┐├┤ │ ├┤ │ │ │ ││ ││ └─┐
└─┘└─┘┴─┘└─┘└─┘ ┴ └─┘└─┘┴─┘└─┘
An open-source project 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. Works with OpenAI, Anthropic, Gemini, and Ollama.
🎉 selectools is 1.0 — stable. The public API is frozen; @stable symbols carry a 2-minor compatibility promise. Python 3.10+. Latest: v1.3 — tested public streaming contracts for structured-output chat agents.
AgentAPI — production REST endpoints (chat, SSE streaming, sessions) from any agentresponse_format — native json_schema on supporting providers, auto-retry, explicit structured_statusresult.trace with typed timeline of every agent stepresult.reasoning explains why the agent chose a toolagent.batch() / agent.abatch() for concurrent classificationAgentScheduler runs an agent on a cron or interval schedule with per-job max-runs, failure isolation, and an async loopthink/analyze tools make reasoning explicit, inspectable, and bounded by min/max stepsPromptInjectionGuardrail — heuristic jailbreak/injection detection with high-precision patternsToolResult base class + Artifact side-channel via emit_artifact()selectools.pending for chat-channel destructive-tool confirmationcache_system/cache_tools with hit-rate visibility on UsageStatsremember + recall tools, pluggable stores (File, SQLite), importance scoring, TTLmax_total_tokens, max_cost_usd hard limits; CancellationToken for cooperative stoppingestimate_run_tokens() for pre-execution budget checksmodel_selector callback for per-iteration model selectionSemanticCache — embedding-based cache hits for paraphrased queries (cosine similarity, LRU + TTL)compress_context, compress_threshold, compress_keep_recentConversationMemory.branch() and SessionStore.branch() for A/B exploration and checkpointingAgentGraph with routing, parallel execution, HITL, checkpointing; SupervisorAgent with 4 strategies (plan_and_execute, round_robin, dynamic, magentic)Pipeline + @step + | operator + parallel() + branch() — chain agents, tools, and transformsrun_id correlation, LoggingObserver, SimpleStepObserver, OTel export```python
Two user-facing features plus a post-ship bug-hunt sweep that pinned 8 code-generator fixes in the visual builder.
SupabaseSessionStore — 4th SessionStore backend alongside JSON, SQLite, and Redis. Postgres-backed via Supabase PostgREST, with idempotent upserts, namespace isolation, and the same validation guards as RedisSessionStore. Optional dep: pip install selectools[supabase]. Demo: examples/96_supabase_session_store.py.Retriever (RAG) onto the canvas and pick any of 7 vector stores (memory, SQLite, Chroma, Pinecone, FAISS, Qdrant, pgvector), toggle Hybrid (BM25 + vector + RRF) and cross-encoder Rerank. Drag Session Store as a resource node and wire it into an agent via the new Session Store dropdown. Two new presets: Hybrid RAG and Multi-Tenant RAG. Python + YAML code generators emit real, runnable code.from supabase import create_client
from selectools import SupabaseSessionStore, Agent, AgentConfig
store = SupabaseSessionStore(client=create_client(URL, KEY))
agent = Agent(
tools=[...],
config=AgentConfig(session_store=store, session_id="u-1", max_iterations=5),
)
See CHANGELOG.md for the full entry including the 8 builder code-gen fixes.
The first AI agent framework to ship a visual graph builder in a single pip install. No React. No build step. No CDN.
Try the builder in your browser → — no install required.
```bash pip install selectools selectools serve --builder
```
"approved") for conditional routing```python
graph = AgentGraph() graph.add_node("planner", planner_agent) graph.add_node("writer", writer_agent) graph.add_node("reviewer", reviewer_agent) graph.add_edge("planner", "writer") graph.add_edge("writer", "reviewer") graph.add_edge("reviewer", AgentGraph.END) graph.set_entry("planner") result = graph.run("Write a blog post about AI safety")
pip install selectools # Core + basic RAG
pip install selectools[rag] # + Chroma, Pinecone, FAISS, Qdrant, Voyage, Cohere, PyPDF, BeautifulSoup
pip install selectools[observe] # + OpenTelemetry, Langfuse observers
pip install selectools[postgres] # + psycopg2 (enables pgvector)
pip install selectools[cache] # + Redis cache
pip install selectools[mcp] # + MCP client/server
pip install "selectools[rag,observe,cache,mcp]" # Everything
Add your provider's API key to a .env file in your project root:
``` OPENAI_API_KEY=sk-...
config = AgentConfig(reasoning_strategy="react") # Thought → Action → Observation config = AgentConfig(reasoning_strategy="cot") # Chain-of-Thought step-by-step config = AgentConfig(reasoning_strategy="plan_then_act") # Plan first, then execute
New to Selectools? Follow the 5-minute Quickstart tutorial — no API key needed.
A full audit-driven tech-debt sweep — mostly additive and bugfix, with one called-out behavior change.
execute_shell is now a real boundary, not a best-effort filter — it parses with shlex and runs with shell=False, so pipes, chaining (;, &&), redirection, subshells, globbing, and backgrounding can never be interpreted (closes the previously-bypassable \n and bare-& holes). Behavior change: commands relying on shell features now fail fast instead of running through /bin/sh.browser_scrape_page/browser_screenshot and the eval-alert webhook now reject loopback/private/link-local targets; SSRF logic is consolidated into one shared validator.SessionStore.branch() gained an optional namespace parameter, and list() now returns a round-trippable storage key consistently (JSON/Redis/Mongo/DynamoDB previously returned a bare id that couldn't be reloaded for namespaced sessions).timeout + max_retries (OpenAI/Voyage/Cohere, default 60s/2) so a hung or rate-limited call can't block ingestion.AgentResult.trace/.usage and the ten AgentConfig nested-group fields are now their concrete types instead of Any (full autocomplete + type-checking); tightening surfaced and fixed two real bugs the Any had masked.[cache] extra (redis), pytz to [toolbox], and jsonschema to [evals].See CHANGELOG.md for the full entry (7,796 tests, 115 examples, 115 models).
agent.run("hello") # Just works inside async contexts ```
typing.Literal crashed @tool(), asyncio.run() re-entry in 8 sync wrappers, HITL silently lost in parallel groups + subgraphs, ConversationMemory had no thread lock<think> tag stripping, RAG batch limits, MCP concurrent race, str→int/float/bool argument coercion, Union[str, int] support, multi-interrupt generators, GraphState fail-fast validation, session namespace isolation, summary growth capAgentTrace lock, async observer exception logging, batch clone isolation, OTel/Langfuse observer locks, vector store search dedup, Optional[T] without default handlingtests/agent/test_regression.py, each with empirical fault-injection verification (test fails without fix, passes after)ConversationMemory, AgentTrace, OTelObserver, LangfuseObserver, MCPClient, FallbackProvider, batch clone isolationSee CHANGELOG.md for the full per-bug breakdown with cross-references to every original Agno/PraisonAI issue.
Every public class and function exported from selectools carries a stability marker. As of 1.0, @stable symbols carry a compatibility promise — no removal or breaking signature change without a deprecation cycle of at least two minors:
from selectools import Agent, AgentGraph, AgentScheduler
print(Agent.__stability__) # "stable"
print(AgentGraph.__stability__) # "stable" (promoted for 1.0)
print(AgentScheduler.__stability__) # "beta" (still iterating)
@stable — the frozen core: Agent, AgentConfig, providers, memory, tools and the mature toolbox, sessions, guardrails, orchestration graphs, the pattern agents, the policy layer, and the core types.
@beta — subsystems still evolving in 1.x: RAG/embeddings, MCP, A2A, the evaluator catalog, unified memory, the scheduler, and the newest backends. Run python scripts/stability_audit.py for the live marker map.
```
from selectools import Agent, AgentConfig, tool
from selectools.providers.stubs import LocalProvider
@tool(description="Look up the price of a product")
def get_price(product: str) -> str:
prices = {"laptop": "$999", "phone": "$699", "headphones": "$149"}
return prices.get(product.lower(), f"No price found for {product}")
agent = Agent(
tools=[get_price],
provider=LocalProvider(),
config=AgentConfig(max_iterations=3),
)
result = agent.ask("How much is a laptop?")
print(result.content)
@stable class MyProductionAgent: ...
@beta class MyExperimentalFeature: ...
@deprecated(since="0.19", replacement="MyProductionAgent") class MyOldAgent: ...
```python from selectools import Pipeline, step, parallel, branch
@step def summarize(text: str) -> str: return agent.run(f"Summarize: {text}").content
@step def translate(text: str, lang: str = "es") -> str: return agent.run(f"Translate to {lang}: {text}").content
tools = ToolLoader.from_directory("./plugins", recursive=True) agent.add_tools(tools)
updated = ToolLoader.reload_file("./plugins/search.py") agent.replace_tool(updated[0])
agent.ask("What is Python?") agent.reset() agent.ask("What is Python?")
print(cache.stats) # CacheStats(hits=1, misses=1, hit_rate=50.00%) ```
For distributed setups: from selectools.cache_redis import RedisCache
本项目是 Selectools 的 README 文档,简介包括项目概述、版本信息和下载链接。
本节介绍 Selectools 的新功能,包括 v0.27、v0.26 和 v0.25 版本的更新内容。
本节介绍如何安装 Selectools,包括 3 种部署方式:Deploy、Docker 和 pip。
本节提供 Selectools 的使用教程,包括快速入门、示例代码和 API 文档。
本节介绍 Selectools 的配置选项,包括 AgentConfig、model、temperature 和 max_tokens 等参数。
本节介绍 Selectools 的 API 文档,包括 BUG-03、sync APIs 和 stability markers 等内容。
本节介绍 Selectools 的工作流和模块,包括 pipeline、step 和 parallel 等概念。
本节回答 Selectools 的常见问题,包括缓存、API 错误和工作流等问题。
高质量的AI工作流框架,内置安全防护和审计功能
AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。
建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。
✅ Apache 2.0 — 宽松开源协议,可商用,需保留版权声明和 NOTICE 文件,含专利授权条款。
经综合评估,AI工作流框架 在Agent工作流赛道中表现稳健,质量优秀。如果你已有明确的使用需求,可以直接上手体验;如果还在评估阶段,建议对比同类工具后再做决策。
| 原始名称 | selectools |
| 原始描述 | 开源AI工作流:Production-ready Python framework for AI agents with built-in guardrails, audit 。⭐10 · Python |
| Topics | ai-agentsai-safetyenterprise-ai |
| GitHub | https://github.com/johnnichev/selectools |
| License | Apache-2.0 |
| 语言 | Python |
收录时间:2026-06-15 · 更新时间:2026-06-16 · License:Apache-2.0 · AI Skill Hub 不对第三方内容的准确性作法律背书。
选择 Agent 类型,复制安装指令后粘贴到对应客户端