Agents
Build AI agents with tool use, function calling, MCP servers, and streaming step output.
📄️ AI Agents — SynapseKit Python LLM Framework
Build async AI agents in Python with SynapseKit. ReAct, function calling, multi-agent, and tool use. LangChain agent alternative with 50 built-in tools.
📄️ ReActAgent
ReActAgent implements the Reasoning + Acting pattern. It works with any BaseLLM — no native function calling required.
📄️ FunctionCallingAgent
FunctionCallingAgent uses native LLM function calling — OpenAI toolcalls or Anthropic tooluse. More reliable tool selection than ReAct, especially with multiple tools.
📄️ Agent Tools — Function Calling | SynapseKit Python
50 built-in tools for Python AI agents. Use @tool decorator, function calling, or custom tools. Web search, code execution, file I/O, and more.
📄️ AgentExecutor
AgentExecutor is the recommended high-level entry point. It wraps ReActAgent or FunctionCallingAgent behind a consistent interface.
📄️ MCP (Model Context Protocol)
SynapseKit supports the Model Context Protocol for connecting to external tool servers, wrapping MCP tools for use with agents, and exposing your own tools as an MCP server.
📄️ Agent Cookbook
A collection of common agent patterns with full working code examples. Copy-paste and adapt these recipes for your use case.
📄️ Tool Authoring Guide
Write custom tools for SynapseKit agents using the @tool decorator or BaseTool class.
📄️ Streaming Agent Steps
Both ReActAgent and FunctionCallingAgent support stream_steps(), an async generator that yields structured step events as the agent reasons through a task. This enables real-time UIs, logging, and debugging.
📄️ Reasoning Agent
Routes queries to either a fast LLM or a reasoning-capable LLM based on query complexity. Simple queries use the fast path; complex queries (math, multi-step reasoning, architecture, debugging) are sent to the reasoning LLM with a token budget. Falls back to the fast LLM on timeout or budget exhaustion.
📄️ Agent Federation
Distributed agent routing across a registry of named agents. AgentFederation selects an agent based on tags, tools, and a routing strategy, then dispatches the prompt to that agent's client.
📄️ Agent Swarm
Market-based orchestration over an AgentFederation. Instead of round-robin or capacity routing, AgentSwarm runs an auction for every task: candidate agents submit bids describing estimated cost, quality, and confidence; a BidStrategy scores those bids against each agent's learned Reputation; and winners are selected by the configured AuctionType. Outcomes feed back into reputation (via UCB or Thompson sampling), so agents that consistently deliver win more of their category over time. Runs are deterministic when you set a seed.
📄️ Self-Improving Agent
Wraps any agent in an eval-gated self-improvement loop. SelfImprovingAgent observes production feedback, has a MetaAnalyzer propose signed, reversible AgentConfigPatch diffs (prompt rewrites, tool changes, routing rules, few-shot examples), validates each candidate against an EvalSuite (or PromptOptimizer), and only promotes it to a canary rollout through an AutoRolloutManager if it clears the eval gate. Every patch is signed, appended to an append-only audit log, and can be rolled back to its recorded before snapshot.
📄️ Computer Use Agent
Drives a screen with a provider-agnostic observe → plan → act loop. ComputerUseAgent captures screen state through a ScreenProvider, asks a ComputerUseProvider for the next step, normalizes every provider's output into a single ComputerAction schema, runs it through a conservative SafetyPolicy, and executes it — pausing for human confirmation on risky actions. The same agent code runs against Anthropic computer-use, OpenAI's computer tool, or an open-source local model, and can record every session to JSONL for exact replay.
📄️ Neuro-Symbolic Agent
Pairs an LLM with a formal solver. The LLM reads a natural-language problem and extracts formal constraints; a symbolic backend (Z3, SymPy, MiniZinc, or Prolog) solves and independently verifies them; and the LLM only renders a final answer once the solver has confirmed a satisfiable model. Every run carries a ProofTrace describing the solver status and model, so answers are checkable rather than merely plausible. Unverified answers are handled by an explicit on_unverified policy — retry, reject, or flag.
📄️ Digital Twin Agent
Learns your authentic writing voice and drafts commit messages, PR descriptions, and code reviews that sound like you — never auto-sending anything you have not gated as safe. DigitalTwinAgent distills your text samples into a versioned StyleProfile (tone, structure, vocabulary, review style), generates drafts through your LLM, and scores every candidate with a VoiceMatcher (n-gram overlap, vocabulary match, structure match, plus an optional LLM judge). An enforced DelegationPolicy gates dispatch: neversendauto channels are hard-blocked, and draftwithapproval channels refuse to send without an explicit human approval token.
📄️ Time-Travel Codebase
Reason across a repository's entire evolution — not just its current state. TimeTravelAgent wraps a git repo behind a GitBackend, parses commit history into an AST-based EvolutionIndex (symbol- and file-level change entries with #NNN PR linkage), flags stale abstractions with a DriftDetector, and turns diff timelines into readable markdown with a DiffNarrativeGenerator. You can scope any query to a point in time with agent.as_of(date), ask natural-language questions about how code got the way it is, and get an LLM (or heuristic) narrative back.
📄️ Signed Agent Marketplace
Package an agent as a portable, cryptographically signed .agent bundle, verify it end to end, install it safely, and share it through a self-hostable registry with signed reviews and eval-based ranking. A bundle is a deterministic ZIP whose manifest.json inventories every file with a per-file SHA-256 digest, and whose manifest is signed with an Ed25519 publisher key. Nothing in a bundle is ever imported or executed during verification or installation — an installed agent is inert and can only run once you attach an explicit sandbox.