Skip to content

context-graph: message actions carry their plain text - #421

Merged
antejavor merged 1 commit into
mainfrom
feat/415-message-text
Oct 5, 2026
Merged

antejavor merged 1 commit into
mainfrom
feat/415-message-text

Conversation

@antejavor

Copy link
Copy Markdown
Contributor

Closes #415. Part of map #390; the first ticket of the read path (#415 → #416 → #417 → #418).

What

  • actions-graph: record_action writes a plain text property on user and assistant messages.
    • String content is stored as is; content blocks contribute their joined text blocks.
    • System messages, tool calls, tool results and empty messages get no text.
    • Turn text otherwise lives only inside the JSON string Action.properties, which Cypher can't unpack. The full-text index and the vector index from Where embeddings live, and what gets embedded #393 both need a plain property.
  • Eval, text_search.ensure_turn_text_index: no longer reads content out in Python and writes a.text back. It counts the turns that carry text, creates the index, and runs a probe search.
  • Eval, retrieval.py (graph-agent schema describer): text is never sampled. Messages now carry text from creation, so on a small graph, short turns looked enumerable and leaked into the prompt (test_schema_never_leaks_the_content_being_asked_about). Real eval graphs have long turns and never hit this. The frozen graph-agent baseline would see one more property in its schema.

Tests

All suites ran against a real Memgraph:

Suite Result
actions-graph 55 passed; new: test_only_turns_carry_plain_text, test_an_empty_message_has_no_text
eval 280 passed, 5 skipped (API key)
sessions-graph 71 passed, 1 skipped

actions-graph writes a plain `text` property on user and assistant
messages when it records them: string content as is, content blocks as
their joined text blocks. System messages, tool traffic and empty
messages get none. Turn text otherwise lives only inside the JSON string
`Action.properties`, which Cypher can't unpack, and both the full-text
index and the coming vector index (#393) need a plain property.

The eval's ensure_turn_text_index no longer materializes `text` in
Python; it counts, indexes and probes. The graph-agent schema describer
now never samples `text`: with messages carrying it from creation, a
small graph's short turns read as enumerable and leaked into the prompt.

Closes #415.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

actions-graph: write plain text on message actions

1 participant