session commit recursively summarizes messages.jsonl via generic file summary
Summary
During session commit, OpenViking recursively enqueues the session temp directory into SemanticQueue, which causes messages.jsonl (the archived session transcript) to be summarized via the generic file-summary prompt and sent to the configured VLM (ov-llm).
From a production usage perspective, this looks wasteful and low-value:
- it re-sends large chunks of already-known chat history to the model,
- increases token cost and latency,
- adds load to
ov-llm, - and does not seem to provide meaningful additional retrieval value for
messages.jsonlspecifically.
What I observed
The current flow appears to be:
session.commit()archives current messages.- It enqueues
session / user / agenttemp trees intoSemanticQueuewithrecursive=True. SemanticProcessorwalks files and summarizes them.messages.jsonlis treated as a generic text file and goes throughsemantic.file_summary.- The resulting prompt is literally:
Please generate a summary for the following file:
【File Name】
messages.jsonl
【File Content】
...
At runtime this produced repeated ov-llm requests containing historical session transcript content from messages.jsonl.
Why this seems problematic
messages.jsonl is not a normal user document. It is already the canonical session transcript / archive. Summarizing it again as a generic file seems to duplicate work already covered by:
- session structured summary / compression,
- memory extraction,
- and directory-level semantic generation.
So the current behavior feels like a side effect of the generic recursive semantic pipeline, rather than an intentional high-value feature for session archives.
Question
Is this behavior intentional?
If yes, what retrieval / indexing benefit is expected from generating a generic file summary for messages.jsonl after every commit?
Suggestion
Possible options:
- skip
messages.jsonlin semantic file-summary generation, - or special-case session archive files so they do not go through generic file summarization,
- or make this behavior configurable.
I think this would reduce unnecessary VLM traffic and make session commit cheaper / faster in production.
Thanks for the report. Traced through the code and confirmed the issue.
Root cause: session.commit() enqueues the session temp directory into SemanticQueue with recursive=True. SemanticDagExecutor processes all files uniformly, so messages.jsonl goes through two steps:
- VLM file summary — serves as intermediate input for generating the archive directory's
.overview.md/.abstract.md. This step is necessary. - Vectorization — after file summary,
_file_summary_taskcalls_vectorize_single_file()to embedmessages.jsonlindividually. This step is redundant.
messages.jsonl is the raw session transcript and doesn't need to be vectorized on its own. Valuable content is already extracted as memories into user/agent directories and vectorized there independently.
Fix direction: Skip vectorization for messages.jsonl in _file_summary_task, while keeping the file summary generation (needed as input for directory overview).
I traced this to SemanticDagExecutor._file_summary_task() in openviking/storage/queuefs/semantic_dag.py.
Current behavior vectorizes every file after summary generation, which means messages.jsonl inside session archives gets embedded as a standalone file even though its summary is mainly needed as input for the archive/directory overview. That makes the transcript get indexed twice in practice: once through the archive-level semantic node and again as a raw file.
I tested a narrow fix direction: keep summary generation for messages.jsonl, but skip standalone file vectorization only when the parent URI is under viking://session/.... Directory-level overview/vectorization stays unchanged, and normal files in the same archive still vectorize normally.
I also added a focused regression test for:
- archive directory still vectorized
- regular files still vectorized
messages.jsonlnot vectorized as a standalone file
Local isolated test passed.