feat(builder): agent story-link narration (AgentBuilder) #16

Merged
charles merged 1 commit from feat/agent-narration into main 2026-06-17 14:39:59 +00:00
Owner

The AI agent value-add, guardrail-correct. AgentBuilder wraps DeterministicBuilder — route + prices stay deterministic + sourced — and asks the LLM for a short per-stop story-link ("why this place matters to your family") from the stop's family event only. The agent narrates; it never sets coordinates, prices, or family facts (FR-AGT-15/16/17, FR-TRP-13). Best-effort: an LLM error leaves the valid trip unchanged.

Changes

  • builder: agent_builder::AgentBuilder (deps geneatrip-agent) → attaches StoryLink{why, source:"agent"} to each stop's first activity.
  • api: uses AgentBuilder when GENEATRIP_LLM_BASE is set (Qwen/Ollama or Kimi/UmansAI via OpenAiCompat), else DeterministicBuilder. Trip view renders + the why text.

Verification

  • just qa green. Tested with ScriptedProvider (no live LLM): story-link attached + sourced "agent". Live narration needs an LLM endpoint configured.

Traces: FR-TRP-13, FR-AGT-15/16/17 · tech-spec 04/03.

The **AI agent value-add**, guardrail-correct. `AgentBuilder` wraps `DeterministicBuilder` — route + prices stay **deterministic + sourced** — and asks the LLM for a short per-stop **story-link** ("why this place matters to your family") from the stop's family event only. The agent **narrates**; it never sets coordinates, prices, or family facts (FR-AGT-15/16/17, FR-TRP-13). Best-effort: an LLM error leaves the valid trip unchanged. ## Changes - **builder**: `agent_builder::AgentBuilder` (deps geneatrip-agent) → attaches `StoryLink{why, source:"agent"}` to each stop's first activity. - **api**: uses `AgentBuilder` when `GENEATRIP_LLM_BASE` is set (Qwen/Ollama or Kimi/UmansAI via `OpenAiCompat`), else `DeterministicBuilder`. Trip view renders ⭐ + the why text. ## Verification - `just qa` green. Tested with `ScriptedProvider` (no live LLM): story-link attached + sourced "agent". Live narration needs an LLM endpoint configured. Traces: FR-TRP-13, FR-AGT-15/16/17 · tech-spec 04/03.
feat(builder): agent story-link narration (AgentBuilder)
All checks were successful
qa / qa-1 (push) Successful in 1m33s
qa / qa (push) Successful in 0s
qa / qa-1 (pull_request) Successful in 4m2s
qa / qa (pull_request) Successful in 0s
62eb250ef9
The "AI agent" value-add, guardrail-correct: AgentBuilder wraps the
DeterministicBuilder (route + prices stay deterministic + sourced) and asks the
LlmProvider for a short per-stop story-link — "why this place matters to your
family" — from the stop's family event only. The agent NARRATES; it never sets
coordinates, prices, or family facts (FR-AGT-15/16/17, FR-TRP-13). Narration is
best-effort (LLM error leaves the valid trip unchanged).

- builder: agent_builder::AgentBuilder (deps geneatrip-agent); attaches
  StoryLink{why, source:"agent"} to each stop's first activity.
- api: uses AgentBuilder when GENEATRIP_LLM_BASE is set (Qwen/Ollama or
  Kimi/UmansAI via OpenAiCompat), else DeterministicBuilder. trip view renders
   + the why text.

Tested with ScriptedProvider (no live LLM): story-link attached, sourced "agent".
just qa green (builder 3 tests).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
charles/geneatrip!16
No description provided.