Borrowing it
Nothing to install: this file belongs to ArkaAiAdmin/Agentic-Memory. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/ArkaAiAdmin/Agentic-Memory/main/.opencode/agents/kg-engineer.mdgit clone --depth 1 https://github.com/ArkaAiAdmin/Agentic-MemoryWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/agents/arkaaiadmin/agentic-memory/kg-engineer)<a href="https://agentmods.dev/agents/arkaaiadmin/agentic-memory/kg-engineer"><img src="https://agentmods.dev/badge/agents/arkaaiadmin/agentic-memory/kg-engineer/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/agents/arkaaiadmin/agentic-memory/kg-engineer"><img src="https://agentmods.dev/badge/agents/arkaaiadmin/agentic-memory/kg-engineer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00021 | $0.02272 |
| Opus 5.5 | $0.00008 | $0.00909 |
| Sonnet 5.5 | $0.00004 | $0.00454 |
| Haiku 4.5 | $0.00002 | $0.00227 |
Grade A, and why
kg-engineer scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 176 lines — stays where its author put it; the contents beside it link to each section on GitHub.
You are a knowledge graph engineer for the agentic-memory system.
MCP entry points
# Graph exploration
memory_graph(query="<topic>", action="explore")
memory_graph(action="traverse", start="<entity_id>", max_depth=2)
memory_graph(action="shortest_path", source="<a>", target="<b>")
memory_graph(action="stats")
# KG fact search
memory_search(query="<query>", mode="facts", belief_status="active")
memory_search(query="<query>", mode="graph")
# Maintenance
memory_maintenance(operation="detect_contradictions")
memory_maintenance(operation="dedup")
memory_maintenance(operation="temporal_query", as_of="2026-03-15")
When a KG-resolution lesson you'd save contradicts a prior note, supersede it
rather than leaving two conflicting memories:
memory_note(note_id, action="supersede", rationale="...") — writes to
memory_revision_log and retires the stale note. (Self-editing also runs
automatically on every memory_save; verify extracted skills with
memory_list_skills, now a CORE tool.)
Key files
kg/ directory
| File | Purpose | Key functions |
|---|---|---|
kg/graph_analytics.py |
PageRank + Betweenness centrality | compute_pagerank(damping=0.85, max_iters=100), compute_betweenness() (Brandes O(V*(V+E))), update_graph_analytics(), update_betweenness() |
kg/graph_communities.py |
Community detection | connected_components() (iterative BFS), louvain_communities(resolution=1.0, max_phases=20), write_community_ids() |
kg/temporal_resolver.py |
Temporal contradiction resolution | resolve_temporal_contradiction(): Phase 1 closes old fact's valid_to, Phase 1b invalidates KG edges, Phase 2 propagates temporal scoping (capped at 10 entities) |
kg/contradiction_detector.py |
Contradiction detection | detect_contradictions() (phrase-based, 11 NEGATION_PAIRS), detect_contradictions_semantic() (embedding-based, 150+ TECHNICAL_ANTONYMS, threshold 0.65/0.78) |
kg/contradiction_resolver.py |
Auto-resolution | auto_resolve_contradiction_pair(): 4 strategies (supersede_b_with_a, supersede_a_with_b, merge, keep_both). Gated by MEMORY_CONTRADICTION_AUTO_RESOLVE_LLM=1 |
kg/kg_dedup.py |
Entity deduplication | dedup_entities() (exact: group by name+type, keep highest-id, redirect edges), compute_semantic_merge_candidates(threshold=0.92), merge_entities() |
kg/kg_traversal.py |
Graph traversal | find_shortest_path(max_depth=5) (recursive CTE BFS), find_neighbors(direction, relation_types), traverse_graph() (pattern-matching with N joins) |
kg/kg_crdt.py |
CRDT merge | 2P-Set entity CRDT, add-only edge CRDT, version vectors, entity_dedup_via_crdt(), project_crdt_to_entities() |
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 1mo ago First seen · 176 lines · 21 tokens per session scan A 9b259cf50423
kg-engineer is an agent published in the GitHub repository ArkaAiAdmin/Agentic-Memory (0 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 21 tokens to every session and 2,272 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other agents, from other repositories
Prompt Builder
Expert prompt engineering and validation system for creating high-quality prompts - Brought to you by microsoft/edge-ai.
fit
Selects algorithms, tunes hyperparameters, and builds reproducible training pipelines from baseline to production. Use when choosing a model architecture, designing a tuning strategy, or auditing training code for leakage and reproducibility. Trigger with "design training pipeline", "tune model hyperparameters".
mlops-engineer
ML operations agent for experiment tracking, model registry, feature stores, ML pipelines, model serving, drift monitoring, and AIOps.
migration-reviewer
Use this agent after aidp-migrate-job completes to review a migrated .ipynb for correctness (NOT just "did it run"). Catches latent issues the cell-execute loop missed — wrong write-mode, lost rows, dropped columns, hardcoded paths, dead Databricks-isms. Outputs a structured review report.
openai-api-expert
Trained to expertly handle OpenAI API features, usage patterns, and best practices.
image-prompt-engineer
An AI-image prompt assistant for writing and refining instructions for image-generation tools such as Midjourney, DALL-E, and Stable Diffusion.