Skip to main content

Agents Overview

SynapseKit agents are async-first, tool-using AI systems that reason and act to complete tasks.

Core concepts

ConceptClassDescription
ToolBaseToolA single action the agent can take
RegistryToolRegistryLooks up tools by name, generates schemas
MemoryAgentMemoryRecords Thought→Action→Observation steps
ReActReActAgentPrompt-based reasoning loop, any LLM
Function CallingFunctionCallingAgentNative OpenAI/Anthropic tool use
ExecutorAgentExecutorUnified runner — picks the right agent

Quick start

import asyncio
from synapsekit import AgentExecutor, AgentConfig, CalculatorTool
from synapsekit.llm.openai import OpenAILLM
from synapsekit.llm.base import LLMConfig

llm = OpenAILLM(LLMConfig(model="gpt-4o-mini", api_key="sk-..."))

executor = AgentExecutor(AgentConfig(
llm=llm,
tools=[CalculatorTool()],
agent_type="function_calling",
))

answer = asyncio.run(executor.run("What is 2 ** 10 + 24?"))
print(answer) # "The answer is 1048."

Built-in tools

ToolClassExtraDescription
CalculatorCalculatorToolnoneSafe math eval
Python REPLPythonREPLToolnoneExecute Python code
File ReadFileReadToolnoneRead local files
Web SearchWebSearchToolsynapsekit[search]DuckDuckGo search
SQL QuerySQLQueryToolnone (SQLite) / sqlalchemySQL SELECT queries

Agent types

"react" — Works with any LLM. Uses a structured text prompt (Thought/Action/Observation). No native function calling required.

"function_calling" — Requires OpenAILLM or AnthropicLLM. Uses native tool_calls / tool_use for more reliable tool selection.

Sync usage

executor = AgentExecutor(AgentConfig(llm=llm, tools=[CalculatorTool()]))
answer = executor.run_sync("What is sqrt(144)?")