Skip to content

Roadmap: session topology and resume intelligence #3

@lupuletic

Description

@lupuletic

Problem

Developers using AI coding agents increasingly hit continuity failures: a new session, compaction, crash, or provider switch loses the useful trail of what changed, why it changed, what failed, and where to resume. Plain transcript search helps, but it does not preserve the workflow topology behind a session.

Community pain points this should address:

  • Re-explaining project context, logs, files, and prior decisions after context loss.
  • Losing failed attempts and repeating the same debugging paths.
  • Not knowing the last stable point before an agent broke a project.
  • Difficulty resuming work across Claude Code, Codex, Cursor, or other agent transcripts.
  • Needing external memory files because agent memory is either absent, too broad, or not evidence-linked.

Relevant public signal:

Proposal

Add a deterministic session topology layer and use it to power timeline, resume, and evidence-first AI features.

Start with transcript topology that is true from the source data, not an inferred LLM knowledge graph:

  • Normalize every session into ordered events.
  • Preserve message, tool call, tool result, command, file, test, error, decision, and resume-point structure.
  • Add typed edges between events so code-recall can answer causality questions, not only similarity questions.
  • Keep sqlite-vec for high-signal event bundles rather than embedding every raw message as the primary search unit.

Suggested data model

Add a session_events table along these lines:

event_id TEXT PRIMARY KEY,
session_id TEXT NOT NULL,
provider TEXT NOT NULL,
ordinal INTEGER NOT NULL,
timestamp TEXT,
role TEXT,
event_type TEXT NOT NULL,
text TEXT,
tool_name TEXT,
command TEXT,
file_path TEXT,
status TEXT,
parent_event_id TEXT

Useful event_type values:

  • user_message
  • assistant_message
  • tool_call
  • tool_result
  • file_action
  • command
  • test_result
  • error
  • decision
  • resume_point

Edges to support:

  • session -> event
  • event -> next_event
  • assistant_message -> tool_call
  • tool_call -> tool_result
  • tool_call -> file
  • tool_call -> command
  • tool_result -> error_signature
  • session -> decision
  • session -> resume_point

Product surface

Potential user-facing features:

  • Timeline tab for a selected session.
  • Resume brief: “what changed, what failed, what should I verify next?”
  • Search prefixes: decision:, error:, test:, tool:, resume:.
  • AI chat answers with citations to specific events/tool calls instead of only broad chunks.
  • Cross-provider work threads that connect Claude/Codex sessions touching the same files, commands, branches, errors, or decisions.

Phased implementation

  1. Add schema and migrations for session_events, event FTS, and typed event edges.
  2. Parse Claude Code and Codex transcripts into normalized timelines while preserving the existing session/chunk index.
  3. Index high-signal event bundles into sqlite-vec: decisions, errors, tests, tool-call bundles, and resume summaries.
  4. Add searcher support for event-aware prefixes and result evidence.
  5. Add a TUI Timeline tab for selected result/session.
  6. Add an AI Resume action that uses event citations and bounded evidence.
  7. Later: consider optional semantic entity extraction for stable entities only, such as services, libraries, APIs, tickets, recurring errors, or architecture decisions.

Non-goals for the first pass

  • Do not embed every raw message as the main retrieval unit.
  • Do not build a fully LLM-inferred semantic knowledge graph before the deterministic timeline exists.
  • Do not add an external vector database unless sqlite-vec becomes a measured bottleneck.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions