Skip to content

Session.ContextReady stores full LLM context inline on every turn #199

@rita-aga

Description

@rita-aga

Problem

Session.ContextReady events store the full prepared_context_inline_json (the complete messages array sent to the LLM) in the event payload on every turn. A 200-turn session emits 200 ContextReady events, each ~50-70KB.

Evidence (Katagami pipeline, 5-query run, 112 sessions)

  • ContextReady events: 300MB of a 491MB database (61%)
  • Same data also exists in SessionEntry events (15MB) and ots_trajectories (5MB) — triple-stored
  • 4,432 events use inline JSON; only 6 use prepared_context_file_id reference

Impact

Per-session storage: ~3MB average, dominated by redundant context copies. 14 design languages produced 491MB of data. The per-turn inline context is the primary storage driver.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingstorageStorage and database concerns

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions