MCPcopy Create free account
hub / github.com/GongShichen/LuminaCode / InjectMemoryIndexContext

Function InjectMemoryIndexContext

agent/message_injection.go:19–27  ·  view source on GitHub ↗
(state *AgentState, memoryDir string)

Source from the content-addressed store, hash-verified

17 }
18}
19
20func InsertBeforeCurrentUserMessage(state *AgentState, message map[string]any) {
21 if state == nil {
22 return
23 }
24 idx := len(state.Messages)
25 for i := len(state.Messages) - 1; i >= 0; i-- {
26 candidate := state.Messages[i]
27 if stringFromAny(candidate["role"]) != "user" {
28 continue
29 }
30 if isToolResultCarrierMessage(candidate) {

Calls 2

BuildMemoryIndexMessageFunction · 0.92