Ai Agents
PART 17 — AI Agents¶
An Agent treats the LLM as a controller in a state machine.
- Tool Calling: The LLM outputs a JSON payload matching an OpenAPI spec you provided. Your application code parses the JSON, executes the actual Python/API call, and feeds the result back to the LLM.
- ReAct Loop: Reason + Act.
- SDE Takeaway: Agents are an Actor Model / Event-Driven Architecture. They introduce massive latency and require asynchronous queueing (e.g., Kafka, Celery), strict timeout policies, and state persistence (saving the chat history to Postgres so the agent can resume if a node crashes).