Skip to main content
This page is the map for the framework. ai-query is intentionally layered. You should not learn everything at once.

Start Here

If you are new, follow this order:
  1. Quickstart
  2. Concepts
  3. Generating Text
  4. Streaming
  5. Tools
  6. Stateful Agents
  7. Live Turns

The Decision Tree

I just want to call a model

Use generate_text().
Read: Generating Text

I want streamed model output

Use stream_text().
Read: Streaming

I want the model to call Python functions

Use tools.
Read: Tools

I want memory or sessions

Use Agent.
Read: Stateful Agents

I want metadata about an agent response

Use Agent.run().
Read: Agent Reference

I am building a CLI or web UI

Use Agent.turn().
Read: Live Turns

I want to serve many users

Use AgentServer.
Read: Agent Server

Import Map

Common imports:
Core types and advanced control:

Product Boundaries

These are the boundaries to keep in your head:
  • Providers create models.
  • Core functions run model calls.
  • Tools give models capabilities.
  • Agents add identity, state, storage, and message history.
  • Turns expose one live agent execution.
  • Servers expose agents over HTTP, SSE, WebSocket, and RPC.
If a page does not fit one of those categories, it probably belongs in the Cookbook or API Reference.