Agent history and recipes are just rows. The agent extension stores what your runtime already produces.
1. Enable the Extension
The optional built-inagent extension persists agent runtime history and recipes as ordinary workspace entities. It does not replace hb.LLM, LLMSession, prompts, Toolkits, or MCP — it stores the pieces those systems already use.
hb.Agent, hb.Session, hb.Message, hb.Skill) import anywhere, but workspace rows require enablement. The class save/load helpers enable the extension on their target workspace automatically, so an explicit enable_extension("agent") is only needed when you want to query the rows yourself first.
2. Persistent Entities
The extension registers four entities:| Entity id | Class | Stores |
|---|---|---|
agent-message | hb.Message | One OpenAI-format payload plus role, content_text, and tool_call_count query projections |
agent-session | hb.Session | Ordered message_ids, turn_count, tool_call_count, runtime state, and aggregated usage |
agent-skill | hb.Skill | Parsed SKILL.md frontmatter, skill_body, toolkit_refs, and a deterministic zip archive |
agent-agent | hb.Agent | A recipe: llm_preset, prompt_ref, skill_refs, toolkit_refs, and runtime args |
Message.payload is the canonical OpenAI-format dictionary. The projections exist for query and Catalog discovery, not as a second source of truth.
3. Logged CLI Runs
hb llm chat writes one agent-session row and ordered agent-message rows after the response completes. hb llm session creates one persistent session when the interactive session starts, then appends each completed user/assistant/tool iteration. The CLI output shape is unchanged.
Inspect logged history through the active workspace:
Session.messages() returns OpenAI-format payloads in session order, ready to feed back into a runtime session.
4. Skills
Create a Skill from a folder containingSKILL.md:
SKILL.md frontmatter may declare Toolkit refs with toolkit::
archive. Use the runtime read_skill tool when an agent needs file contents:
5. Agent Recipes
Anhb.Agent row is a recipe, not a second runtime stack:
build() resolves hb.LLM, hb.Prompt, hb.Skill, and registered hb.Toolkit refs, then returns an AgentRuntime whose session is a normal LLMSession with tools attached. Use agent.new_session() when you want a persistent hb.Session row for a future run.
The extension covers single-agent recipes today. Multi-agent orchestration is future work.

