⌕ `/`
# 111 files match
01-rw-r--r--46L no-key hello_world.py No API key needed. Runs entirely offline with the built-in LocalProvider.▾
$cat examples/01_hello_world.py
Tools
GitHub Docs

02-rw-r--r--69L no-key search_weather.py No API key needed — runs with the built-in LocalProvider.▾
$cat examples/02_search_weather.py
Tools
GitHub Docs

03-rw-r--r--205L no-key toolbox.py No API key needed for exploring tool schemas.▾
$cat examples/03_toolbox.py
Agent
GitHub Docs

04-rw-r--r--89L api-key conversation_memory.py Multi-turn Conversation Memory with automatic context preservation▾
$cat examples/04_conversation_memory.py
Memory Tools
GitHub Docs

05-rw-r--r--133L api-key cost_tracking.py Cost Tracking — token counting, cost estimation, and usage summaries▾
$cat examples/05_cost_tracking.py
Tools
GitHub Docs

06-rw-r--r--194L api-key async_agent.py Async Agent — arun(), concurrent agents, and FastAPI integration patterns▾
$cat examples/06_async_agent.py
Memory Tools
GitHub Docs

07-rw-r--r--350L no-key streaming_tools.py Streaming Tools — Generator-based progressive output for long-running operations▾
$cat examples/07_streaming_tools.py
Streaming Tools
GitHub Docs

08-rw-r--r--315L api-key streaming_parallel.py Streaming and Parallel Tool Execution — astream(), asyncio.gather, StreamChunk▾
$cat examples/08_streaming_parallel.py
Streaming Tools
GitHub Docs

09-rw-r--r--219L api-key caching.py Response Caching — InMemoryCache (LRU+TTL) and RedisCache for avoiding redundant LLM calls▾
$cat examples/09_caching.py
Caching Tools
GitHub Docs

100-rw-r--r--179L api-key deferred_confirmation.py The built-in approval gate blocks the agent loop waiting for a "yes" — wrong for WhatsApp/Telegram/Slack agents, where the user's confirmation arrives as▾
$cat examples/100_deferred_confirmation.py
Agent
GitHub Docs

101-rw-r--r--108L api-key litellm_provider.py Offline-safe: the demo below injects a fake `litellm` module so it runs without litellm installed or any API key. A real call is shown at the end,▾
$cat examples/101_litellm_provider.py
Agent
GitHub Docs

102-rw-r--r--102L no-key router_provider.py A RouterProvider wraps multiple providers organized cheapest -> priciest and routes each request to a tier based on a deterministic, rule-based▾
$cat examples/102_router_provider.py
Agent
GitHub Docs

103-rw-r--r--98L no-key a2a_protocol.py Demonstrates A2AServer + A2AClient: one selectools agent exposes itself over A2A (Agent Card discovery + JSON-RPC tasks) and another process▾
$cat examples/103_a2a_protocol.py
Agent
GitHub Docs

104-rw-r--r--78L api-key toolbox_expansion.py Fully offline: the calculator runs locally and the Slack call is mocked. The API-backed tools (email, PDF, Slack, Notion, Linear) need their optional▾
$cat examples/104_toolbox_expansion.py
Agent
GitHub Docs

105-rw-r--r--107L api-key session_search.py Demonstrates the @beta `SessionStore.search()` method: an agent can "remember what we discussed last Tuesday" by querying message content▾
$cat examples/105_session_search.py
Memory Sessions
GitHub Docs

106-rw-r--r--91L api-key unified_memory.py UnifiedMemory orchestrates the four existing memory systems into one lifecycle: short-term (ConversationMemory rolling window), long-term▾
$cat examples/106_unified_memory.py
Memory
GitHub Docs

107-rw-r--r--129L api-key tool_result_compression.py Verbose tool outputs (a web scrape returning 10KB of HTML, a SQL query dumping 500 rows) waste context window on every subsequent iteration. With▾
$cat examples/107_tool_result_compression.py
Agent
GitHub Docs

108-rw-r--r--147L api-key agent_hitl.py Standalone agents (no AgentGraph needed) can gate specific tools behind an approval handler:▾
$cat examples/108_agent_hitl.py
Multi Agent
GitHub Docs Open in Builder

109-rw-r--r--119L no-key planning_as_config.py Add planning to ANY Agent with a config flag — no PlanAndExecuteAgent wiring required. When `PlanningConfig.enabled=True` and the input looks▾
$cat examples/109_planning_as_config.py
Patterns Rag
GitHub Docs

10-rw-r--r--312L api-key routing_mode.py Routing Mode — Agent selects a tool without executing it. Intent classification▾
$cat examples/10_routing_mode.py
Tools
GitHub Docs

110-rw-r--r--137L api-key quick_reply_buttons.py Example 100 covers FREE-TEXT confirmation ("sim", "yes") through the RegexConfirmParser. But chat channels with quick-reply buttons (Twilio▾
$cat examples/110_quick_reply_buttons.py
Agent
GitHub Docs

111-rw-r--r--84L api-key knowledge_sanitizers.py Remembered content flows back into the system prompt via build_context(), so the knowledge store is a prompt-injection vector: anything a user (or a▾
$cat examples/111_knowledge_sanitizers.py
Agent
GitHub Docs

11-rw-r--r--341L api-key tool_analytics.py Tool Usage Analytics — call counts, success rates, timing, cost attribution▾
$cat examples/11_tool_analytics.py
Agent
GitHub Docs

12-rw-r--r--300L no-key observability_hooks.py NOTE: For production observability (Langfuse, Datadog, OpenTelemetry), prefer the class-based AgentObserver protocol introduced in v0.14.0. It provides▾
$cat examples/12_observability_hooks.py
Observability Tools
GitHub Docs

13-rw-r--r--220L no-key dynamic_tools.py Dynamic Tools — ToolLoader, plugin directories, hot-reload, runtime tool management▾
$cat examples/13_dynamic_tools.py
Tools
GitHub Docs

14-rw-r--r--157L api-key rag_basic.py Basic RAG — document loading, chunking, embedding, vector search, and question answering▾
$cat examples/14_rag_basic.py
Rag
GitHub Docs

15-rw-r--r--339L api-key semantic_search.py Semantic Search — pure embedding-based search with metadata filtering▾
$cat examples/15_semantic_search.py
Rag
GitHub Docs

16-rw-r--r--328L api-key rag_advanced.py Advanced RAG — PDFs, SQLite persistent storage, custom chunking, metadata filtering▾
$cat examples/16_rag_advanced.py
Rag
GitHub Docs

17-rw-r--r--536L api-key rag_multi_provider.py Optional: ANTHROPIC_API_KEY, GOOGLE_API_KEY for cross-provider comparisons▾
$cat examples/17_rag_multi_provider.py
Rag
GitHub Docs

18-rw-r--r--270L api-key hybrid_search.py Hybrid Search — BM25 keyword + vector semantic search with RRF/weighted fusion and reranking▾
$cat examples/18_hybrid_search.py
Rag
GitHub Docs

19-rw-r--r--224L api-key advanced_chunking.py Advanced Chunking — SemanticChunker (embedding-based) and ContextualChunker (LLM-enriched)▾
$cat examples/19_advanced_chunking.py
Rag
GitHub Docs

20-rw-r--r--547L api-key customer_support_bot.py Customer Support Bot — multi-tool workflow combining search, ticketing, and escalation▾
$cat examples/20_customer_support_bot.py
Memory
GitHub Docs

21-rw-r--r--820L api-key data_analysis_agent.py Data Analysis Agent — data exploration, filtering, aggregation, and visualization tools▾
$cat examples/21_data_analysis_agent.py
Memory
GitHub Docs

22-rw-r--r--253L api-key ollama_local.py Ollama Local Model — run agents with fully local LLMs via Ollama. No cloud API needed▾
$cat examples/22_ollama_local.py
Agent
GitHub Docs

23-rw-r--r--243L api-key structured_output.py Demonstrates: 1. Pydantic BaseModel as response_format▾
$cat examples/23_structured_output.py
Structured
GitHub Docs

24-rw-r--r--246L api-key traces_and_reasoning.py Demonstrates: 1. result.trace with TraceStep timeline▾
$cat examples/24_traces_and_reasoning.py
Agent
GitHub Docs

25-rw-r--r--250L api-key provider_fallback.py Demonstrates: 1. FallbackProvider with priority ordering▾
$cat examples/25_provider_fallback.py
Agent
GitHub Docs

26-rw-r--r--263L api-key batch_processing.py Demonstrates: 1. agent.batch() for sync concurrent processing▾
$cat examples/26_batch_processing.py
Structured
GitHub Docs

27-rw-r--r--308L api-key tool_policy.py Demonstrates: 1. ToolPolicy with allow/review/deny rules▾
$cat examples/27_tool_policy.py
Memory
GitHub Docs

28-rw-r--r--363L api-key agent_observer.py Demonstrates: 1. Custom AgentObserver subclass with run_id/call_id correlation▾
$cat examples/28_agent_observer.py
Deployment Observability
GitHub Docs

29-rw-r--r--155L no-key guardrails.py Demonstrates input and output guardrails for content validation, PII redaction, topic blocking, and format enforcement.▾
$cat examples/29_guardrails.py
Guardrails
GitHub Docs

30-rw-r--r--88L no-key audit_logging.py Demonstrates JSONL audit logging with privacy controls and daily file rotation.▾
$cat examples/30_audit_logging.py
Audit
GitHub Docs

31-rw-r--r--109L api-key tool_output_screening.py Demonstrates prompt injection detection in tool outputs, both per-tool and global screening.▾
$cat examples/31_tool_output_screening.py
Agent
GitHub Docs

32-rw-r--r--128L api-key coherence_checking.py Demonstrates LLM-based intent verification that catches tool calls diverging from the user's original request (prompt injection defence).▾
$cat examples/32_coherence_checking.py
Agent
GitHub Docs

33-rw-r--r--71L no-key persistent_sessions.py Demonstrates JsonFileSessionStore: the agent's conversation history is persisted to disk and restored when a new agent is created with the same session_id.▾
$cat examples/33_persistent_sessions.py
Memory Sessions
GitHub Docs

34-rw-r--r--70L no-key summarize_on_trim.py When the conversation exceeds max_messages, the oldest messages are removed. With summarize_on_trim=True the agent asks an LLM to condense them into a▾
$cat examples/34_summarize_on_trim.py
Memory
GitHub Docs

35-rw-r--r--78L no-key entity_memory.py EntityMemory merges entities into a deduplicated registry and builds a context block for the system prompt. This example manually feeds entities to demonstrate▾
$cat examples/35_entity_memory.py
Memory
GitHub Docs

36-rw-r--r--81L no-key knowledge_graph.py KnowledgeGraphMemory stores subject-relation-object triples in a TripleStore. Relevant triples are queried each turn and injected into the system prompt.▾
$cat examples/36_knowledge_graph.py
Memory
GitHub Docs

37-rw-r--r--79L no-key knowledge_memory.py KnowledgeMemory stores daily log entries and persistent facts in MEMORY.md. When configured on an agent, a ``remember`` tool is auto-registered and the▾
$cat examples/37_knowledge_memory.py
Memory
GitHub Docs

38-rw-r--r--139L no-key terminal_tools.py Demonstrates how to stop the agent loop after a specific tool fires, without making another LLM call. Two mechanisms:▾
$cat examples/38_terminal_tools.py
Observability
GitHub Docs

39-rw-r--r--166L no-key eval_framework.py==================================== Evaluate your agent's accuracy, tool use, latency, cost, and safety▾
$cat examples/39_eval_framework.py
Evals
GitHub Docs

40-rw-r--r--188L no-key eval_advanced.py====================================================================== Showcases advanced eval features:▾
$cat examples/40_eval_advanced.py
Evals
GitHub Docs

41-rw-r--r--127L no-key mcp_client.py===================================================== Use tools from any MCP-compatible server in your selectools agent.▾
$cat examples/41_mcp_client.py
Evals
GitHub Docs

42-rw-r--r--80L api-key mcp_server.py======================================================== Turn any selectools @tool function into an MCP-compliant server.▾
$cat examples/42_mcp_server.py
Deployment
GitHub Docs

43-rw-r--r--165L api-key token_budget.py Demonstrates: - max_total_tokens: hard limit on cumulative tokens▾
$cat examples/43_token_budget.py
Agent
GitHub Docs

44-rw-r--r--203L api-key cancellation.py Demonstrates: - CancellationToken for cooperative cancellation▾
$cat examples/44_cancellation.py
Observability
GitHub Docs

45-rw-r--r--212L api-key approval_gate.py Demonstrates: - @tool(requires_approval=True) decorator flag▾
$cat examples/45_approval_gate.py
Agent
GitHub Docs

46-rw-r--r--178L api-key simple_observer.py Demonstrates: - SimpleStepObserver routes 31 events to one function▾
$cat examples/46_simple_observer.py
Deployment Observability
GitHub Docs

47-rw-r--r--136L api-key token_estimation.py Demonstrates: - estimate_tokens() for single strings▾
$cat examples/47_token_estimation.py
Agent
GitHub Docs

48-rw-r--r--202L api-key model_switching.py Demonstrates: - model_selector callback on AgentConfig▾
$cat examples/48_model_switching.py
Observability
GitHub Docs

49-rw-r--r--188L api-key knowledge_stores.py Demonstrates: - KnowledgeMemory with SQLiteKnowledgeStore backend▾
$cat examples/49_knowledge_stores.py
Agent
GitHub Docs

50-rw-r--r--132L api-key reasoning_strategies.py Demonstrates: - reasoning_strategy="react" — Thought → Action → Observation cycle▾
$cat examples/50_reasoning_strategies.py
Agent
GitHub Docs

51-rw-r--r--93L api-key tool_result_caching.py Demonstrates: - @tool(cacheable=True) — cache tool results by name + args▾
$cat examples/51_tool_result_caching.py
Caching
GitHub Docs

52-rw-r--r--204L api-key semantic_cache.py Demonstrates: - SemanticCache as a drop-in replacement for InMemoryCache▾
$cat examples/52_semantic_cache.py
Caching
GitHub Docs

53-rw-r--r--264L api-key prompt_compression.py Demonstrates: - compress_context=True — enable proactive context compression▾
$cat examples/53_prompt_compression.py
Memory Observability
GitHub Docs

54-rw-r--r--203L api-key conversation_branching.py Demonstrates: - ConversationMemory.branch() — snapshot memory for safe experimentation▾
$cat examples/54_conversation_branching.py
Memory Sessions
GitHub Docs

55-rw-r--r--64L no-key agent_graph_linear.py Demonstrates a simple 3-node linear graph: planner → writer → reviewer → END▾
$cat examples/55_agent_graph_linear.py
Multi Agent
GitHub Docs Open in Builder

56-rw-r--r--66L no-key agent_graph_parallel.py Demonstrates parallel execution of multiple agents with state merging: entry → [researcher_a, researcher_b, researcher_c] → summarizer → END▾
$cat examples/56_agent_graph_parallel.py
Multi Agent
GitHub Docs Open in Builder

57-rw-r--r--71L no-key agent_graph_conditional.py Demonstrates conditional edges with path_map validation: drafter → router → (revise | publish) → END▾
$cat examples/57_agent_graph_conditional.py
Multi Agent
GitHub Docs Open in Builder

58-rw-r--r--109L no-key agent_graph_hitl.py Demonstrates generator nodes with yield InterruptRequest: - Graph pauses at reviewer node▾
$cat examples/58_agent_graph_hitl.py
Multi Agent
GitHub Docs Open in Builder

59-rw-r--r--107L no-key agent_graph_checkpointing.py Demonstrates durable mid-graph persistence using FileCheckpointStore: - Save checkpoints after each node▾
$cat examples/59_agent_graph_checkpointing.py
Multi Agent
GitHub Docs Open in Builder

60-rw-r--r--124L no-key supervisor_agent.py Demonstrates all four supervisor strategies: - plan_and_execute: LLM generates a plan, then executes each step▾
$cat examples/60_supervisor_agent.py
Multi Agent
GitHub Docs

61-rw-r--r--84L no-key agent_graph_subgraph.py Demonstrates SubgraphNode — an AgentGraph embedded as a node in another graph. Uses input_map and output_map for explicit state key translation.▾
$cat examples/61_agent_graph_subgraph.py
Multi Agent
GitHub Docs Open in Builder

62-rw-r--r--101L no-key yaml_config.py Demonstrates the structured AgentConfig workflow (v0.19.0): - Write a YAML config file describing the agent▾
$cat examples/62_yaml_config.py
Config
GitHub Docs

63-rw-r--r--165L no-key agent_templates.py Demonstrates the template system (v0.19.0): - List available built-in templates▾
$cat examples/63_agent_templates.py
Config
GitHub Docs

64-rw-r--r--183L no-key selectools_serve.py Demonstrates the `selectools serve` pattern (v0.19.0): - Create an agent with tools▾
$cat examples/64_selectools_serve.py
Deployment
GitHub Docs

65-rw-r--r--122L no-key tool_composition.py Demonstrates composing multiple tools into a single composite tool (v0.19.0): - Define individual tools with @tool()▾
$cat examples/65_tool_composition.py
Agent
GitHub Docs

66-rw-r--r--132L api-key streaming_pipeline.py Demonstrates pipeline streaming (v0.19.0): - Build a multi-step pipeline with @step▾
$cat examples/66_streaming_pipeline.py
Pipeline Streaming
GitHub Docs

67-rw-r--r--137L api-key type_safe_pipeline.py Demonstrates type-safe step contracts in pipelines (v0.19.0): - Steps infer input/output types from type hints▾
$cat examples/67_type_safe_pipeline.py
Pipeline
GitHub Docs

68-rw-r--r--158L api-key postgres_checkpoints.py Demonstrates using PostgreSQL as a checkpoint backend (v0.19.0): - Create a PostgresCheckpointStore with a connection string▾
$cat examples/68_postgres_checkpoints.py
Multi Agent
GitHub Docs Open in Builder

69-rw-r--r--369L no-key trace_store.py Demonstrates saving and querying agent traces (v0.19.0): - InMemoryTraceStore for development▾
$cat examples/69_trace_store.py
Rag
GitHub Docs

70-rw-r--r--107L no-key plan_and_execute.py The planner Agent generates a JSON execution plan. Executor agents handle each step in sequence. Results are aggregated into a final output.▾
$cat examples/70_plan_and_execute.py
Patterns Rag
GitHub Docs

71-rw-r--r--107L no-key reflective_agent.py The actor Agent produces an initial draft. The critic Agent evaluates it and provides feedback. The actor revises based on the critique. This cycle repeats▾
$cat examples/71_reflective_agent.py
Patterns
GitHub Docs

72-rw-r--r--123L no-key debate_agent.py Multiple agents argue opposing positions over max_rounds rounds. Each agent sees the prior round transcript so they can respond to each other. A judge▾
$cat examples/72_debate_agent.py
Patterns
GitHub Docs

73-rw-r--r--199L no-key team_lead_agent.py The lead Agent generates a subtask plan and delegates to team members. Three delegation strategies are demonstrated:▾
$cat examples/73_team_lead_agent.py
Multi Agent Patterns Rag
GitHub Docs Open in Builder

74-rw-r--r--66L no-key trace_to_html.py Renders an AgentTrace as a standalone HTML waterfall timeline. No external dependencies — the output is a single self-contained HTML file.▾
$cat examples/74_trace_to_html.py
Agent
GitHub Docs

75-rw-r--r--112L api-key stability_markers.py The stability module provides three decorators for annotating the public API stability of any class or function.▾
$cat examples/75_stability_markers.py
Agent
GitHub Docs

76-rw-r--r--39L api-key visual_builder.py topology in a browser, generate Python or YAML, copy or download. Start the builder with one command (no config file needed):▾
$cat examples/76_visual_builder.py
Deployment Multi Agent
GitHub Docs

77-rw-r--r--49L api-key faiss_vector_store.py No API key needed. Uses FAISS (Facebook AI Similarity Search) for high-performance local vector search. Supports save/load to disk.▾
$cat examples/77_faiss_vector_store.py
Rag
GitHub Docs

78-rw-r--r--46L api-key qdrant_vector_store.py Qdrant is a high-performance vector database with advanced filtering. This example shows the API pattern (requires a running Qdrant server).▾
$cat examples/78_qdrant_vector_store.py
Rag
GitHub Docs

79-rw-r--r--43L api-key pgvector_store.py Use your existing PostgreSQL database for vector similarity search. No additional database infrastructure needed.▾
$cat examples/79_pgvector_store.py
Rag
GitHub Docs

80-rw-r--r--76L api-key document_loaders.py No API key needed. Demonstrates all new document loader methods.▾
$cat examples/80_document_loaders.py
Agent
GitHub Docs

81-rw-r--r--57L api-key multimodal_messages.py No API key needed for this demo. Shows how to create messages with images for vision-enabled models (GPT-4o, Claude 3.5, Gemini).▾
$cat examples/81_multimodal_messages.py
Agent
GitHub Docs

82-rw-r--r--64L api-key code_execution.py No API key needed. Demonstrates the execute_python and execute_shell tools. WARNING: These tools execute code on your local machine. Do not use with▾
$cat examples/82_code_execution.py
Agent
GitHub Docs

83-rw-r--r--52L api-key web_search.py No API key needed. Uses DuckDuckGo for search (no rate limits for moderate use).▾
$cat examples/83_web_search.py
Agent
GitHub Docs

84-rw-r--r--53L api-key github_tools.py No API key needed (optional GITHUB_TOKEN increases rate limit from 60 to 5000/hr). Read-only operations only.▾
$cat examples/84_github_tools.py
Agent
GitHub Docs

85-rw-r--r--88L api-key database_query.py No API key needed. Creates a sample SQLite database and queries it. Also supports PostgreSQL with psycopg2.▾
$cat examples/85_database_query.py
Agent
GitHub Docs

86-rw-r--r--52L api-key azure_openai.py Requires: AZURE_OPENAI_ENDPOINT and AZURE_OPENAI_API_KEY env vars.▾
$cat examples/86_azure_openai.py
Streaming
GitHub Docs

87-rw-r--r--56L api-key otel_observer.py Maps selectools observer events to OTel GenAI semantic convention spans. Works with any OTel-compatible backend.▾
$cat examples/87_otel_observer.py
Deployment Observability
GitHub Docs

88-rw-r--r--59L api-key langfuse_observer.py Langfuse is the most popular open-source LLM observability platform. Traces include LLM calls, tool executions, costs, and latencies.▾
$cat examples/88_langfuse_observer.py
Deployment Observability
GitHub Docs

89-rw-r--r--57L no-key typed_tool_parameters.py Since v0.22.0 (BUG-29), selectools emits proper JSON schema for typed collections. OpenAI strict mode requires `items` / `additionalProperties`▾
$cat examples/89_typed_tool_parameters.py
Agent
GitHub Docs

90-rw-r--r--64L no-key fallback_extended_retries.py Since v0.22.0 (BUG-27), selectools recognizes these transient errors: - 529 Anthropic Overloaded (very common on US-West traffic)▾
$cat examples/90_fallback_extended_retries.py
Agent
GitHub Docs

91-rw-r--r--60L no-key structured_retry_budget.py Since v0.22.0 (BUG-34), `max_iterations` controls tool-execution iterations and `RetryConfig.max_retries` controls structured-validation retries. They no▾
$cat examples/91_structured_retry_budget.py
Structured
GitHub Docs

92-rw-r--r--64L api-key safe_parallel_pipeline.py Since v0.22.0 (BUG-30), `parallel()` branches each receive a deep copy of the input. Mutations in one branch do NOT affect siblings — even under▾
$cat examples/92_safe_parallel_pipeline.py
Pipeline
GitHub Docs

93-rw-r--r--81L api-key multi_tenant_rag.py Since v0.22.0 (BUG-25), in-memory and BM25 stores raise NotImplementedError when you pass operator-syntax filters ({$in: [...]}) instead of silently▾
$cat examples/93_multi_tenant_rag.py
Rag
GitHub Docs

94-rw-r--r--50L api-key azure_model_family.py Since v0.22.0 (BUG-28), AzureOpenAIProvider accepts a `model_family` parameter so deployments with custom names (e.g., "prod-chat") still use the correct▾
$cat examples/94_azure_model_family.py
Agent
GitHub Docs

95-rw-r--r--108L api-key loop_detection.py Since v0.22.0, `AgentConfig.loop_detector` enables three composable detectors: - RepeatDetector: same (tool, args) N times in a row▾
$cat examples/95_loop_detection.py
Agent
GitHub Docs

96-rw-r--r--188L no-key supabase_session_store.py Demonstrates SupabaseSessionStore: ConversationMemory persisted to a Supabase Postgres table as JSONB, with idempotent upserts and optional namespace▾
$cat examples/96_supabase_session_store.py
Memory Sessions
GitHub Docs

97-rw-r--r--126L no-key agent_as_api.py Demonstrates AgentAPI: one line turns an Agent (or several) into a production-ready Starlette ASGI app with standardized JSON schemas,▾
$cat examples/97_agent_as_api.py
Sessions
GitHub Docs

98-rw-r--r--123L api-key knowledge_backend.py Demonstrates the KnowledgeBackend protocol: KnowledgeMemory keeps using a fast local directory as scratch space, while a backend (Supabase or Redis)▾
$cat examples/98_knowledge_backend.py
Agent
GitHub Docs

99-rw-r--r--138L api-key tool_results_artifacts.py Two conventions every tool-using agent otherwise re-invents: 1. ToolResult — frozen dataclass base for typed tool returns. Subclasses set▾
$cat examples/99_tool_results_artifacts.py
Agent
GitHub Docs