Skip to content

Documentation / @agentick/agent / Agent

Function: Agent() ​

Agent(props): ReactElement

Defined in: agent.tsx:164

High-level agent component that renders common boilerplate.

Renders in order:

  1. Model configuration (with model options)
  2. System prompt section (if provided)
  3. Tool components
  4. KnobBinding children (each calls useKnob, renders null)
  5. Declarative sections (from sections prop)
  6. User's children
  7. <Knobs /> — aggregated knob section + set_knob tool
  8. Timeline (with optional budget props), unless timeline===false

Parameters ​

props ​

AgentProps

Returns ​

ReactElement

Examples ​

tsx
function MyAgent() {
  return (
    <Agent
      system="You are a helpful assistant."
      model={openai("gpt-4o")}
      tools={[SearchTool, CalculatorTool]}
      knobs={{ mode: knob("quick", { description: "Research depth", options: ["quick", "deep"] }) }}
      temperature={0.7}
      tokenBudget={{ maxTokens: 8000, headroom: 500 }}
    >
      <MyCustomSection />
    </Agent>
  );
}
tsx
createAgent({
  system: "You are helpful.",
  tools: [SearchTool],
  knobs: { mode: knob("quick", { description: "Depth" }) },
});

Released under the ISC License.