Skip to main content
Polls pk.sessionProvenance() and displays a live feed of recorded actions with a timeline UI. Ideal for chat apps and multi-step AI workflows where you want users to see provenance building in real time.

What the preview shows

The tracker is loaded with a 6-step AI research workflow session:
StepTypePerformerDescription
Upload sourcescreateSarah Kim (human)Source documents uploaded
SynthesisetransformResearch Assistant (AI · Claude Opus 4.6)Extracts key facts from sources
Draft summarycreateResearch Assistant (AI · Claude Opus 4.6)Writes the initial report draft
Generate chartcreateResearch Assistant (AI · GPT-4o)Produces a supporting data chart
RevisetransformSarah Kim (human)Human edits and refinements
FinaliseverifyResearch Assistant (AI · Claude Opus 4.6)Combines and verifies the final report
Each action item shows:
  • Action type chip (create / transform / verify)
  • Latest badge on the most recent action
  • AI tool badge (violet) when ext:ai@1.0.0 is present
  • Verified badge (green) when ext:verification@1.0.0 status is "verified"
  • Relative timestamp
The session header shows live stats: total actions, resources, and entities recorded.

Props

PropTypeDefaultDescription
sessionIdstringSession ID to poll
pollIntervalnumber3000Polling interval in milliseconds
sessionSessionProvenanceHeadless mode — pass session directly
maxActionsnumber20Maximum number of actions to display
onNewAction(action: Action) => voidCalled when a new action is detected
classNamestringAdditional CSS class

Common pattern — chat apps

// Start a session when the conversation begins
const session = await pk.startSession({ label: "user-chat-123" });

// After each AI response, record an action
await pk.record({
  action: {
    type: "create",
    performedBy: "your-ai-entity-id",
    extensions: {
      "ext:ai@1.0.0": {
        provider: "anthropic",
        model: "claude-opus-4-6",
        autonomyLevel: "assistive",
        tokensUsed: response.usage.totalTokens,
      },
    },
  },
  sessionId: session.sessionId,
});

// Show the live feed in the UI
<ProvenanceTracker
  sessionId={session.sessionId}
  pollInterval={2000}
/>