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

Function RunMemoryRecallWithConfig

agent/memory_recall.go:52–81  ·  view source on GitHub ↗
(ctx context.Context, cfg config.Config, state *AgentState, query string, clientFactory MemoryClientFactory, recentTools []string)

Source from the content-addressed store, hash-verified

50 return []MemoryRecall{{
51 Filename: "memory-fabric", Content: content, RecallID: "memory-fabric", RecallIDs: ids,
52 }}
53}
54
55func formatFabricSearchResult(result memory.SearchResult, referenceTime time.Time) (string, []string) {
56 var output strings.Builder
57 fmt.Fprintf(&output, "Reference time: %s\n", referenceTime.UTC().Format(time.RFC3339))
58 fmt.Fprintf(&output, "Local memory route: %s.\n", strings.Join(result.Route, ", "))
59 ids := make([]string, 0, len(result.Evidence))
60 if len(result.Evidence) > 0 {
61 output.WriteString("\nEvidence:\n")
62 }
63 for index, evidence := range result.Evidence {
64 id := strings.TrimSpace(evidence.ResourceID)
65 if id == "" {
66 id = strings.TrimSpace(evidence.ID)
67 }
68 ids = append(ids, id)
69 ids = append(ids, evidence.SourceEventIDs...)
70 fmt.Fprintf(&output, "[%d] id=%s kind=%s", index+1, id, evidence.ResourceKind)
71 if !evidence.OccurredAt.IsZero() {
72 fmt.Fprintf(&output, " time=%s", evidence.OccurredAt.UTC().Format(time.RFC3339))
73 }
74 if evidence.ContextID != "" {
75 fmt.Fprintf(&output, " context=%s", evidence.ContextID)
76 }
77 if evidence.Actor != "" {
78 fmt.Fprintf(&output, " actor=%s", evidence.Actor)
79 }
80 if evidence.Status != "" {
81 fmt.Fprintf(&output, " status=%s", evidence.Status)
82 }
83 if evidence.SlotID != "" {
84 fmt.Fprintf(&output, " slot=%s", evidence.SlotID)

Calls 4

RecalledMemoryIDsFunction · 0.92
RecallMemoriesForQueryFunction · 0.92
AddMethod · 0.80