Graph: Context building

t-517·WorkTask·
·
·
Created3 weeks ago·Updated3 weeks ago

Dependencies

Description

Edit

Implement context building from graph position.

Functions

  • buildContext :: Graph -> UserId -> NodeId -> IO Context
  • formatContext :: Context -> Text
  • truncateWithSummary :: Graph -> [Node] -> Int -> IO [Node]
  • summarizeBranch :: Graph -> NodeId -> IO Text
  • createSummary :: Graph -> NodeId -> IO NodeId

Logic

1. Walk path to root 2. If path > 20 nodes, truncate with summary 3. If multiple parents (join), summarize other branches 4. Query memory for relevant context 5. Format as prompt text

File

Omni/Agent/Graph/Context.hs

Dependencies

  • Needs Omni/Agent/Memory.hs for memory lookup
  • Needs LLM call for summarization

Timeline (2)

🔄[human]Open → InProgress3 weeks ago
🔄[human]InProgress → Done3 weeks ago