Skip to main content
What’s New β†’ What’s new in 1.6.0: First-class journal-capture primitives downstream repos import β€” PhaseCapture.stepCosts(), JournalSteps.fromEvents(), a production fail-loud RunRecorder, and per-turn usage in the immutable log (slice 1 of the cross-repo capture contract). Plus a cost-metering correction β€” the headline LLMCallEvent.tokenUsage is now the cost-bearing Ξ£-per-turn aggregate (incl. cache), fixing a ~2Γ— under-count on long runs β€” and a per-file schemaVersion header on events.jsonl / analysis.jsonl. Additive on the frozen capture contract: a 1.5.0 consumer keeps working. (1.5.0 added first-class Gemini CLI capture β€” the gemini-cli-capture module, same portable trace + cost schema as Claude. Three modules: journal-core, claude-code-capture, gemini-cli-capture.)
This project has moved from the spring-ai-community GitHub organization to markpollack. New releases are published under the Maven groupId io.github.markpollack, and Java packages now use the io.github.markpollack namespace. If you previously used org.springaicommunity, update your dependency coordinates and imports to the current values shown below.

Overview

Agent Journal captures the structured behavioral traces that make agent research possible. Every LLM call, tool invocation, state transition, and decision point is logged as a typed event in an append-only journal. The EvalSubject extraction layer converts heterogeneous event sources into a uniform stream of behavioral units ready for evaluation by Agent Judge. A human feedback API records reviewer judgments with typed scores for judge calibration and golden dataset creation.

Architecture

Event System

Sealed event hierarchy: LLM calls, tool calls, state changes, git events, metrics, custom events

EvalSubject Extraction

Source-neutral behavioral units for evaluation β€” 9 subject kinds from journal events or SDK captures

Human Feedback

Typed feedback events with binary, numerical, and categorical scores for judge calibration

Modules

Installation

For Claude Code SDK integration:
For Gemini CLI capture:

EvalSubject

EvalSubject is the source-neutral unit of recorded agent behavior that can be judged. Each subject carries an ID, kind, source reference, and metadata extracted from the original event.

EvalSubjectKind

Nine kinds classify the type of behavior:

EvalSubjectSource

Functional interface that adapts a specific data source into a stream of EvalSubject records:

EvalSubjectSources

Factory for creating sources from journal data:
The claude-code-capture module provides PhaseCaptureSources.fromPhaseCaptures(captures) for extracting subjects from Claude Code SDK PhaseCapture records β€” each phase becomes an LLM_CALL subject and individual tool uses become separate TOOL_CALL subjects.

EvalSubjectQuery

Fluent selection and grouping over subjects:

Human Feedback

Record human reviewer judgments for judge agreement analysis and golden dataset creation.

FeedbackTarget

Identifies what the feedback applies to:

FeedbackEvent

Records a single piece of human feedback. Implements JournalEvent and is stored in the journal’s feedback.jsonl sidecar:

FeedbackScore

Typed score with three kinds:

FeedbackService

Records and queries feedback, exports reviewed items for golden dataset creation:
ReviewedItem is a projection record containing itemId, runId, feedback, and itemMetadata β€” suitable for building labeled datasets from human judgments.

Workflow Integration

The workflow-journal module bridges agent-workflow step execution to the journal. Each workflow step completion is recorded as a WorkflowStepEvent containing step name, duration, tokens, and cost.
The experiment template’s WorkflowAgentInvoker and WorkflowInvoker<S> wire this automatically β€” no manual setup needed in consumer projects.

What It Captures

Events are stored as an append-only events.jsonl log per run:
The sealed JournalEvent hierarchy includes:
  • LLMCallEvent β€” tokens, cost, duration, provider, model
  • ToolCallEvent β€” tool name, arguments, result, duration
  • StateChangeEvent β€” from/to states in the 9-state taxonomy
  • MetricEvent β€” counters, timers, gauges with dimensional tags
  • GitEvent β€” commit, diff, branch operations
  • CustomEvent β€” application-defined events
  • FeedbackEvent β€” human reviewer feedback

Why It Matters

Without structured traces, agent behavior is a black box. Agent Journal transforms agent runs into analyzable data β€” enabling Markov fingerprinting, loop detection, and cross-variant behavioral comparison.

Feeds Into

Source

GitHub

Source code (BSL 1.1) β€” three modules, 482 tests