API Reference Agentix v#0.1.0

Copy Markdown View Source

Modules

Agentix — a LiveView-native library for building agentic systems in Elixir.

The headless LiveView layer: conversation state and verbs, no markup.

Default function components for rendering an Agentix.Chat conversation.

The public entry points for driving a conversation.

Per-conversation configuration: which model, the system prompt, the (fixed) tool list, and runtime knobs.

A single entry in the canonical, append-only conversation log.

The executor axis of a tool — who produces a tool call's result.

A hook: a function the agent runs around a model call, plus its metadata.

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.

The seam for the live event plane — the lossy, never-canonical stream of deltas, state changes, and progress the renderer projects.

A no-op Agentix.Notifier for consumers who want zero pub/sub.

The default Agentix.Notifier — broadcasts live events over Phoenix.PubSub.

The persistence behaviour and a thin dispatch to the configured adapter.

Ephemeral ETS persistence adapter — the default, no-database option.

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.

Behaviour for streaming an LLM completion, plus the normalized stream handle the agent consumes.

The default Agentix.Provider — a thin wrapper over ReqLLM.stream_text/3.

A normalized streaming handle.

The caller's authorization/context, passed per entry-verb call (send_message/3, resolve/4) and threaded into :server tool callbacks via Agentix.Turn.

Test helpers for driving agents deterministically without an API key.

A scriptable Agentix.Provider for deterministic tests — no API key, no network.

Approximate token counting for budgeting the assembled context.

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.

A tool definition: its schema, who executes it, and how it is gated.

The per-turn context handed to :server tool callbacks and to hooks.

Mix Tasks

Copies the default Agentix.Chat components into your project so you can edit the markup directly (an alternative to import Agentix.Components).

Copies the Agentix tables migration into your repo so the Ecto/Postgres persistence adapter (Agentix.Persistence.Ecto) has its schema.