Skip to content

Conversation

@ClaireBookworm
Copy link
Contributor

small fix, prompts/agent info to tell it to pay attention to graph_knowledge timestamps and receive the data

@ClaireBookworm ClaireBookworm requested a review from a team January 23, 2026 20:05
@greptile-apps
Copy link

greptile-apps bot commented Jan 23, 2026

Greptile Overview

Greptile Summary

This PR enhances the temporal memory system by adding timestamp information to entity data. The changes enable the VLM agent to answer questions about when entities appeared, disappeared, or how long they were visible.

Key changes:

  • Added entity_timestamps array to graph_context containing first_seen_ts, last_seen_ts, and calculated duration_s for each entity
  • Updated query prompt to instruct the agent on how to use timestamp data for duration-based questions
  • One minor issue: unused time import added to graph_utils.py

The implementation correctly retrieves timestamp data from the entity database and properly calculates duration. The prompt documentation is clear and helpful for the agent.

Confidence Score: 4/5

  • This PR is safe to merge with only a minor style issue
  • The changes are straightforward and well-implemented. The logic for extracting and calculating entity timestamps is correct, and the prompt updates are clear. The only issue is an unused import which doesn't affect functionality.
  • No files require special attention

Important Files Changed

Filename Overview
dimos/perception/experimental/temporal_memory/temporal_utils/graph_utils.py Added entity timestamp tracking (entity_timestamps) for temporal queries; unused time import added
dimos/perception/experimental/temporal_memory/temporal_utils/prompts.py Updated query prompt instructions to explain entity_timestamps field and how to use it for duration queries

Sequence Diagram

sequenceDiagram
    participant User
    participant TemporalMemory
    participant GraphUtils
    participant GraphDB
    participant VLM

    User->>TemporalMemory: query(question, latest_frame)
    TemporalMemory->>GraphUtils: build_graph_context(graph_db, entity_ids)
    
    Note over GraphUtils: NEW: Build entity_timestamps array
    
    loop For each entity_id
        GraphUtils->>GraphDB: get_entity(entity_id)
        GraphDB-->>GraphUtils: entity data (first_seen_ts, last_seen_ts)
        GraphUtils->>GraphUtils: Calculate duration_s = last_seen_ts - first_seen_ts
        GraphUtils->>GraphUtils: Append to entity_timestamps[]
    end
    
    loop For each entity_id (existing logic)
        GraphUtils->>GraphDB: get_relations_for_entity()
        GraphDB-->>GraphUtils: relationships
        GraphUtils->>GraphDB: get_nearby_entities()
        GraphDB-->>GraphUtils: spatial info
        GraphUtils->>GraphDB: get_semantic_relations()
        GraphDB-->>GraphUtils: semantic knowledge
    end
    
    GraphUtils-->>TemporalMemory: graph_context (with entity_timestamps)
    TemporalMemory->>GraphUtils: build_query_prompt(question, context)
    
    Note over GraphUtils: NEW: Prompt includes instructions<br/>about entity_timestamps field
    
    GraphUtils-->>TemporalMemory: prompt (with timestamp guidance)
    TemporalMemory->>VLM: query(latest_frame, prompt)
    VLM-->>TemporalMemory: answer (can now use timestamp data)
    TemporalMemory-->>User: answer
Loading

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 file reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

…raph_utils.py

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
@spomichter spomichter merged commit de09b83 into dev Jan 23, 2026
26 of 27 checks passed
@spomichter spomichter deleted the temporal_ts_fix branch January 23, 2026 21:09
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.

3 participants