Add InformationNode for conversational memory#9
Open
shreyasrajesh0308 wants to merge 6 commits into
Open
Conversation
Introduces InformationNode (entity clique + QA pairs grounded in communicated information) alongside existing VerbPhraseNode. Extends Question with optional speaker_id and evidence_turn_ids. Updates GSWStructure with information_nodes field and management methods (add, get, search, merge, copy, connectivity). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Stage 1: Identify discrete information units from conversation sessions. Stage 2: Extract entities + generate hybrid QA pairs (basics + model-generated) per information unit. Designed for conversational memory where verb-phrase anchoring produces unusable QA pairs. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Handles information nodes in _prepare_new_gsw (ID remapping, entity mention updates), branches in reconcile() for information_nodes vs verb_phrase_nodes, and adds _update_information_node_answers + _add_information_nodes helpers. InformationNodes are never merged across sessions — only entity references get reconciled. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Root cause: Stage 2 included <full_session> which caused the LLM to extract entities from the entire conversation instead of just the info unit's source turns. This led to entity ID cross-contamination across info units. Changes: - Remove <full_session> from Stage 2 prompt - Add <known_entities> block for within-session ID reuse - Add explicit scoping rules in system prompt - Require TEXT: prefix for all non-entity answers - Clarify ID collision avoidance for new entities Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
shreyasrajesh0308
force-pushed
the
feature/conversational-information-nodes
branch
from
March 17, 2026 00:30
bfcb49a to
b85679d
Compare
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
- Reframe Stage 2 as situation-guided: the information unit description defines scope, source turns are just evidence. Entities and QA pairs are only extracted if relevant to the described situation. - Add Task 3 (Spatio-Temporal Grounding): LLM resolves relative time references against session timestamp and extracts location. - Add session_timestamp template variable to Stage 2 prompt. - Add location field to InformationNode model. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
InformationNodeandEntityMentionmodels alongside existingVerbPhraseNode(backwards compatible)Questionwith optionalspeaker_idandevidence_turn_idsfieldsCONVERSATIONALprompt type with two-stage extraction prompts (Stage 1: info unit identification, Stage 2: entity + QA pair extraction)Test plan
ruff check src/passesruff format --check src/passes🤖 Generated with Claude Code