MCPcopy
hub / github.com/rohitg00/agentmemory / buildGraphExtractionPrompt

Function buildGraphExtractionPrompt

src/prompts/graph-extraction.ts:19–35  ·  view source on GitHub ↗
(
  observations: Array<{
    title: string;
    narrative: string;
    concepts: string[];
    files: string[];
    type: string;
  }>,
)

Source from the content-addressed store, hash-verified

17- If no entities found, output empty tags`;
18
19export function buildGraphExtractionPrompt(
20 observations: Array<{
21 title: string;
22 narrative: string;
23 concepts: string[];
24 files: string[];
25 type: string;
26 }>,
27): string {
28 const items = observations
29 .map(
30 (o, i) =>
31 `[${i + 1}] Type: ${o.type}\nTitle: ${o.title}\nNarrative: ${o.narrative}\nConcepts: ${(o.concepts ?? []).join(", ")}\nFiles: ${(o.files ?? []).join(", ")}`,
32 )
33 .join("\n\n");
34 return `Extract entities and relationships from these observations:\n\n${items}`;
35}

Callers 1

registerGraphFunctionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected