# Agentix v0.1.0 - Table of Contents

> A LiveView-native library for building agentic systems in Elixir, built on ReqLLM.

## Pages

- [Agentix](readme.md)
- [Changelog](changelog.md)

- Guides
  - [Installation](installation.md)
  - [Architecture](architecture.md)
  - [Hooks and the turn lifecycle](hooks-and-turn-lifecycle.md)
  - [Tools](tools.md)
  - [Persistence and resumability](persistence-and-resumability.md)
  - [Compaction](compaction.md)
  - [Rendering](rendering.md)
  - [Memory model and sizing](memory-and-sizing.md)

## Modules

- Core
  - [Agentix](Agentix.md): Agentix — a LiveView-native library for building agentic systems in Elixir.
  - [Agentix.Conversation](Agentix.Conversation.md): The public entry points for driving a conversation.
  - [Agentix.Conversation.Config](Agentix.Conversation.Config.md): Per-conversation configuration: which model, the system prompt, the (fixed)
tool list, and runtime knobs.
  - [Agentix.Event](Agentix.Event.md): A single entry in the canonical, append-only conversation log.
  - [Agentix.Executor](Agentix.Executor.md): The executor axis of a tool — who produces a tool call's result.
  - [Agentix.Scope](Agentix.Scope.md): The caller's authorization/context, passed per entry-verb call (`send_message/3`,
`resolve/4`) and threaded into `:server` tool callbacks via `Agentix.Turn`.

- Tools &amp; HITL
  - [Agentix.Tool](Agentix.Tool.md): A tool definition: its schema, who executes it, and how it is gated.
  - [Agentix.Turn](Agentix.Turn.md): The per-turn context handed to `:server` tool callbacks and to hooks.

- Hooks
  - [Agentix.Hook](Agentix.Hook.md): A hook: a function the agent runs around a model call, plus its metadata.
  - [Agentix.Hook.OverflowError](Agentix.Hook.OverflowError.md): Raised when a pre-hook injects more content than the conversation's
`injection_reserve` allows. Names the offending hook. A loud config error — the
injection/compaction subsystems are independent, so this never triggers
compaction.

- Compaction &amp; tokens
  - [Agentix.Tokenizer](Agentix.Tokenizer.md): Approximate token counting for budgeting the assembled context.
  - [Agentix.Tokenizer.Heuristic](Agentix.Tokenizer.Heuristic.md): The default `Agentix.Tokenizer`: a byte-count estimate (≈ English-text token
density of ~4 bytes/token) with a deliberate ~20% over-estimate so budgeting errs
toward leaving headroom — under-counting risks a hard over-window failure, while
over-counting only compacts a little early. A `+1` floor keeps non-empty text from
counting as zero. No dependency; rough by design — see `Agentix.Tokenizer`.

- Persistence
  - [Agentix.Persistence](Agentix.Persistence.md): The persistence behaviour and a thin dispatch to the configured adapter.
  - [Agentix.Persistence.ETS](Agentix.Persistence.ETS.md): Ephemeral ETS persistence adapter — the default, no-database option.
  - [Agentix.Persistence.Ecto](Agentix.Persistence.Ecto.md): Durable Ecto/Postgres persistence adapter — the opt-in alternative to the default
ephemeral `Agentix.Persistence.ETS`. Passes the same `Agentix.PersistenceConformance`
suite, so callers cannot tell the two apart.

- Providers
  - [Agentix.Provider](Agentix.Provider.md): Behaviour for streaming an LLM completion, plus the normalized stream handle the
agent consumes.
  - [Agentix.Provider.ReqLLM](Agentix.Provider.ReqLLM.md): The default `Agentix.Provider` — a thin wrapper over `ReqLLM.stream_text/3`.
  - [Agentix.Provider.Stream](Agentix.Provider.Stream.md): A normalized streaming handle.

- Events &amp; notifiers
  - [Agentix.Notifier](Agentix.Notifier.md): The seam for the **live event plane** — the lossy, never-canonical stream of
deltas, state changes, and progress the renderer projects.
  - [Agentix.Notifier.None](Agentix.Notifier.None.md): A no-op `Agentix.Notifier` for consumers who want zero pub/sub.
  - [Agentix.Notifier.PubSub](Agentix.Notifier.PubSub.md): The default `Agentix.Notifier` — broadcasts live events over `Phoenix.PubSub`.

- Rendering (LiveView)
  - [Agentix.Chat](Agentix.Chat.md): The headless LiveView layer: conversation state and verbs, no markup.
  - [Agentix.Components](Agentix.Components.md): Default function components for rendering an `Agentix.Chat` conversation.

- Testing
  - [Agentix.Test](Agentix.Test.md): Test helpers for driving agents deterministically without an API key.
  - [Agentix.Test.MockProvider](Agentix.Test.MockProvider.md): A scriptable `Agentix.Provider` for deterministic tests — no API key, no network.

## Mix Tasks

- [mix agentix.gen.components](Mix.Tasks.Agentix.Gen.Components.md): Copies the default `Agentix.Chat` components into your project so you can edit the
markup directly (an alternative to `import Agentix.Components`).
- [mix agentix.gen.migration](Mix.Tasks.Agentix.Gen.Migration.md): Copies the Agentix tables migration into your repo so the Ecto/Postgres persistence
adapter (`Agentix.Persistence.Ecto`) has its schema.

