MCPcopy Create free account
hub / github.com/github/awesome-copilot / main

Function main

skills/mini-context-graph/scripts/template_agent_workflow.py:168–194  ·  view source on GitHub ↗

Demo: ingest a document, then query the graph.

()

Source from the content-addressed store, hash-verified

166
167
168def main():
169 """Demo: ingest a document, then query the graph."""
170 skill = ContextGraphSkill()
171
172 # ===== INGESTION =====
173 document = """
174 System crashes due to memory leaks.
175 Memory leaks occur when objects are not released.
176 """
177
178 result = ingest_document(skill, document)
179 print(f"\n[INGEST RESULT] Nodes added: {result['nodes_added']}, " f"Edges added: {result['edges_added']}")
180 if result["errors"]:
181 print(f"Errors: {result['errors']}")
182
183 # ===== RETRIEVAL =====
184 queries = [
185 "Why does the system crash?",
186 "What causes memory leaks?",
187 ]
188
189 for query in queries:
190 result = query_graph(skill, query)
191 if result["success"]:
192 print(f" Nodes found: {result['nodes_found']}, Edges found: {result['edges_found']}")
193 else:
194 print(f" Error: {result['error']}")
195
196
197if __name__ == "__main__":

Callers 1

Calls 3

ContextGraphSkillClass · 0.90
ingest_documentFunction · 0.85
query_graphFunction · 0.85

Tested by

no test coverage detected