# `Condukt.Session`
[🔗](https://github.com/tuist/condukt/blob/0.16.5/lib/condukt/session.ex#L1)

GenServer that manages an agent session.

The session maintains:
- Conversation history (messages)
- Current model configuration
- Available tools
- Streaming state

## The Agent Loop

When a prompt is received:

1. Add user message to history
2. Call LLM with system prompt, messages, and tools
3. If LLM returns tool calls:
   - Execute each tool
   - Add tool results to history
   - Go to step 2
4. If LLM returns text only, return response

# `abort`

Aborts the current operation.

# `child_spec`

Returns a specification to start this module under a supervisor.

See `Supervisor`.

# `clear`

Clears the conversation history.

# `compact`

Runs the configured compactor against the current message history.

No-op when no compactor is configured. The compacted snapshot is
immediately persisted if a session store is configured.

# `follow_up`

Queues a follow-up message.

# `history`

Returns the conversation history.

# `run`

Runs a prompt synchronously, returning the final response.

# `steer`

Injects a steering message.

# `stream`

Streams a prompt, returning an enumerable of events.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
