Turn long AI coding sessions into a playful highlight reel.
Instead of only counting tokens and tool calls, Agent Wrapped looks for the parts people actually remember:
- π Memorable quotes β dramatic lines such as βMajor discovery!!! Our whole approach was wrong!β
- π’ Catchphrases β repeated phrases and verbal habits across a session
- π€‘ Boomerangs β confident claims that get reversed later
- πΊ Called-it-too-early moments β repeated declarations that the root cause was found
- π§ Plot twists β sudden changes of direction, realizations, and self-corrections
- πΎ Premature celebrations β victory laps that get overturned a few messages later
- π¬ Story + session persona (experimental) β grounded multi-step stories and a session-scoped character read from observable behavior
- π Session / weekly / monthly Wrapped β later, compare patterns across sessions and agents
Agent Wrapped is intentionally entertainment-first. It should feel more like an awards show for your AI sessions than another productivity dashboard.
P0βP7 remain the local quote/moment pipeline. Experimental P8 adds a second, event-first story route so a hilarious tool sequence can be discovered even when no individual assistant sentence was ranked as a Moment:
Host session logs
β
Session ingestion
β
Observable SessionEvent[] ββββββββββββββββββββββββββββββββ
β β
ββ text route ββ story route
β β β β
β TranscriptMessage[] β bounded story windows
β β β β
β P0 EventExtractor β redact secrets / identity
β β β β
β P1 MomentGraph β LLM-A: Story Miner
β β β structure only
β P2 MomentBuilder β β
β β β local grounding / validation
β P3 MomentRanker β β
β β β VerifiedStoryArc[]
β P3.5 AwardComposer β β
β β β deterministic Persona Aggregator
β P4 WrappedReport β β
β β LLM-B: Narrator
β β editorial language only
ββββββββββββββββββββββββββββ final presentation ββββββββ
β
π awards + π¬ story + π persona
A P3 Moment can help P8 choose context, but it is only a secondary hint. It is no longer the gate that decides what the story model is allowed to see.
- β P0 β Event model + EventExtractor: unified multi-label text events, topics, claims/stance, verbal families, drama and standalone-quality signals.
- β
P1 β Moment Graph:
repeats,similar_to,same_topic,contradicts,retracts,followed_by, andcelebrates_beforerelations. - β
P2 β MomentBuilder: composes graph structure into
one_liner,repeated_pattern,boomerang,false_dawn,plot_twist, andcorrection_arcmoments. - β
P3 β MomentRanker: ranks complete moments with separate
funScoreandconfidence, plus standalone quality, context payoff, surprise, rarity, readability, and structural strength. - β P3.5 β AwardComposer: protects the core quote/repetition/boomerang slots, fills remaining slots with strong side moments, deduplicates overlapping views, and does not force weak cards.
- β P4 β WrappedReport / output: runs P0βP3.5 end to end and preserves original source wording.
- β
P5 β Session ingestion: host-neutral
IngestedSession; current DeepSeek Harness JSONL/Zstandard support. DSH now also recovers observabletool/call,tool/result, andturn/endrecords into a host-neutralSessionEvent[]stream. - β P6 β Real-session evaluation / calibration: bounded human-review cases, deterministic A/B comparisons, keep/drop/skip, fun ratings and missed moments.
- β P7 β Local Evaluation Runner: resumable workspace/CLI with review-protocol + locale isolation and language-bias safeguards.
- π§ͺ P8 v2 β Story + session persona: opt-in, event-first, two-pass semantic architecture. Story Miner proposes structure, local code validates it, persona signals are aggregated deterministically, and a second narrator may only write editorial titles/commentary/nicknames.
npm run build
# Prepare newest real DSH sessions.
node dist/cli.js dsh --latest 30
# Review one session at a time, or use --all.
node dist/cli.js review
node dist/cli.js review --all
# Inspect progress/calibration.
node dist/cli.js status
node dist/cli.js calibrationWhen installed as a package/bin:
agent-wrapped dsh --latest 30
agent-wrapped review
agent-wrapped calibrationThe default workspace is $AGENT_WRAPPED_HOME/review-workspace.json, falling back to ~/.agent-wrapped/review-workspace.json. It stores evaluation cases and human review data, not copies of full DSH transcripts.
P7 protocol v2 binds judgments to both the review protocol and presentation locale. Changing the candidate set, protocol, or locale invalidates incompatible labels rather than mixing them. In zh-CN, an incompletely localized English A/B pair is automatically skipped instead of measuring English-reading friction.
See docs/p7-local-review-runner.md for the review protocol and storage behavior.
P8 accepts that βε§ζ + δΊΊζ Όβ is genuinely semantic, but it does not hand the entire transcript to an LLM and hope for a funny summary.
Host adapters normalize what actually happened into SessionEvent[]:
user_message
assistant_text
tool_call
tool_result / tool_error
turn_end
For DSH, tool/call, tool/result, and turn/end are now read from the durable session log. This lets P8 see stories such as:
attempt delete
β permission error
β switch to another tool
β success
That story can be discovered even if P0βP3 found no funny assistant quote.
Local code selects a small set of event windows around structural signals such as tool failures, user pushback, assistant corrections and turn failures. A small number of coverage windows is also sampled so Story Discovery is not entirely gated by hand-written cues.
P3 Moments are included only as secondary attention hints.
Before a remote semantic call, common secrets and identity-bearing text are redacted, including bearer tokens, common API-key/token forms, email addresses and home-directory usernames. Evidence is also capped by event count, per-event characters and total characters.
The first semantic pass may propose only a controlled structure such as:
{
"arcKind": "failure_then_workaround",
"beats": [
{ "kind": "attempt", "evidenceIds": ["event:..."] },
{ "kind": "failure", "evidenceIds": ["event:..."] },
{ "kind": "workaround", "evidenceIds": ["event:..."] }
],
"confidence": "high"
}It is not allowed to write the story title, comedy copy, persona, or 0β100 scores.
Before any generated story can reach presentation, local code verifies:
- every cited event exists;
- beats are in chronological order;
- the cited actor/event type can support that beat (
user_pushbackmust cite a user event, failure must cite a failure-like event, etc.); - the requested arc shape is actually present, for example failure before workaround.
Candidates that fail these checks are dropped instead of being narrated.
Persona does not come from an LLM inventing βε εΏζ 82/100β. Agent Wrapped derives coarse observed signals from verified stories + grounded Moments, for example:
ε
εΏζ high Β· 3
θͺζηΊ ι medium Β· 2
ζ§ηη¨εΊ¦ high Β· 4
δΈ΄εΊει low Β· 1
The exact thresholds are local and reproducible. These are session behavior signals, not claims that a model has an inherent personality.
After structure and persona signals are fixed, the second optional pass may write only:
- a title for each verified story;
- clearly labeled
θ΅εθ§£θ―΄editorial commentary; - a session-scoped persona nickname/tagline such as
ζ¬εΊθ‘¨η°εβ¦β¦.
It cannot add another tool result, user reaction, accident or source quote. Story facts stay in the verified structure.
No endpoint is assumed. Configure any OpenAI-compatible endpoint explicitly:
export AGENT_WRAPPED_LLM_BASE_URL="https://your-endpoint.example/v1"
export AGENT_WRAPPED_LLM_MODEL="your-model"
export AGENT_WRAPPED_LLM_API_KEY="..." # optional for local endpoints
npm run story:latestOptional knobs:
export AGENT_WRAPPED_LOCALE=zh-CN
export AGENT_WRAPPED_TOP_MOMENTS=6
export AGENT_WRAPPED_LLM_JSON_MODE=1
# Only when the host actually exposed reasoning to the user:
export AGENT_WRAPPED_INCLUDE_REASONING=1story:latest prints the number of bounded events/windows, secondary Moment hints, redaction count and truncation state before semantic generation. A normal P8 v2 run may make two semantic calls: Story Miner, then Narrator after local validation. The full DSH transcript is not included in either request.
P8 is still experimental and is not part of P7 calibration yet.
Analysis-only Moment Engine:
const moments = analyzeMoments(messages);Complete local Wrapped:
const report = createWrappedReport(messages, {
awards: { maxAwards: 5 },
});
console.log(renderWrappedText(report));Current DeepSeek Harness local sessions:
const sessions = await loadDshSessions({ maxSessions: 20 });
const report = createWrappedReport(sessions[0].messages);P6/P7 calibration:
const refreshed = await refreshLocalDshReviewWorkspace({
ingest: { maxSessions: 50 },
evaluation: { topMoments: 8, maxPairwiseTasks: 12 },
reviewLocale: "zh-CN",
});
const calibration = calibrateReviewWorkspace(refreshed.workspace);P8 v2:
const { narrator } = createOpenAICompatibleNarratorFromEnv();
const { report, evidence } = await generateSemanticStoryPersona(
session,
narrator,
{ topMoments: 6 },
);
console.log(renderSemanticStoryPersonaText(report, evidence));Existing QuoteScorer, CatchphraseClusterer, BoomerangDetector, FacetScorer, and SessionAnalyzer APIs remain compatibility surfaces while new work uses the Moment Engine.
- β DeepSeek Harness β current durable JSONL/Zstandard format, including tool calls/results and turn outcomes
- βοΈ Claude Code β next adapter
- βοΈ OpenAI Codex β next adapter
- βοΈ OpenCode β later
The host-neutral boundaries are now both TranscriptMessage[] for the local text/Moment route and SessionEvent[] for observable story behavior. A new host adapter should normalize into those shared contracts instead of leaking host-specific event semantics into P8.
- Local-first by default. P0βP7 work without another LLM call. P8 is explicit opt-in and has no default network endpoint.
- Use only exposed / observable session data. Agent Wrapped does not attempt to recover hidden chain-of-thought.
- Original wording matters. Source quotes stay source quotes; editorial narration is visibly labeled as narration.
- Fun before analytics. Token charts are optional; memorable moments are the product.
- Cross-agent core. Core event, moment, story and evaluation concepts stay independent from any single runtime.
- Fun score and confidence are different. Entertainment value never substitutes for factual confidence.
- No parser sprawl. New ideas should first fit Event β Relation β Moment/Story β Presentation rather than becoming another one-off detector.
- Do not force a Wrapped. Weak or ungrounded material may legitimately produce no card/story.
- Calibrate on people. P6/P7 remain the source of truth for whether local Moments are useful; P8 needs its own real-session evaluation before becoming default.
- Labels must match candidates and presentation. P7 protocol/locale isolation remains intact.
- Story Discovery is not P3-gated. P3 Moments may hint, but observable event windows get independent coverage.
- LLMs interpret structure and write copy; local code owns evidence boundaries. Story Miner output is validated before Narrator sees it.
- No fake persona precision. Persona magnitude is deterministic and coarse, never an LLM-generated 0β100 number.
- Remote evidence is bounded and redacted. Full transcripts stay local unless a future explicit mode says otherwise.
Run the full regression suite:
npm testStages can also be checked separately:
npm run test:event
npm run test:graph
npm run test:moment-builder
npm run test:moment-ranker
npm run test:award-composer
npm run test:wrapped
npm run test:ingest
npm run test:evaluation
npm run test:review
npm run test:p5-p6
npm run test:p7
npm run test:p8π§ Early prototype. P0βP7 are implemented. P8 v2 is an opt-in architecture experiment. The next evidence should come from side-by-side real-session review: does event-first Story Discovery recover the βε§ζ + δΊΊζ Όβ people actually enjoy, and is the added value worth its cost/latency/privacy tradeoff? If yes, the next engineering work is richer host adapters and explicit P8 human evaluation β not more award-specific regex detectors.
MIT