Skip to main content
from definable.agent import Agent

Constructor

ParameterTypeDefaultDescription
modelstr | ModelLLM provider. String shorthand ("gpt-4o") or Model instance.
instructionsstr""System prompt instructions.
toolsList[Function][]Tool functions decorated with @tool.
toolkitsList[Toolkit][]Toolkit instances (MCPToolkit, BrowserToolkit).
skillsList[Skill][]Skill instances (instructions + tools).
knowledgeKnowledge | strNoneRAG knowledge base or directory path shorthand.
memoryMemory | boolNoneSession memory. True for InMemoryStore.
thinkingThinking | boolNoneReasoning phase. True for defaults.
deep_researchDeepResearchConfig | boolNoneMulti-wave research. True for defaults.
audio_transcriberAudioTranscriber | boolNoneVoice transcription. True for Whisper.
securitySecurityConfig | boolNoneSecurity hardening. True for defaults.
guardrailsGuardrailsNoneInput/output/tool guardrails.
middlewareList[Middleware][]Middleware chain.
tracingTracing | boolNoneEvent export. True for DebugExporter.
pluginsList[Plugin]NonePlugins loaded on first arun().
readersBaseReader | boolNoneFile readers. True for auto-registry.
configAgentConfigAgentConfig()Execution configuration.
usageUsageTracker | boolNoneToken/cost tracking. True for defaults.
namestrNoneDisplay name (overrides config.agent_name).
debugboolFalseColor-coded turn-by-turn debug output.

Methods

MethodReturnsDescription
run(instruction, **kwargs)RunOutputSynchronous execution.
arun(instruction, **kwargs)RunOutputAsync execution.
run_stream(instruction, **kwargs)Iterator[RunOutputEvent]Sync streaming.
arun_stream(instruction, **kwargs)AsyncIterator[RunOutputEvent]Async streaming.
serve(*interfaces, **kwargs)Start runtime with interfaces, webhooks, cron.
aserve(*interfaces, **kwargs)Async version of serve.
replay(run_output=, trace_file=)Replay | RunOutputInspect or re-execute a past run.
compare(a, b)ReplayComparisonCompare two runs.
security_audit()SecurityReportRun security audit.
use(middleware)AgentAdd middleware (fluent).

Run Parameters

ParameterTypeDefaultDescription
instructionstrUser message.
messagesList[Message]NoneExisting conversation history.
session_idstrNoneSession grouping identifier.
run_idstrNoneUnique run identifier.
user_idstrNoneUser identifier for memory scoping.
imagesList[Image]NoneImage inputs.
audioList[Audio]NoneAudio inputs.
videosList[Video]NoneVideo inputs.
filesList[File]NoneFile inputs.
output_schemaType[BaseModel]NonePydantic model for structured output.

Properties

PropertyTypeDescription
agent_idstrUnique identifier.
agent_namestrDisplay name.
tool_namesList[str]Registered tool names.
plugin_registryPluginRegistryPlugin manager.
usage_trackerUsageTracker | NoneToken/cost tracker.
schedulerScheduler | NoneAuto-created scheduler for triggers.