Rho.Artifacts (rho v0.1.0)

Copy Markdown View Source

The output budget: a tool result over 16 KiB goes to the model as its head and tail with a marker in the middle; the full text is kept as an artifact the agent reads back with the read_artifact tool, a page of lines at a time.

Artifacts live in <data dir>/artifacts/<session id>/<call id>.txt and are addressed by the call id (artifact://<call id>), so a session only sees its own.

Summary

Functions

Bytes a tool result may have before it's spilled.

The artifact's file, or {:error, :not_found}.

The text to give the model for a tool result, spilling it to an artifact if it's over budget.

Functions

budget()

@spec budget() :: pos_integer()

Bytes a tool result may have before it's spilled.

find(dir, session_id, id)

@spec find(Path.t(), String.t(), String.t()) :: {:ok, Path.t()} | {:error, :not_found}

The artifact's file, or {:error, :not_found}.

limit(text, dir, session_id, call_id)

@spec limit(String.t(), Path.t(), String.t(), String.t()) :: String.t()

The text to give the model for a tool result, spilling it to an artifact if it's over budget.