<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: AlexMikhalev</title>
    <description>The latest articles on DEV Community by AlexMikhalev (@alexmikhalev).</description>
    <link>https://dev.to/alexmikhalev</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F615498%2F1d6840a1-b457-4a78-a93a-1fa431bfc53c.png</url>
      <title>DEV Community: AlexMikhalev</title>
      <link>https://dev.to/alexmikhalev</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/alexmikhalev"/>
    <language>en</language>
    <item>
      <title>From AI Risk to Accountable Agents</title>
      <dc:creator>AlexMikhalev</dc:creator>
      <pubDate>Sat, 07 Nov 2026 18:04:13 +0000</pubDate>
      <link>https://dev.to/alexmikhalev/from-ai-risk-to-accountable-agents-5bd6</link>
      <guid>https://dev.to/alexmikhalev/from-ai-risk-to-accountable-agents-5bd6</guid>
      <description>&lt;p&gt;In &lt;a href="https://www.linkedin.com/pulse/ai-risk-evolving-every-day-david-hunt-ziqbe/" rel="noopener noreferrer"&gt;AI Risk is evolving, every day.&lt;/a&gt;, David Hunt and I examined how an AI agent can pursue a legitimate objective through methods outside its mandate. Oversight needs to connect organisational intent, knowledge, authority, actions and consequences.&lt;/p&gt;

&lt;p&gt;This article summarises &lt;a href="https://reference-architecture.ai/posts/organisational-roles-as-agent-contracts/" rel="noopener noreferrer"&gt;the full paper&lt;/a&gt;. To supervise that agent, we need to specify its responsibilities, the concepts it uses, the evidence its work requires and the actions it may take.&lt;/p&gt;

&lt;h2&gt;
  
  
  Start with an organisational role
&lt;/h2&gt;

&lt;p&gt;“Planning agent” tells us what an agent does, but leaves its responsibility unclear.&lt;/p&gt;

&lt;p&gt;A Product Manager breaks outcomes into features and acceptance criteria. A Project Manager turns agreed scope into a delivery plan with dependencies, owners and milestones. Both perform planning, but their work products and authority differ.&lt;/p&gt;

&lt;p&gt;An agent's planning capability should belong to a defined organisational role. Its implementation provides services that use tools to perform specific actions.&lt;/p&gt;

&lt;p&gt;The chain becomes:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Organisation → role → capability → service → tool → action → contextual permission.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A Project Manager agent might select an approved planning template and create a draft in its assigned project. That assignment does not authorise production deployment. The permission decision must govern the actual tool operation, including alternative routes through shells or delegated agents.&lt;/p&gt;

&lt;h2&gt;
  
  
  Give the role a defined conceptual space
&lt;/h2&gt;

&lt;p&gt;Each role needs a governed view of organisational knowledge. A Product Manager works with user needs, value hypotheses and acceptance criteria. A Project Manager needs dependencies, resources, risks and delivery commitments. Shared concepts connect their work without making the roles interchangeable.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fmtfa59fmtyhivcionmb3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fmtfa59fmtyhivcionmb3.png" alt="Role-based knowledge graphs connect organisational responsibilities to capabilities, services and tool actions. In the proposed architecture, the Project Manager may create a plan draft but cannot deploy to production." width="800" height="565"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Figure 1. Proposed role contract: the knowledge needed to plan and the authority to act are explicit.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Terraphim's role-based knowledge graphs make this vocabulary explicit through concepts and synonyms. The inspected indexer connects consecutive recognised concepts in document text, retaining supporting document references. Those associations help retrieve relevant notes and explain why they were selected.&lt;/p&gt;

&lt;p&gt;The next layer is to type the relationships. A connection might mean “depends on”, “addresses a requirement” or “requires approval”. The role selects the applicable relationship profile from approved templates, traced to adopted standards or documented organisational extensions.&lt;/p&gt;

&lt;p&gt;A sentence mentioning a release, a manager and approval does not establish that approval occurred. &lt;strong&gt;“Requires approval” and “was approved” are different claims.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Verify meaning in its context
&lt;/h2&gt;

&lt;p&gt;A checklist can recognise every expected concept while missing a change in meaning.&lt;/p&gt;

&lt;p&gt;Suppose a delivery plan must place a rollback rehearsal in staging, with its planned start within eight elapsed hours of a defined failure trigger. An output can contain “rollback”, “rehearsal” and “hours” while moving the activity to production or replacing elapsed hours with business days.&lt;/p&gt;

&lt;p&gt;Successful checking therefore requires compatible concepts, relationships and context across the input, output and criteria. Different terminology can be acceptable through an explicit mapping. Changed scope, units, conditions or prohibitions cannot pass silently.&lt;/p&gt;

&lt;p&gt;Our paper uses &lt;a href="https://www.iso.org/standard/74393.html" rel="noopener noreferrer"&gt;ISO/IEC/IEEE 42010:2022&lt;/a&gt; to frame architecture descriptions and &lt;a href="https://www.iso.org/standard/72089.html" rel="noopener noreferrer"&gt;ISO/IEC/IEEE 29148:2018&lt;/a&gt; to distinguish requirements quality and stakeholder intent from evidence about the realised system. This is a standards-informed design, not a conformity claim.&lt;/p&gt;

&lt;p&gt;The practical requirement is traceability: identify the requirement version, relevant context, applicable criterion and evidence behind each result. When those conditions change, reassess the affected findings. Unknown context should produce an indeterminate result, not an assumed pass.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F0cjd02o8yinrn36hfvkh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F0cjd02o8yinrn36hfvkh.png" alt="Contextual verification compares a proposed plan with the versioned requirement and its concepts, trigger and criteria. Preserved conditions pass this planning criterion, changed conditions fail, and missing evidence leaves the result indeterminate." width="800" height="489"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Figure 2. Proposed contextual check: passing a planning criterion neither proves the rehearsal occurred nor grants deployment authority.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Make the audit concrete
&lt;/h2&gt;

&lt;p&gt;Terraph, the Terraphim language, connects a role graph, a checklist and a gated action in one program. The graph and checklist compile from Markdown into constant matching automata. &lt;code&gt;embed&lt;/code&gt; identifies concepts and source spans; &lt;code&gt;text satisfies preflight&lt;/code&gt; reports which checklist items are missing.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;deploy&lt;/code&gt; verb declares the evidence it needs. Here, &lt;code&gt;engineer&lt;/code&gt; is the example role; it does not change the Project Manager’s authority:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import std;

role engineer from "kg";
checklist preflight from "checklists/preflight.md";

fn deploy(plan: str, ev: Proof&amp;lt;preflight&amp;gt;) -&amp;gt; i64 {
    print("deploy: preflight evidence present, proceeding");
    return 0;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The generated verb wrapper obtains a sealed &lt;code&gt;Proof&amp;lt;preflight&amp;gt;&lt;/code&gt; through &lt;code&gt;.require()&lt;/code&gt; only when no checklist items are missing. The proof binds to the checked snapshot, available as &lt;code&gt;ev.subject&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F3nuvy8xhsk90f3yzgyav.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F3nuvy8xhsk90f3yzgyav.png" alt="Terraph uses compiled role concepts and checklist definitions to check a text snapshot. Findings with missing items cannot yield a proof; findings with no missing items can produce a sealed proof required by the gated verb." width="800" height="541"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Figure 3. The Terraph proof gate. The example body prints a message; it does not deploy a system.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Any actual operation must use that checked snapshot and pass a separate authority check. Reopening the plan could read changed bytes. Passing the checklist cannot give a Project Manager production privileges, nor can concept coverage establish that the plan is correct.&lt;/p&gt;

&lt;p&gt;Our earlier argument calls for supervision that follows an agent's changing context. An inspectable role contract gives that supervision a defined mandate to check. A Project Manager agent can prepare a plan, preserve its requirements and record the evidence, while release authority stays with the role responsible for exercising it.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://reference-architecture.ai/posts/from-ai-risk-to-accountable-agents/" rel="noopener noreferrer"&gt;reference-architecture.ai&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>agents</category>
      <category>architecture</category>
      <category>security</category>
    </item>
    <item>
      <title>Organisational Roles as Contracts for AI Agents</title>
      <dc:creator>AlexMikhalev</dc:creator>
      <pubDate>Sat, 07 Nov 2026 18:03:26 +0000</pubDate>
      <link>https://dev.to/alexmikhalev/organisational-roles-as-contracts-for-ai-agents-4cfa</link>
      <guid>https://dev.to/alexmikhalev/organisational-roles-as-contracts-for-ai-agents-4cfa</guid>
      <description>&lt;h2&gt;
  
  
  Abstract
&lt;/h2&gt;

&lt;p&gt;An organisational AI agent needs defined responsibilities, relevant knowledge and bounded authority. This paper proposes roles as contracts for all three. A Project Manager plans delivery; a Product Manager decomposes product outcomes into features. Each uses a governed role-based knowledge graph. Agent services realise role capabilities through tools whose actions require contextual permission. Verification and validation require compatible concepts, relationships and operating conditions across the input and evaluation criteria, with explicit mappings where views differ. A cross-check against ISO/IEC/IEEE 42010:2022 and 29148:2018 informs these distinctions without claiming conformity. Terraphim provides graph retrieval and checklists; Terraph connects concept matching to proof-gated verbs; ADF configurations define responsibilities and artefact templates. The proposed integration would allow a Project Manager agent to create a checked plan from an approved template while reserving production deployment for a separately authorised role.&lt;/p&gt;

&lt;h2&gt;
  
  
  Continuing the argument on evolving AI risk
&lt;/h2&gt;

&lt;p&gt;This paper continues the argument developed by David Hunt and Alexander Mikhalev in &lt;a href="https://www.linkedin.com/pulse/ai-risk-evolving-every-day-david-hunt-ziqbe/" rel="noopener noreferrer"&gt;AI Risk is evolving, every day.&lt;/a&gt;, published on 31 October 2026. Their starting concern is that an agent can pursue a legitimate objective through unauthorised methods. They connect oversight of business activity with cybersecurity and knowledge integrity, and argue that changes to agents and their surroundings can invalidate earlier assurance.&lt;/p&gt;

&lt;p&gt;Supervision needs an inspectable mandate: the organisational role, the capability being exercised, the service providing it, and the tool action requested against a particular resource. Role-based knowledge graphs provide the relevant concepts and relationships; an independently enforced permission decision determines whether the action may proceed. A Project Manager can prepare a delivery plan using approved templates while production execution remains assigned to a separately authorised role. The sections below distinguish existing components from the integration still required.&lt;/p&gt;

&lt;p&gt;A successful check needs criteria that apply to the input's meaning, obligations and operating context. Matching words cannot establish that a plan preserves a prohibition, uses the correct environment, or retains an acceptance threshold. The semantic compatibility contract developed here connects requirements, criteria and evidence through a versioned baseline and explicit mappings. Changes to that baseline trigger reassessment of affected results. The standards cross-check helps define the responsibilities and evaluation claims; it does not establish that the supervisory system has been implemented.&lt;/p&gt;

&lt;p&gt;The common concepts connect the earlier article's concerns to the mechanisms examined in this paper:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Shared concept&lt;/th&gt;
&lt;th&gt;Engineering continuation in this paper&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Mandate and justified authority&lt;/td&gt;
&lt;td&gt;Trace the assigned role through capability, service, tool and action to a contextual permission decision.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Knowledge integrity and context&lt;/td&gt;
&lt;td&gt;Use governed concept identities, relationships and requirement baselines to preserve meaning across inputs, outputs and criteria.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Independent supervision&lt;/td&gt;
&lt;td&gt;Separate the agent's proposal from the gateway's permission decision and the evidence used to assess its result.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Continued validity of assurance&lt;/td&gt;
&lt;td&gt;Bind findings to the evaluated artefact, criteria and context; reassess affected claims when relevant versions change.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Learning and authority to change&lt;/td&gt;
&lt;td&gt;Govern changes to role graphs, templates and policies separately from permission to perform the task.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Prediction and operational evidence&lt;/td&gt;
&lt;td&gt;Keep illustrative scenarios, expected outcomes and recorded executions distinguishable; validate predictions before relying on them.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Consequences across organisational scales&lt;/td&gt;
&lt;td&gt;Make resource and project scope explicit, and identify where wider consequences require escalation beyond the acting role.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;This mapping is our architectural synthesis. The examples below illustrate individual mechanisms; connecting them across systems remains engineering work.&lt;/p&gt;

&lt;h2&gt;
  
  
  The organisational unit of agency
&lt;/h2&gt;

&lt;p&gt;“Planning agent” describes a computational activity. It does not identify who owns the outcome, which planning conventions apply, or what authority accompanies the work. The same ambiguity affects “research agent”, “review agent” and “execution agent”. These labels can be useful implementation names, but they leave organisational meaning unresolved.&lt;/p&gt;

&lt;p&gt;A Project Manager plans delivery against agreed scope, dependencies, resources and milestones. A Product Manager decomposes desired outcomes into features, evaluates value and defines acceptance criteria. Both plan, but they plan different objects, draw on different evidence, and answer to different accountabilities. An organisation should therefore delegate to an agent acting in a defined role, with planning as one of that role’s capabilities.&lt;/p&gt;

&lt;p&gt;The role contract can remain stable when an agent’s model, prompt, framework or supplier changes. A replacement implementation must demonstrate the required service behaviour and operate within the same authority boundary. Governed role definitions and capability contracts give the organisation a basis for evaluating that replacement.&lt;/p&gt;

&lt;p&gt;The central proposal is a traceable relationship:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Organisation → role → capability → service → tool → action → contextual permission.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This sequence is an explanation path, not an assertion that authority flows automatically through every edge. The organisation assigns responsibilities to roles; an agent principal is separately authorised to enact a role. Its implementation supplies services. Tools make actions technically available. Policy determines whether an exact requested action is permitted in its current context.&lt;/p&gt;

&lt;h2&gt;
  
  
  The organisational semantic layer
&lt;/h2&gt;

&lt;p&gt;The organisational semantic layer describes concepts, relationships, templates, standards and responsibilities using explicit identifiers and versioned definitions. Here, &lt;em&gt;conceptual space&lt;/em&gt; means this governed system of organisational meaning. The proposal does not require a fully implemented geometric model of human conceptual spaces.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Element&lt;/th&gt;
&lt;th&gt;Organisational meaning&lt;/th&gt;
&lt;th&gt;Planning example&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Role&lt;/td&gt;
&lt;td&gt;A position with responsibilities and bounded authority&lt;/td&gt;
&lt;td&gt;Project Manager&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Capability&lt;/td&gt;
&lt;td&gt;An ability the organisation needs to achieve an outcome&lt;/td&gt;
&lt;td&gt;Delivery planning&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Service&lt;/td&gt;
&lt;td&gt;An accessible behaviour provided by an implementation&lt;/td&gt;
&lt;td&gt;Produce a delivery plan&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Agent implementation&lt;/td&gt;
&lt;td&gt;Software that provides the service while enacting an assigned role&lt;/td&gt;
&lt;td&gt;Project planning agent instance&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Tool&lt;/td&gt;
&lt;td&gt;A concrete interface through which work is performed&lt;/td&gt;
&lt;td&gt;Template reader or document writer&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Action&lt;/td&gt;
&lt;td&gt;A specific operation on an identified resource&lt;/td&gt;
&lt;td&gt;Create a draft plan in project workspace&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Permission&lt;/td&gt;
&lt;td&gt;A policy decision over principal, role, action, resource and context&lt;/td&gt;
&lt;td&gt;Draft creation allowed for the assigned project&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Evidence&lt;/td&gt;
&lt;td&gt;Records supporting a decision and its observed result&lt;/td&gt;
&lt;td&gt;Template version, checks and execution receipt&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;This distinction between capabilities and services is compatible with enterprise architecture’s separation of organisational behaviour from its realisation and exposed services. It is used here as an architectural vocabulary, without claiming formal compliance with an ArchiMate model. &lt;a href="https://archimate-community.pages.opengroup.org/workgroups/archimate-101/" rel="noopener noreferrer"&gt;Open Group ArchiMate 101&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A capability describes what the organisation can accomplish. It is not a permission token. Likewise, an implementation’s demonstrated competence does not grant authority. A model may understand deployment instructions while having no right to invoke a deployment endpoint.&lt;/p&gt;

&lt;p&gt;Role capabilities contribute to broader organisational capabilities. For example, an organisation’s &lt;strong&gt;Product Delivery&lt;/strong&gt; capability can depend on &lt;strong&gt;Product Discovery&lt;/strong&gt; performed by the Product Manager, &lt;strong&gt;Delivery Planning&lt;/strong&gt; performed by the Project Manager, and &lt;strong&gt;Release Assurance&lt;/strong&gt; performed by the Release Manager. The graph records these contribution relationships explicitly. Separate agent services realise the role capabilities; their combined performance supports the organisational outcome without granting each service the authority of every contributing role.&lt;/p&gt;

&lt;p&gt;Roles should also be sufficiently specific to support ownership. An organisation can assign a person or agent multiple roles, but each action should use an explicit active role and bounded assignment. Combining role knowledge for a discussion must not silently combine execution privileges.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Role&lt;/th&gt;
&lt;th&gt;Dedicated conceptual view&lt;/th&gt;
&lt;th&gt;Principal service&lt;/th&gt;
&lt;th&gt;Example boundary&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Product Manager&lt;/td&gt;
&lt;td&gt;Outcomes, user needs, features, value hypotheses and acceptance criteria&lt;/td&gt;
&lt;td&gt;Produce an evidence-linked feature breakdown&lt;/td&gt;
&lt;td&gt;Cannot approve production deployment&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Project Manager&lt;/td&gt;
&lt;td&gt;Scope, dependencies, resources, risks and delivery milestones&lt;/td&gt;
&lt;td&gt;Produce a delivery plan from an approved template&lt;/td&gt;
&lt;td&gt;Can write a project draft; cannot deploy it&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Release Manager&lt;/td&gt;
&lt;td&gt;Release readiness, change records, environments and rollback procedures&lt;/td&gt;
&lt;td&gt;Coordinate an authorised release&lt;/td&gt;
&lt;td&gt;Production action requires a separate assignment and satisfied release policy&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;These are example contracts, not universal job descriptions. The organisation owns the actual definitions and decides where responsibilities overlap.&lt;/p&gt;

&lt;h2&gt;
  
  
  Dedicated knowledge without isolated vocabularies
&lt;/h2&gt;

&lt;p&gt;Each role receives a governed projection of organisational knowledge. This can select which concepts and relationships are available to the role, as well as how retrieval ranks them. Roles can share an underlying graph while retaining different conceptual views.&lt;/p&gt;

&lt;p&gt;Shared concepts retain shared identifiers. For example, a feature’s acceptance criteria connect product intent with delivery planning and release verification. Role-specific relationships express what matters for each responsibility: a Product Manager connects a criterion to user value; a Project Manager connects it to delivery evidence and dependencies; a Release Manager connects it to a release decision. The shared identity supports handoffs without making the roles interchangeable.&lt;/p&gt;

&lt;p&gt;Role-owned overlays can define local vocabulary, specialised relationships, approved templates and checklist requirements. Their provenance should identify the owner, source, revision and approval state. Changes to the shared definition of “accepted” require different governance from adding a convenient synonym to a role’s retrieval vocabulary.&lt;/p&gt;

&lt;p&gt;Graph projections must also respect access controls. Knowing that another team’s confidential plan exists does not authorise retrieving its contents. A role graph is a semantic view; a separately authenticated assignment and resource policy determine what information the agent may actually read.&lt;/p&gt;

&lt;p&gt;The graph is the inspectable, or white-box, component of this architecture. A reviewer can examine its concepts and relationships, the embeddings derived from them, and the definitions that shaped retrieval. This visibility neither makes the language model transparent nor establishes that the graph's contents are correct.&lt;/p&gt;

&lt;h2&gt;
  
  
  Architecture description and requirements engineering
&lt;/h2&gt;

&lt;p&gt;ISO/IEC/IEEE 42010:2022 concerns architecture descriptions, including viewpoints and model kinds. It distinguishes an architecture from its description and does not prescribe an agent implementation or execution policy. In that standard, ADF means &lt;em&gt;architecture description framework&lt;/em&gt;; the ADF agent orchestration system discussed here is a different use of the acronym. &lt;a href="https://www.iso.org/standard/74393.html" rel="noopener noreferrer"&gt;ISO/IEC/IEEE 42010:2022&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For this architecture, stakeholder concerns, viewpoint conventions and resulting views must remain distinguishable from organisational roles. A viewpoint establishes conventions for constructing and interpreting views that address concerns. &lt;a href="https://www.iso.org/obp/ui?_escaped_fragment_=iso:std:iso-iec-ieee:24641:ed-1:v1:en" rel="noopener noreferrer"&gt;ISO 24641:2023 preview&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A role can serve several stakeholder concerns and use several viewpoints. A role graph becomes useful architectural material when its concepts, relationships, conventions and intended questions are explicit. It is not automatically a viewpoint; a project plan is not automatically an architecture view. Terraph's language constructs likewise do not establish that it is a conforming architecture description language. The standards do not assign the paper's Project Manager, Product Manager or Release Manager jobs their permissions.&lt;/p&gt;

&lt;p&gt;ISO/IEC/IEEE 29148:2018 addresses requirements engineering and its information across the life cycle. Its terminology distinguishes checks on requirements from checks on the realised product or system. The following four questions must not be collapsed into a single “validation passed” label. &lt;a href="https://www.iso.org/obp/ui?_escaped_fragment_=iso%3Astd%3Aiso-iec-ieee%3A29148%3Aed-2%3Av1%3Aen" rel="noopener noreferrer"&gt;ISO/IEC/IEEE 29148:2018 official preview&lt;/a&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Activity&lt;/th&gt;
&lt;th&gt;Question and object&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Requirements verification&lt;/td&gt;
&lt;td&gt;Are the requirement statements and set well formed?&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Requirements validation&lt;/td&gt;
&lt;td&gt;Do those requirements express the intended stakeholder needs?&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Product or system verification&lt;/td&gt;
&lt;td&gt;Does the realised item fulfil its specified requirements?&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Product or system validation&lt;/td&gt;
&lt;td&gt;Does it support its intended application and use?&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Each decision needs the applicable activity and evidence; an individual tool check need not perform all four. A reviewed input baseline is particularly important: an output checklist cannot retrospectively establish what the stakeholder meant.&lt;/p&gt;

&lt;p&gt;The following crosswalk is this paper's proposed design, not an ISO clause-compliance matrix:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Standards-related distinction&lt;/th&gt;
&lt;th&gt;Application to the proposed agent contract&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Stakeholder concern and viewpoint&lt;/td&gt;
&lt;td&gt;Name the decision owner, concern and representation conventions; bind the agent's organisational assignment separately.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;View and modelling conventions&lt;/td&gt;
&lt;td&gt;Specify graph concept and relationship types, interpretation rules and correspondences between role views.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Requirement and traceability&lt;/td&gt;
&lt;td&gt;Connect each obligation to its need, responsible role, input baseline, criteria, output and evidence.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Verification and validation&lt;/td&gt;
&lt;td&gt;Name the checked object, the predicate or intended-use scenario, its applicable context and the decision supported.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;This is a bounded cross-check using official public material. It is neither certification nor a full-text normative clause audit. The richer semantic contract below is the paper's engineering proposal, not a claim that either standard mandates knowledge graphs or this permission scheme.&lt;/p&gt;

&lt;h2&gt;
  
  
  Semantic compatibility between inputs and criteria
&lt;/h2&gt;

&lt;p&gt;A check is meaningful only if its criteria apply to the relevant meaning and context of its input. “Release” can mean software deployment or approval of a payment; the same token need not denote the same concept. A plan for staging cannot be validated against production assumptions merely because both mention “release”. A criterion about elapsed hours cannot silently become one about business days. Evaluation requires compatible conceptual spaces, not identical wording or complete identity between two role graphs.&lt;/p&gt;

&lt;p&gt;The proposed trace is:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Requirement ID and revision → stakeholder need → responsible role and relevant viewpoints → input concepts, propositions and context baseline → verification criterion and validation scenario → evidence → decision.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The baseline identifies the entity and project, source and requirement revisions, environment, relevant time and calendar, units and thresholds, assumptions, exceptions and prohibited actions. A proposition preserves who must do what to which object, under which conditions, with its polarity and quantifiers. “Every accepted feature” and “some features” can share concepts while imposing different obligations.&lt;/p&gt;

&lt;p&gt;Verification and validation may use different abstractions. A product view can describe a customer outcome while a delivery view describes work packages. Their mapping must explain how the relevant obligation survives decomposition and which evidence supports it. Approved unit conversions and concept mappings may establish compatibility; fuzzy similarity alone cannot. Additional derived criteria can be legitimate when their rationale and relationship to the stakeholder need are recorded. An obligation cannot disappear merely because a role projection omits its vocabulary.&lt;/p&gt;

&lt;p&gt;This paper proposes the following contract. These SHALL statements are authored requirements for the proposed integration, not quotations from ISO:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;A check SHALL identify its object, requirement baseline, applicable criteria and relevant context revisions.&lt;/strong&gt; The requirement owner and authority to resolve ambiguity or change the baseline must be recorded.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A transformation SHALL preserve relevant obligations or carry an explicitly approved mapping or change.&lt;/strong&gt; This includes relationships, polarity, quantifiers, units, thresholds, scope and assumptions, not just concept identifiers.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A decision SHALL distinguish pass, fail, indeterminate and justified not applicable.&lt;/strong&gt; Missing context, unresolved mappings or insufficient evidence cannot yield a pass; not applicable needs a recorded reason and authorised acceptance.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A result SHALL bind to the evaluated state and be reassessed when a relevant change invalidates it.&lt;/strong&gt; Passing semantic or quality checks never substitutes for an action's separate authority decision.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Context compatibility is necessary but insufficient. A perfectly aligned test can still have a weak predicate, unreliable evidence or inadequate coverage. Criteria must themselves be verified and validated for their purpose; their evaluation must establish the promised claim. Checks should report only what their evidence supports.&lt;/p&gt;

&lt;h2&gt;
  
  
  Connecting meaning with authority
&lt;/h2&gt;

&lt;p&gt;The architecture needs four cooperating parts: identity and assignment, semantic knowledge, mediated execution, and audit evidence.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fcwohwh3uo2spsoa2qj37.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fcwohwh3uo2spsoa2qj37.png" alt="Proposed architecture: organisational ownership and authenticated assignment, role knowledge, services, execution gateway, contextual policy, registered actions and decision evidence." width="800" height="627"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Figure 1. Connecting meaning with authority. &lt;a href="https://mermaid.live/edit#base64:eyJjb2RlIjogImZsb3djaGFydCBURFxuICAgIE9bT3JnYW5pc2F0aW9uIGFuZCBhY2NvdW50YWJsZSByb2xlIG93bmVyXSAtLT4gUltWZXJzaW9uZWQgcm9sZSBhbmQgY2FwYWJpbGl0eSBjb250cmFjdF1cbiAgICBJW0F1dGhlbnRpY2F0ZWQgYWdlbnQgcHJpbmNpcGFsXSAtLT4gQVtTY29wZWQgcm9sZSBhc3NpZ25tZW50XVxuICAgIFIgLS0+IEtbUm9sZSBrbm93bGVkZ2UgZ3JhcGggYW5kIGFwcHJvdmVkIHRlbXBsYXRlc11cbiAgICBSIC0tPiBTW0FnZW50IHNlcnZpY2UgY29udHJhY3RdXG4gICAgQSAtLT4gR1tFeGVjdXRpb24gZ2F0ZXdheV1cbiAgICBLIC0tPiBQW0FnZW50IHByZXBhcmVzIGEgcHJvcG9zZWQgYWN0aW9uXVxuICAgIFMgLS0+IFBcbiAgICBQIC0tPiBHXG4gICAgUVtDb250ZXh0dWFsIHBlcm1pc3Npb24gcG9saWN5XSAtLT4gR1xuICAgIEcgLS0+IFRbUmVnaXN0ZXJlZCB0b29sIGFjdGlvbl1cbiAgICBHIC0tPiBFW0RlY2lzaW9uIGFuZCBleGVjdXRpb24gZXZpZGVuY2VdXG4gICAgVCAtLT4gRVxuIiwgIm1lcm1haWQiOiB7InRoZW1lIjogImRlZmF1bHQifX0=" rel="noopener noreferrer"&gt;Open the diagram source in Mermaid Live&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Role-based access control provides a foundation: subjects are assigned authorised roles, and operations are mediated through the permissions of those roles. A session can activate a subset of the roles available to a subject. &lt;a href="https://csrc.nist.gov/Projects/role-based-access-control/faqs" rel="noopener noreferrer"&gt;NIST RBAC&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The proposed architecture adds organisational meaning to this assignment and applies contextual conditions to execution. Project identity, resource scope, environment, approval state and expiry can all matter. This is consistent with attribute-based access control, which evaluates attributes of the subject, object, operation and environment against policy. &lt;a href="https://csrc.nist.gov/pubs/sp/800/162/upd2/final" rel="noopener noreferrer"&gt;NIST SP 800-162&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let a request be &lt;code&gt;q = (principal, role, service, tool, action, resource, arguments, context)&lt;/code&gt;. A simplified decision rule is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;permit(q) =
    authenticated(principal)
    AND active_assignment(principal, role, scope, expiry)
    AND capability_service_binding(role, service)
    AND registered_service_tool_action(service, tool, action)
    AND resource_and_argument_scope_match(q)
    AND required_evidence_valid_for_exact_request(q)
    AND contextual_policy_allows(q)
    AND NOT explicit_deny(q)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;An absent or indeterminate condition produces no permit. This is a proposed contract, not a description of a policy engine already supplied by Terraphim.&lt;/p&gt;

&lt;p&gt;The gateway must mediate actual effects. Hiding a deployment tool in a user interface is insufficient if the same principal can deploy through a shell, network client or overprivileged service credential. The action boundary includes alternative routes, delegated agents and mutable resource references. A delegate receives only an authorised subset of the parent’s scope; it cannot turn a planning request into a production privilege.&lt;/p&gt;

&lt;h2&gt;
  
  
  Terraphim graph embeddings as a role context mechanism
&lt;/h2&gt;

&lt;p&gt;Terraphim’s graph approach supplies a concrete semantic mechanism for the role view. Concepts and surface forms are represented explicitly, and graph relationships support retrieval and explanation. Its documented graph retrieval path uses normalised concepts, synonym matching and document co-occurrence structure, rather than requiring a neural vector embedding model. &lt;a href="https://terraphim.ai/docs/graph-embeddings/" rel="noopener noreferrer"&gt;Terraphim graph embeddings&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The inspected general &lt;code&gt;RoleGraph&lt;/code&gt; implementation uses Aho–Corasick matching to resolve surface forms to concept identifiers. Its document indexer creates edges between consecutive recognised concepts in the indexed text and retains supporting document references. Retrieval then accumulates node, edge and document rank. Matched edges and tags make the retrieval basis inspectable. A high rank indicates retrieval support under that graph, not factual certainty or authority.&lt;/p&gt;

&lt;p&gt;For organisational planning, this allows terms such as “delivery roadmap” and “project plan” to resolve according to the organisation’s chosen vocabulary. The interpretation is role-dependent: a delivery roadmap may emphasise dependencies and milestones for a Project Manager, while a product roadmap emphasises outcomes and prioritisation.&lt;/p&gt;

&lt;p&gt;The organisation should keep equivalence and relationship separate. A synonym maps a surface form to a concept. A relationship links distinct concepts. “Risk log” may be an agreed synonym for “risk register”, but a register and an individual risk remain distinct concepts. “Risk” and “deployment permission” must not become equivalent merely because they occur together in operational documents.&lt;/p&gt;

&lt;p&gt;Graph embeddings make the retrieval context reproducible. A result can identify the recognised concept and supporting relationship evidence, explaining why a planning template or dependency policy was selected. Template currency, the truth of retrieved claims and action authority require separate checks against authoritative metadata, evidence and policy.&lt;/p&gt;

&lt;h3&gt;
  
  
  From co-occurrence to typed organisational relationships
&lt;/h3&gt;

&lt;p&gt;The existing concept vocabulary and the associations found in text play different parts in constructing the role's conceptual space. The role's thesaurus supplies the concepts that can be recognised and the synonyms that resolve to them. Indexing identifies occurrences of those concepts in notes and documents, then constructs connections from the matching text. Retrieval uses that structure to select relevant material. In this path, a connection is discovered between recognised concepts; it does not establish a new concept definition or a new organisational rule.&lt;/p&gt;

&lt;p&gt;Sentence-level co-occurrence provides an intuitive starting assumption: concepts mentioned together may be related. The inspected implementation has a broader boundary. The document indexer takes the matching concept sequence from the indexed document and connects adjacent matches without invoking the available sentence-splitting helper. Associations can therefore cross sentence boundaries. A sentence-bounded association rule would require an explicit indexing change; it is not a current guarantee.&lt;/p&gt;

&lt;p&gt;Even within one sentence, proximity leaves the relationship unspecified. A note can mention a requirement and a test because the test satisfies it, fails it, or has not yet been performed. The association graph cannot decide which statement holds. The proposed semantic layer must establish the connection's meaning, direction and conditions before admitting it as a typed organisational claim.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Layer&lt;/th&gt;
&lt;th&gt;Representation&lt;/th&gt;
&lt;th&gt;What it establishes&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Role vocabulary&lt;/td&gt;
&lt;td&gt;Canonical concepts and approved synonyms&lt;/td&gt;
&lt;td&gt;Which concept a recognised expression denotes within the role's domain.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Text association&lt;/td&gt;
&lt;td&gt;Connections between matched concepts, with document evidence&lt;/td&gt;
&lt;td&gt;Where concepts occur together or in the indexed matching sequence.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Organisational interpretation&lt;/td&gt;
&lt;td&gt;Typed, contextual propositions governed by role templates&lt;/td&gt;
&lt;td&gt;Whether a connection expresses a dependency, responsibility, requirement, evidence claim or other admitted meaning.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Evaluation and execution&lt;/td&gt;
&lt;td&gt;Applicable criteria, evidence checks and permission decisions&lt;/td&gt;
&lt;td&gt;Whether the specific claim is supported and whether the requested action is authorised.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The organisational semantic layer supplies the relationship vocabulary. A role selects an applicable profile of that vocabulary, together with the templates for its work products. A Project Manager's delivery-plan template may admit dependencies between milestones and assignments of responsibility. A Product Manager's feature template may admit derivation from stakeholder needs and links to acceptance criteria. Shared concepts retain their identities across these views; the role determines which governed relationships are relevant, rather than inventing their meanings during each interaction.&lt;/p&gt;

&lt;p&gt;The proposed governance rule is that &lt;strong&gt;every admitted organisational relationship type SHALL be defined in a versioned, approved template or semantic profile, with traceability to the applicable adopted standards or an explicitly approved organisational extension&lt;/strong&gt;. The profile records the standard edition and relevant requirement or definition where applicable. Where a standard leaves a modelling choice open, the organisation records its extension and rationale. This preserves standards-based discipline without asserting that industry standards already name every graph predicate used by an organisation. ISO/IEC/IEEE 42010:2022 and ISO/IEC/IEEE 29148:2018 inform the distinctions discussed earlier; the illustrative predicate names here are not standard-prescribed vocabulary.&lt;/p&gt;

&lt;p&gt;A relation definition needs more than a label. It identifies the permitted source and target concept types, direction, interpretation, applicable role and work product, and required qualifiers such as environment, time, polarity or evidence state. For example, &lt;code&gt;verifies&lt;/code&gt; might connect a verification activity to a requirement, while &lt;code&gt;producedEvidence&lt;/code&gt; connects its execution to a result. A planned test and a completed test cannot be substituted merely because both connect to the same requirement.&lt;/p&gt;

&lt;p&gt;Consider the sentence: “The Release Manager must approve production deployment after verification.” An association graph can connect the recognised concepts &lt;em&gt;Release Manager&lt;/em&gt;, &lt;em&gt;production deployment&lt;/em&gt; and &lt;em&gt;verification&lt;/em&gt;. In a governed release template, those associations could support the candidate propositions &lt;code&gt;deployment requiresApprovalFrom ReleaseManager&lt;/code&gt; and &lt;code&gt;deployment requiresEvidence verificationResult&lt;/code&gt;. These describe obligations; they do not record that approval was given or that verification passed. An observed approval requires separate evidence identifying its issuer, subject, decision and applicable version. The runtime must still establish that the issuer and acting agent have the necessary authority.&lt;/p&gt;

&lt;p&gt;Typing a connection is therefore a controlled interpretation step. A candidate keeps its source text and concept matches; the role template supplies permissible predicates and structural constraints; a check establishes whether the text and independent evidence support the proposed proposition. An extraction model can propose a type, but a plausible label is not sufficient to admit the claim as organisational knowledge. Ambiguous, unsupported or conflicting propositions remain unresolved. The association evidence is retained so that a reviewer can reconstruct how the candidate arose.&lt;/p&gt;

&lt;p&gt;Verification and validation must compare typed propositions and their qualifiers across the input, output and evaluation criteria, using approved mappings where views differ. A test that finds every concept but converts &lt;code&gt;requiresApprovalFrom&lt;/code&gt; into &lt;code&gt;approvedBy&lt;/code&gt;, or removes a prohibition, has changed the claim. The audit must expose that change. Graph coverage can find omitted concepts; checking typed relationships addresses whether the connections preserve the intended meaning.&lt;/p&gt;

&lt;h3&gt;
  
  
  Retrieving an approved planning template
&lt;/h3&gt;

&lt;p&gt;The following command is an illustrative invocation using the installed &lt;code&gt;terraphim-grep&lt;/code&gt; interface. The paths represent a proposed organisational knowledge layout; they are not supplied sample data or a claim that this particular corpus was executed.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;terraphim-grep &lt;span class="s2"&gt;"delivery plan"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--role&lt;/span&gt; &lt;span class="s2"&gt;"Project Manager"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--haystack&lt;/span&gt; all &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--paths&lt;/span&gt; ./organisation/templates/planning &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--thesaurus&lt;/span&gt; ./organisation/roles/project-manager/thesaurus.json &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--search-only&lt;/span&gt; &lt;span class="nt"&gt;-n&lt;/span&gt; 8 &lt;span class="nt"&gt;-C&lt;/span&gt; 2 &lt;span class="nt"&gt;--json&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The dedicated thesaurus makes the role’s vocabulary concrete. &lt;code&gt;--search-only&lt;/code&gt; keeps this invocation on its search path without LLM synthesis. The implementation can fall back to thesaurus matching when populated graph evidence is absent; a result alone does not demonstrate graph traversal. Search produces candidates; the service then checks each candidate against the authoritative template registry. The chosen template must be approved, applicable to the project type, available to the active role and identified by an immutable revision or content digest. Restricting search paths narrows retrieval; it does not establish an execution sandbox.&lt;/p&gt;

&lt;p&gt;This distinction matters when a semantically excellent match is obsolete. The organisation’s semantic layer may help locate it, but the planning service must select an eligible template. If none exists, the service should request a governed template decision rather than manufacture an “approved” template itself.&lt;/p&gt;

&lt;h2&gt;
  
  
  A graph-based planning checklist
&lt;/h2&gt;

&lt;p&gt;A checklist makes an expected output contract explicit. Terraphim’s published checklist approach places enumerated concepts outside the model and uses the same graph machinery for recognition and retrieval. &lt;a href="https://docs.terraphim.ai/src/howto/graph-embeddings-checklists" rel="noopener noreferrer"&gt;Graph embeddings for checklists&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The current source also supports a paired input/output graph-coverage mode. An illustrative planning checklist, saved as &lt;code&gt;.terraphim/checklists/project_plan.md&lt;/code&gt;, is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="gh"&gt;# Project plan&lt;/span&gt;

mode:: graph-coverage-v1
checklist:: scope, dependencies, risk register, acceptance criteria

&lt;span class="gu"&gt;### risk register&lt;/span&gt;

synonyms:: risk log
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Its concepts and aliases must resolve uniquely in the configured role graph; declaring an alias in a checklist does not create the missing graph concept. The checklist is not a substitute for building and governing that graph. A source-level invocation for the inspected implementation is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;terraphim-agent validate &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--role&lt;/span&gt; &lt;span class="s2"&gt;"Project Manager"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--checklist&lt;/span&gt; project_plan &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--input-file&lt;/span&gt; brief.md &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--json&lt;/span&gt; &amp;lt; plan.md
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This &lt;code&gt;--input-file&lt;/code&gt; form is supported by the inspected client source, not by the locally installed 1.21.22 command interface. The example is therefore a source-supported integration example, not an installed-binary demonstration.&lt;/p&gt;

&lt;p&gt;The paired check requires recognised input concepts and checklist concepts to appear in the output, with supporting stored graph paths. Its report distinguishes &lt;code&gt;pass&lt;/code&gt;, &lt;code&gt;fail&lt;/code&gt; and &lt;code&gt;indeterminate&lt;/code&gt;. A service using it as a gate must inspect that verdict; successful CLI completion alone does not establish a passing checklist.&lt;/p&gt;

&lt;p&gt;Concept coverage is one limited checking predicate. A plan can mention “dependencies” while assigning them incorrectly, or include “acceptance criteria” that do not test the promised outcome. The complete planning contract consequently layers structural checks, graph concept coverage and evidence review. The graph checker supplies an inspectable signal within that contract. It does not establish the full semantic compatibility contract, verify every asserted relationship or confer permission to publish or execute the plan. Its lexical negation handling does not constitute general verification of proposition meaning.&lt;/p&gt;

&lt;h2&gt;
  
  
  Worked example from brief to bounded plan
&lt;/h2&gt;

&lt;p&gt;Consider a project to deliver a customer-facing feature. The Product Manager agent receives an authorised assignment to prepare a feature breakdown. Its graph connects the product outcome to needs, features, value assumptions and acceptance criteria. It produces a versioned breakdown and hands that artefact to the Project Manager service.&lt;/p&gt;

&lt;p&gt;The Project Manager agent authenticates under its own scoped assignment. It retrieves candidate planning templates through its role thesaurus, selects an approved revision, and creates a draft connecting the agreed features to milestones, dependencies, owners and risks. It preserves the incoming acceptance criteria and identifies unresolved assumptions.&lt;/p&gt;

&lt;p&gt;The service checks the draft’s structure and invokes the graph checklist. A missing recognised requirement produces a failed or indeterminate result that must be resolved before the relevant transition. A passing result is recorded alongside its limitations. Further review establishes whether the proposed dependencies and acceptance evidence are adequate.&lt;/p&gt;

&lt;p&gt;When the service requests &lt;code&gt;create_draft&lt;/code&gt; on the assigned project’s document store, the gateway evaluates the exact operation, destination and content digest. Assuming the role assignment, template, checks and policy conditions are valid, it permits that write and records its outcome.&lt;/p&gt;

&lt;p&gt;Now suppose the agent requests &lt;code&gt;deploy&lt;/code&gt; against production. The request fails the role-to-service/action binding and the production policy. Mentioning deployment in the plan, retrieving a release runbook, or passing the planning checklist cannot repair that missing authority. The gateway records a denial before an effect occurs.&lt;/p&gt;

&lt;p&gt;The agent may instead hand the approved plan to the release management process. That handoff supplies evidence, not inherited production credentials. A separately authorised release principal must satisfy its own contract. The organisation can therefore automate preparation without collapsing preparation, approval and execution into a single unrestricted agent.&lt;/p&gt;

&lt;h3&gt;
  
  
  Checking the planning context
&lt;/h3&gt;

&lt;p&gt;Consider an illustrative requirement &lt;strong&gt;R-17 revision 3&lt;/strong&gt;: the plan must specify a &lt;strong&gt;staging&lt;/strong&gt; rollback rehearsal whose planned start is no earlier than the simulated-failure trigger and no later than &lt;strong&gt;eight elapsed hours&lt;/strong&gt; afterwards. The baseline defines that trigger as the rehearsal protocol's injected-failure timestamp. Production deployment is outside the Project Manager's scope. The stakeholder need is to coordinate a usable rehearsal without delegating production execution.&lt;/p&gt;

&lt;p&gt;A verification criterion checks the plan's environment, planned start offset and preserved prohibition against that baseline. A validation scenario asks the delivery and release stakeholders whether the proposed handoff enables the intended rehearsal with the available people and resources. The plan's check does not prove that a rehearsal occurred. Later testing of the delivered system requires its own evidence; a good plan does not establish successful system behaviour.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Candidate interpretation or evidence&lt;/th&gt;
&lt;th&gt;Required treatment under the proposed contract&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;“One business day” replaces eight elapsed hours&lt;/td&gt;
&lt;td&gt;No silent equivalence. Resolve the calendar and conversion; fail if the interval changes, otherwise retain the approved mapping.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;The plan schedules the rehearsal in production&lt;/td&gt;
&lt;td&gt;Fail the known environment mismatch; separately deny unauthorised production actions.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;The evaluator uses revision 2's 24-hour threshold&lt;/td&gt;
&lt;td&gt;Reject the stale criterion binding and reassess against revision 3.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;“Must not deploy” becomes “may deploy”&lt;/td&gt;
&lt;td&gt;Fail proposition preservation despite matching deployment concepts.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Relevant calendar or requirement revision is unknown&lt;/td&gt;
&lt;td&gt;Return indeterminate until the baseline is resolved.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The same protection applies when views use different language. “Pre-production” can map to the named staging environment if the organisation explicitly defines that equivalence. Matching the spelling “staging” in an unrelated project's evidence cannot establish that the requirement was met.&lt;/p&gt;

&lt;h2&gt;
  
  
  Terraph audit with one role and one checklist
&lt;/h2&gt;

&lt;p&gt;This Terraph example connects a role graph, a checklist and three verbs: &lt;code&gt;audit&lt;/code&gt;, &lt;code&gt;check&lt;/code&gt; and &lt;code&gt;deploy&lt;/code&gt;. Here, &lt;code&gt;engineer&lt;/code&gt; is the example role; it does not change the Project Manager’s authority. The graph and checklist are Markdown inputs compiled into constant matching automata. &lt;code&gt;embed&lt;/code&gt; and &lt;code&gt;satisfies&lt;/code&gt; are language intrinsics, so retrieval and checking use the same concept definitions.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import std;

role engineer from "kg";
checklist preflight from "checklists/preflight.md";

// Audit concept coverage and report the matching source spans.
fn audit(path: str) -&amp;gt; i64 {
    let src = read_file(path);
    if src.len == 0 {
        print("cannot read ", path);
        return 1;
    }
    let h = embed(src);
    let cov = coverage(h);
    print("file: ", path);
    print("kg_hits: ", cov.kg_hits, "  concepts: ", cov.concepts,
          "  confidence: ", cov.confidence, "  diversity: ", cov.diversity);
    for m in h {
        print("  ", m.concept, " @", m.start, "..", m.end);
    }
    if cov.sufficient() {
        print("sufficient: yes");
        return 0;
    }
    print("sufficient: no");
    return 1;
}

// Diagnose missing checklist items. This verb does not issue a proof.
fn check(text: str) -&amp;gt; i64 {
    let miss = text satisfies preflight;
    if miss.any() {
        print("checklist preflight: incomplete");
        miss.report();
        return 4;
    }
    print("checklist preflight: complete");
    return 0;
}

// The generated wrapper supplies a sealed proof for the checked snapshot.
fn deploy(plan: str, ev: Proof&amp;lt;preflight&amp;gt;) -&amp;gt; i64 {
    print("deploy: preflight evidence present, proceeding");
    return 0;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;audit&lt;/code&gt; exposes which concepts matched and where. &lt;code&gt;check&lt;/code&gt; reports missing checklist items. At the gated entry point, the generated verb wrapper obtains a sealed &lt;code&gt;Proof&amp;lt;preflight&amp;gt;&lt;/code&gt; through &lt;code&gt;.require()&lt;/code&gt;, which succeeds only when no items are missing. The function signature makes that evidence a prerequisite for entering &lt;code&gt;deploy&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The proof carries the checked snapshot as &lt;code&gt;ev.subject&lt;/code&gt;. Any operation justified by the gate must consume that snapshot; reopening the path in &lt;code&gt;plan&lt;/code&gt; could read changed, unchecked bytes. The sample body only prints a message. Actual deployment still requires an authorised role assignment and resource policy, and concept coverage alone does not establish that the plan is correct. The example shows the language boundary; it is not a recorded deployment.&lt;/p&gt;

&lt;h2&gt;
  
  
  ADF configuration gives the role an organisational task
&lt;/h2&gt;

&lt;p&gt;The ADF agent orchestration configurations assign organisational responsibilities. The checked-in Product Owner template names an implementation and declares these fields. Product Owner is the configured role; it is distinct from the illustrative Product Manager role used earlier:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight toml"&gt;&lt;code&gt;&lt;span class="k"&gt;[[&lt;/span&gt;&lt;span class="n"&gt;agents&lt;/span&gt;&lt;span class="k"&gt;]]&lt;/span&gt;
&lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;"product-owner"&lt;/span&gt;
&lt;span class="n"&gt;persona&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;"Themis"&lt;/span&gt;
&lt;span class="n"&gt;capabilities&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="s"&gt;"planning"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s"&gt;"roadmap"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s"&gt;"issue-creation"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s"&gt;"prioritisation"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="n"&gt;project&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;"terraphim"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Its skill chain includes research, design, specification, architecture, business scenario design, requirements traceability and acceptance testing. The task defines the work product: each proposed issue must identify its organisational goal, describe the problem and proposed solution, and supply Given–When–Then acceptance criteria. The template also requires a priority estimate, a communication hint and the suggested delivery agent. The workflow narrows the backlog, scores the surviving items and proposes up to two new issues.&lt;/p&gt;

&lt;p&gt;These selected literal fields show the existing issue template. Its brackets indicate fields the Product Owner must fill; WIG means the organisation’s current Wildly Important Goal.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Title: [concise, imperative]
WIG: [which WIG this serves, or skip if none]
Problem: [2-3 sentences describing the problem]
Proposed solution: [bullet points, no hand-waving]
Acceptance criteria (mini-UAT):
  Given [precondition]
  When [action]
  Then [observable outcome]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The configuration connects the Product Owner’s planning capability to a defined work product and template. It records operational intent; this inspection does not establish that the agent is deployed or that every configured step succeeds.&lt;/p&gt;

&lt;p&gt;The repo-local ADF configuration separately declares a Developer, Reviewer and Merge Coordinator, with distinct capability lists and named Terraphim roles:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Configured agent&lt;/th&gt;
&lt;th&gt;Declared Terraphim role&lt;/th&gt;
&lt;th&gt;Responsibility expressed in the configuration&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;developer&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Terraphim AI Developer&lt;/td&gt;
&lt;td&gt;Implementation, Rust development and test-driven development&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;reviewer&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Terraphim AI Reviewer&lt;/td&gt;
&lt;td&gt;Code review, quality gates and review coordination&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;merge-coordinator&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Terraphim AI Merge Coordinator&lt;/td&gt;
&lt;td&gt;Merge coordination, CI/CD and conflict resolution&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The orchestrator’s merge path checks four required status contexts: &lt;code&gt;native-ci / build (push)&lt;/code&gt;, &lt;code&gt;adf/pr-reviewer&lt;/code&gt;, &lt;code&gt;adf/validation&lt;/code&gt; and &lt;code&gt;adf/verification&lt;/code&gt;. It also requires canonical gate-result records for the current pull request head. Blocking findings and the project's treatment of concerns affect the decision. Evidence for an older commit cannot substitute for the current head’s review, binding the decision to that part of its context baseline. The labels &lt;code&gt;adf/validation&lt;/code&gt; and &lt;code&gt;adf/verification&lt;/code&gt; do not establish that their producers perform the corresponding ISO requirements or system activities.&lt;/p&gt;

&lt;p&gt;Configuration intent and runtime enforcement must remain distinguishable. The inspected repo-local loader sets &lt;code&gt;terraphim_role&lt;/code&gt; to &lt;code&gt;None&lt;/code&gt;; the declaration alone does not prove that an agent receives the named role graph. Instructions such as “do not merge” are task text, and the Product Owner’s broad shell access is not a production-deployment barrier. The merge gate controls the orchestrator’s merge path; it does not prove that every alternative credential or tool path is mediated. Its structured records are not independently authenticated merely by having the expected fields.&lt;/p&gt;

&lt;p&gt;ADF declares responsibility, capabilities, workflow and expected artefacts. Terraph implements bounded tool access, checks and receipts; Terraphim provides the role vocabulary and graph context. Connecting them still requires authenticated role assignments, capability-to-service identifiers, approved artefact versions and policy decisions tied to exact requests.&lt;/p&gt;

&lt;p&gt;W3C PROV provides terms for recording entities, activities and agents, including derivation, association and delegated responsibility. These relationships can describe an artefact’s origin and an agent’s participation; a provenance statement alone is not an authorisation decision. &lt;a href="https://www.w3.org/TR/prov-o/" rel="noopener noreferrer"&gt;W3C PROV-O&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Evaluation and implementation boundaries
&lt;/h2&gt;

&lt;p&gt;The proposal can be evaluated without assuming that more graph coverage means safer behaviour. A test corpus should pair legitimate planning tasks with boundary cases and preserve the same role assignments and policy across agent implementations.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Test&lt;/th&gt;
&lt;th&gt;Expected observable result&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Valid plan from an approved template&lt;/td&gt;
&lt;td&gt;Draft created in the assigned project with complete evidence links&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Semantically relevant but withdrawn template&lt;/td&gt;
&lt;td&gt;Candidate rejected by template eligibility policy&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Required concept omitted&lt;/td&gt;
&lt;td&gt;Graph report identifies a fail or indeterminate result; gated transition does not proceed&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;All terms present but a dependency is wrong&lt;/td&gt;
&lt;td&gt;Concept coverage may pass; substantive review detects the error&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Project Manager requests production deployment&lt;/td&gt;
&lt;td&gt;Denied before any deployment effect&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Deployment attempted through an alternative tool&lt;/td&gt;
&lt;td&gt;Same authority boundary enforced&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Artefact changes after checking&lt;/td&gt;
&lt;td&gt;Previous evidence rejected for the changed request or bytes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Role assignment expires before execution&lt;/td&gt;
&lt;td&gt;Gateway denies or requires a fresh valid assignment&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Agent implementation is replaced&lt;/td&gt;
&lt;td&gt;Service contract and authority boundaries remain unchanged&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Concepts match but polarity, environment or units differ&lt;/td&gt;
&lt;td&gt;Relevant semantic predicate fails, or unresolved meaning is indeterminate&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A role projection drops a critical obligation&lt;/td&gt;
&lt;td&gt;Trace check rejects the transformation or requires an approved change&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Different role views have an approved meaning-preserving mapping&lt;/td&gt;
&lt;td&gt;Compatibility can be established; substantive criteria still require evidence&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Measurements should include accepted legitimate tasks, incorrect denials, unauthorised effects, trace completeness and the cost of reconstructing a decision. Report semantic-check accuracy separately from policy enforcement. A test that finds no bypass in a bounded suite is evidence about that suite, not proof that all possible tool paths are mediated.&lt;/p&gt;

&lt;p&gt;Terraphim already supplies relevant semantic components, and Terraph supplies concrete prototype mechanisms for compiled checks and evidence. ADF provides configured organisational responsibilities and an implemented orchestrator merge gate. The end-to-end organisational contract, contextual requirement-to-criterion alignment, authenticated role binding, complete execution mediation and linked audit schema remain the integration proposed in this paper. No production deployment result or benchmark is claimed here.&lt;/p&gt;

&lt;p&gt;Role owners must maintain concepts, templates and policies, and reviewers must understand what each checklist establishes. Graph updates need controlled promotion because a vocabulary change can alter which obligations appear satisfied. Audit records should retain enough versioned evidence to reconstruct decisions while limiting sensitive content.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;An agent’s organisational role provides a durable basis for knowledge, responsibility and delegated authority. Capabilities explain the outcomes the role must support; services describe how an agent implementation supplies them; tools expose actions; contextual policy determines which actions may occur. A role-based knowledge graph makes the concepts and relationships behind the work inspectable. Meaningful verification and validation also require those concepts, their propositions and the operating context to align with the applicable criteria through explicit, traceable mappings. A shared vocabulary alone cannot preserve an obligation.&lt;/p&gt;

&lt;p&gt;Terraphim supplies explicit concept matching, co-occurrence associations, graph retrieval and graph-based checklists. The proposed next layer types those associations using governed role templates and standards-traceable relationship definitions, distinguishing a mention from an obligation and an obligation from an evidenced event. Terraph illustrates how compiled checks can produce evidence tied to the subject being checked. Connecting these mechanisms to authenticated role assignments and mediated execution yields a traceable organisational contract.&lt;/p&gt;

&lt;p&gt;For a Project Manager agent, the contract requires an approved planning template, preserved requirements, a checked plan and operation within the assigned project scope. Production deployment belongs to a separately authorised role and process. The evidence must allow a reviewer to reconstruct both the planning result and the authority decision.&lt;/p&gt;

&lt;h2&gt;
  
  
  Sources and scope
&lt;/h2&gt;

&lt;p&gt;Public sources are linked beside the claims they support. The preceding article by David Hunt and Alexander Mikhalev was published on 31 October 2026 and read on 4 November. The continuation and concept mapping are this paper's synthesis.&lt;/p&gt;

&lt;p&gt;Terraphim and ADF implementation details were checked against local source on 3–4 November 2026. The Terraph example above was supplied by Alexander Mikhalev; its comments have been shortened and its function bodies retained. Source revisions, implementation paths, recorded fixture results and inspection limits remain in the internal research notes.&lt;/p&gt;

&lt;p&gt;The standards cross-check used official catalogue records and accessible previews. The complete normative text of ISO/IEC/IEEE 42010:2022 was not inspected, so no clause-by-clause conformity claim is made. The role contracts, typed relationship profiles, contextual criteria and cross-system bindings are proposed integration work. The examples do not demonstrate a live production deployment.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://reference-architecture.ai/posts/organisational-roles-as-agent-contracts/" rel="noopener noreferrer"&gt;reference-architecture.ai&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>agents</category>
      <category>architecture</category>
      <category>security</category>
    </item>
    <item>
      <title>Terraphim Skills is live in ChatGPT: search and inspect engineering workflows</title>
      <dc:creator>AlexMikhalev</dc:creator>
      <pubDate>Sun, 01 Nov 2026 00:54:53 +0000</pubDate>
      <link>https://dev.to/alexmikhalev/terraphim-skills-is-live-in-chatgpt-search-and-inspect-engineering-workflows-3403</link>
      <guid>https://dev.to/alexmikhalev/terraphim-skills-is-live-in-chatgpt-search-and-inspect-engineering-workflows-3403</guid>
      <description>&lt;p&gt;Terraphim Skills 1.0.0 is now available as a ChatGPT plugin. It brings our engineering-skills catalogue into a conversation so you can search for a relevant workflow, inspect its metadata, and read content your connected account is entitled to access.&lt;/p&gt;

&lt;p&gt;The public listing is here: &lt;a href="https://chatgpt.com/plugins/plugin_asdk_app_6ad14146f1d881918de38350db724616" rel="noopener noreferrer"&gt;https://chatgpt.com/plugins/plugin_asdk_app_6ad14146f1d881918de38350db724616&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What you can do
&lt;/h2&gt;

&lt;p&gt;The integration exposes five read-only tools:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;whoami&lt;/code&gt; checks the connected account.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;list_skills&lt;/code&gt; browses the catalogue.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;search_skills&lt;/code&gt; finds skills related to a task.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;show_skill&lt;/code&gt; inspects a skill's details.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;get_skill_content&lt;/code&gt; retrieves content where the account permits it.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A practical starting point is to search for a skill that matches the work in front of you, inspect its description, and then use the relevant workflow as a guide. The catalogue is organized around concrete engineering and knowledge-work practices, including a V-model path from research and design to verification and validation.&lt;/p&gt;

&lt;h2&gt;
  
  
  Access and boundaries
&lt;/h2&gt;

&lt;p&gt;The plugin is read-only. What appears in ChatGPT follows the connected Terraphim Skills account's entitlement. Premium skill bodies are not available through ChatGPT. The public listing and the install control are shown in the screenshot below.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fed1uz2yp9bax87x9ruwl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fed1uz2yp9bax87x9ruwl.png" alt="Terraphim Skills public ChatGPT plugin listing showing developer, version 1.0.0, and install button" width="736" height="719"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To get started, open the &lt;a href="https://chatgpt.com/plugins/plugin_asdk_app_6ad14146f1d881918de38350db724616" rel="noopener noreferrer"&gt;Terraphim Skills listing&lt;/a&gt;, install the plugin, and connect your account. Then ask ChatGPT to search the catalogue for the workflow you need.&lt;/p&gt;

&lt;p&gt;We would welcome feedback on the skills you try and the workflows you want to see next.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>chatgpt</category>
      <category>productivity</category>
      <category>tools</category>
    </item>
    <item>
      <title>Graph Embeddings You Can Watch Being Built</title>
      <dc:creator>AlexMikhalev</dc:creator>
      <pubDate>Tue, 20 Oct 2026 15:20:59 +0000</pubDate>
      <link>https://dev.to/alexmikhalev/graph-embeddings-you-can-watch-being-built-2oi8</link>
      <guid>https://dev.to/alexmikhalev/graph-embeddings-you-can-watch-being-built-2oi8</guid>
      <description>&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://terraphim.ai/docs/graph-embeddings-interactive/" rel="noopener noreferrer"&gt;terraphim.ai&lt;/a&gt; — where this article is fully interactive.&lt;/em&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Graph Embeddings You Can Watch Being Built
&lt;/h1&gt;

&lt;p&gt;A graph embedding does not have to be a vector. In Terraphim it is a node plus its directed edges and a set of integer counters: the synonyms that map to the concept, and the concepts that appear next to it in real text. That claim is easy to make and hard to feel, so we built a page that proves it — the actual Rust &lt;code&gt;terraphim_rolegraph&lt;/code&gt; crate, compiled to WebAssembly, running the algorithm in your browser. Nothing on screen is staged or reimplemented; the counters you watch increment are the same code paths the crate's own tests exercise.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the page does
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Live Aho-Corasick matching.&lt;/strong&gt; Type any sentence into the matcher and a real automaton — compiled from a 19-term thesaurus — scans it in a single pass and reports concept ids. &lt;code&gt;raft quorum consensus&lt;/code&gt; fires &lt;code&gt;#1 raft&lt;/code&gt;, &lt;code&gt;#6 quorum&lt;/code&gt;, &lt;code&gt;#2 consensus&lt;/code&gt;. The matching is case-folding and leftmost-longest, exactly as the Rust crate configures it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step-by-step indexing.&lt;/strong&gt; Index the eight-document corpus one click at a time. Each document is matched, adjacent concept matches become directed edges, and node and edge counters increment. The end state — 10 concepts, 23 directed edges — includes a &lt;code&gt;raft → raft&lt;/code&gt; self-loop that falls out of &lt;code&gt;Document::to_string()&lt;/code&gt; matching titles as well as bodies. No special-casing; that is what the Rust code does, so that is what the page shows.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A query ledger you can audit.&lt;/strong&gt; Query &lt;code&gt;consensus&lt;/code&gt; and the winner, &lt;code&gt;doc-membership&lt;/code&gt;, earns 19 points decomposed as &lt;code&gt;node 7 + edge 1 + doc 2&lt;/code&gt; through one edge plus &lt;code&gt;node 7 + edge 1 + doc 1&lt;/code&gt; through another. Every point of the sum is a named node, a named edge and an inspectable document count. That is the explainability argument for symbolic retrieval made concrete: there is no answer to "why 0.87" for a dense vector, and a complete answer here.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Honest failure.&lt;/strong&gt; &lt;code&gt;byzantine fault tolerance&lt;/code&gt; matches no thesaurus term and the graph returns an empty set — displayed as such — while the illustrative vector panel next to it still produces fuzzy similarity scores. The contrast is the lesson: dense retrieval always answers, symbolic retrieval tells you when it does not know.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Real rebuild cost.&lt;/strong&gt; Add a synonym — say &lt;code&gt;leader selection&lt;/code&gt; — and the page calls the crate's &lt;code&gt;thesaurus.insert&lt;/code&gt; plus &lt;code&gt;rebuild_automata&lt;/code&gt;, measuring the result live (single-digit milliseconds on an M-series laptop). Set against the "update the embedding" column for node2vec, GCN or a hosted vector index, this is the cost-of-change argument.&lt;/p&gt;

&lt;h2&gt;
  
  
  The honest comparison
&lt;/h2&gt;

&lt;p&gt;The page includes a side-by-side table across training requirements, update cost, explainability, determinism and memory footprint for learned graph embeddings (node2vec, GCN, TransE, Cleora), dense text embeddings behind an API and vector database, and Terraphim's graph. It does not pretend the symbolic graph wins everywhere: it is blind to out-of-vocabulary terms, its ranks reflect frequency rather than importance, and its reach is one hop of adjacency.&lt;/p&gt;

&lt;p&gt;Those gaps have engineered answers that already exist in the codebase rather than proposals: &lt;code&gt;query_graph_with_trigger_fallback&lt;/code&gt; backs the graph with a TF-IDF trigger index as an opt-in fallback, and &lt;code&gt;search_sessions_hybrid&lt;/code&gt; fuses BM25 full-text scoring with knowledge-graph concept boosts for session search.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;

&lt;p&gt;Everything above is one click away at &lt;a href="https://terraphim.ai/docs/graph-embeddings-interactive/" rel="noopener noreferrer"&gt;terraphim.ai/docs/graph-embeddings-interactive/&lt;/a&gt;. The WASM build, its provenance manifest and a conformance suite that cross-checks the browser output against an independent oracle are all in the site's repository.&lt;/p&gt;

&lt;p&gt;What would you index first on a graph you can watch being built?&lt;/p&gt;

</description>
      <category>rust</category>
      <category>webassembly</category>
      <category>knowledgegraph</category>
      <category>embeddings</category>
    </item>
    <item>
      <title>Graph Embeddings for Checklists</title>
      <dc:creator>AlexMikhalev</dc:creator>
      <pubDate>Tue, 20 Oct 2026 12:19:36 +0000</pubDate>
      <link>https://dev.to/alexmikhalev/graph-embeddings-for-checklists-lgc</link>
      <guid>https://dev.to/alexmikhalev/graph-embeddings-for-checklists-lgc</guid>
      <description>&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://terraphim.ai/posts/graph-embeddings-checklists/" rel="noopener noreferrer"&gt;terraphim.ai&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Graph Embeddings for Checklists
&lt;/h1&gt;

&lt;p&gt;A checklist is an enumerated set of terms that must be checked. That is the whole problem, and it is the reason vector embeddings are the wrong tool for it: a nearest-neighbour index returns fuzzy neighbours, it cannot enumerate a fixed set and report which members fired. A knowledge graph can. Write the checklist once as synonyms under a normalised term, compile it into an Aho-Corasick automaton, and every check becomes a deterministic match with a named edge you can audit.&lt;/p&gt;

&lt;p&gt;This post shows that machinery applied to the two places a checklist earns its keep around an LLM call: &lt;code&gt;terraphim-grep&lt;/code&gt; with a role thesaurus before the call, and &lt;code&gt;terraphim-agent&lt;/code&gt; hooks plus learning after it. Every command below was run while writing this article; the outputs are real.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Checklist Is an Automaton, Not a Promise
&lt;/h2&gt;

&lt;p&gt;The usual pattern for "checklists" in agent workflows is a paragraph in a system prompt that the model promises to honour. That is a probabilistic check enforced by the thing being checked. Terraphim inverts it: the checklist lives outside the model, in the same structure that powers &lt;a href="https://terraphim.ai/docs/graph-embeddings/" rel="noopener noreferrer"&gt;graph embeddings&lt;/a&gt; elsewhere on this site.&lt;/p&gt;

&lt;p&gt;A checklist item set looks like this in the knowledge graph. This is &lt;code&gt;bun install.md&lt;/code&gt; from the rewrite graph on this machine (committed verbatim at &lt;code&gt;.terraphim/rewrite/bun install.md&lt;/code&gt; in this site's repository):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="gh"&gt;# bun add&lt;/span&gt;

Install dependencies using Bun package manager.

synonyms:: npm install, yarn install, pnpm install, npm i, yarn add, pnpm add
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The filename gives the normalised term the hook reports back (the suggestion in the findings output below is &lt;code&gt;bun install&lt;/code&gt;, matching &lt;code&gt;bun install.md&lt;/code&gt;), while the heading names the approved form inside the file. The &lt;code&gt;synonyms::&lt;/code&gt; line is the checklist itself: every surface form that must be recognised and dealt with. Compile the directory of such files into &lt;code&gt;thesaurus.json&lt;/code&gt; and you get the "Terraphim Engineer" role used below, currently 219 entries. Rebuilding the automaton after an edit takes about 20 ms, a figure we verified in &lt;a href="https://terraphim.ai/posts/why-graph-embeddings-matter/" rel="noopener noreferrer"&gt;Why Graph Embeddings Matter&lt;/a&gt;, so the checklist is cheap to change and free to consult.&lt;/p&gt;

&lt;h2&gt;
  
  
  Before the LLM Call: Retrieval as Checklist Execution
&lt;/h2&gt;

&lt;p&gt;The first job of a checklist is deciding what goes into the prompt. "Gather relevant context" is vague; "which of the enumerated terms in this role's graph appear in the repository, and what do they pull in" is a check.&lt;/p&gt;

&lt;p&gt;Here is the query I ran over this site's own source while preparing this article, using the Terraphim Engineer thesaurus:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;terraphim-grep &lt;span class="s2"&gt;"quality gate"&lt;/span&gt; &lt;span class="nt"&gt;--haystack&lt;/span&gt; all &lt;span class="nt"&gt;--paths&lt;/span&gt; &lt;span class="nb"&gt;.&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--thesaurus&lt;/span&gt; ~/.config/terraphim/thesaurus.json &lt;span class="nt"&gt;-n&lt;/span&gt; 8 &lt;span class="nt"&gt;-C&lt;/span&gt; 1 &lt;span class="nt"&gt;--json&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The result, abridged:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="nl"&gt;"stats"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"search_latency_ms"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;53&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"chunks_returned"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"kg_hits"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="err"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="nl"&gt;"concepts"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"accept"&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"accepted"&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"escalate"&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"fail"&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"improve"&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"judge-verdicts"&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"needs improvement"&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"pass"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Two things worth pausing on. First, the concepts list is the checklist executing: the graph expanded "quality gate" into its item set (accept, fail, escalate, pass, judge-verdicts and friends) and matched those terms across the tree. Second, the chunks it returned came from &lt;code&gt;.github/workflows/*.yml&lt;/code&gt; and &lt;code&gt;campaigns/skills-2026/*&lt;/code&gt;, files that contain none of the words "quality" or "gate". They matched on &lt;code&gt;fail&lt;/code&gt;, &lt;code&gt;curl --fail&lt;/code&gt;, &lt;code&gt;accepted&lt;/code&gt;: items on the checklist, not words in the query. Fifty-three milliseconds, no embedding model, and every hit can name the edge that produced it.&lt;/p&gt;

&lt;h3&gt;
  
  
  The honest empty case
&lt;/h3&gt;

&lt;p&gt;A checklist that cannot say "not covered" is useless, so here is the control run against the same thesaurus:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;terraphim-grep &lt;span class="s2"&gt;"checklist"&lt;/span&gt; &lt;span class="nt"&gt;--haystack&lt;/span&gt; all &lt;span class="nt"&gt;--paths&lt;/span&gt; &lt;span class="nb"&gt;.&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--thesaurus&lt;/span&gt; ~/.config/terraphim/thesaurus.json &lt;span class="nt"&gt;-n&lt;/span&gt; 8 &lt;span class="nt"&gt;-C&lt;/span&gt; 2 &lt;span class="nt"&gt;--json&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="nl"&gt;"kg_hits"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="err"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="nl"&gt;"sufficiency"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"SearchOnly"&lt;/span&gt;&lt;span class="err"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="nl"&gt;"sufficiency_explanation"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Found 4 chunks but KG confidence 0.00 &amp;lt; 0.50,
  diversity 1 &amp;lt; 2; returning search results only (pass --answer or
  --force-rlm to synthesise)."&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Zero KG hits, four plain lexical chunks, and an explicit admission that graph confidence was too low to claim concept coverage. The tool does not pretend the checklist applied. If you want "checklist" to be a graph concept, you write it into a &lt;code&gt;kg/*.md&lt;/code&gt; file with a &lt;code&gt;synonyms::&lt;/code&gt; line and rebuild; the gap is a text edit, not a retraining run. The project-local variant of this workflow (a &lt;code&gt;.terraphim/&lt;/code&gt; directory in your repo with its own role thesaurus) is documented in the &lt;a href="https://terraphim.ai/posts/skill-spotlight-terraphim-grep/" rel="noopener noreferrer"&gt;terraphim-grep offline setup&lt;/a&gt; and the concepts can be enriched with code anchors mined by ast-grep.&lt;/p&gt;

&lt;h3&gt;
  
  
  Reproduce it
&lt;/h3&gt;

&lt;p&gt;The artefacts behind these outputs are committed. This site's repository carries a &lt;code&gt;.terraphim/&lt;/code&gt; directory: &lt;code&gt;kg/&lt;/code&gt; holds the concept files used above (&lt;code&gt;validation gate&lt;/code&gt;, &lt;code&gt;judge-verdicts&lt;/code&gt;, &lt;code&gt;hook&lt;/code&gt;, &lt;code&gt;grounding gate&lt;/code&gt; and friends), &lt;code&gt;rewrite/&lt;/code&gt; holds the hook checklist, and &lt;code&gt;thesaurus.json&lt;/code&gt; is the compiled 39-entry public subset of the working role. Run the same command against it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;terraphim-grep &lt;span class="s2"&gt;"quality gate"&lt;/span&gt; &lt;span class="nt"&gt;--haystack&lt;/span&gt; all &lt;span class="nt"&gt;--paths&lt;/span&gt; &lt;span class="nb"&gt;.&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--thesaurus&lt;/span&gt; .terraphim/thesaurus.json &lt;span class="nt"&gt;-n&lt;/span&gt; 8 &lt;span class="nt"&gt;-C&lt;/span&gt; 1 &lt;span class="nt"&gt;--json&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Same eight concepts, same honest &lt;code&gt;kg_hits: 0&lt;/code&gt; on the "checklist" control. For larger published checklist graphs, &lt;code&gt;docs/src/kg/checklists/&lt;/code&gt; in the terraphim-ai repository carries the code review and security concepts.&lt;/p&gt;

&lt;h2&gt;
  
  
  After the LLM Call: The Hook Is a Findings Checklist
&lt;/h2&gt;

&lt;p&gt;The second job of a checklist is gating what comes back. In current releases, &lt;code&gt;terraphim-agent hook&lt;/code&gt; does not silently rewrite the agent's proposed action; it returns a machine-readable findings list. That distinction matters: the hook's job is to &lt;em&gt;check&lt;/em&gt;, and a check that mutates silently is a check you cannot audit.&lt;/p&gt;

&lt;p&gt;Run from the directory holding the rewrite config, against a tool call an agent might propose:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s1"&gt;'{"tool_name":"Bash","tool_input":{"command":"npm install react"}}'&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  | terraphim-agent hook &lt;span class="nt"&gt;--hook-type&lt;/span&gt; pre-tool-use &lt;span class="nt"&gt;--json&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;"tool_input"&lt;/span&gt;&lt;span class="p"&gt;:{&lt;/span&gt;&lt;span class="nl"&gt;"command"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"npm install react"&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="nl"&gt;"tool_name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"Bash"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
 &lt;/span&gt;&lt;span class="nl"&gt;"validations"&lt;/span&gt;&lt;span class="p"&gt;:{&lt;/span&gt;&lt;span class="nl"&gt;"findings"&lt;/span&gt;&lt;span class="p"&gt;:[{&lt;/span&gt;&lt;span class="nl"&gt;"matched_term"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"npm install"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
 &lt;/span&gt;&lt;span class="nl"&gt;"suggested_replacement"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"bun install"&lt;/span&gt;&lt;span class="p"&gt;}],&lt;/span&gt;&lt;span class="nl"&gt;"has_findings"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;}}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Read that output as a completed checklist line: item "npm install" found, prescribed action "bun install", flag raised. The hook types cover the lifecycle (&lt;code&gt;pre-tool-use&lt;/code&gt;, &lt;code&gt;post-tool-use&lt;/code&gt;, &lt;code&gt;pre-commit&lt;/code&gt;, &lt;code&gt;prepare-commit-msg&lt;/code&gt;), and &lt;code&gt;--with-guard&lt;/code&gt; is on by default for pre-tool-use so destructive commands get intercepted in the same pass. We covered the git-hook end of this in &lt;a href="https://terraphim.ai/posts/teaching-ai-agents-with-knowledge-graphs/" rel="noopener noreferrer"&gt;Teaching AI Coding Agents with Knowledge Graph Hooks&lt;/a&gt; and the end-to-end verified flow in &lt;a href="https://terraphim.ai/posts/native-hook-support/" rel="noopener noreferrer"&gt;Native Hook Support&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  When the checklist itself fails
&lt;/h3&gt;

&lt;p&gt;Checklists also cover the checking tool. Two honest notes from this session:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;terraphim-agent learn query "checklist"&lt;/code&gt; returned a list of past failed commands (exit-1 runs captured by the PostToolUse hook); the learning store is doing its job remembering what went wrong before.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;terraphim-agent replace&lt;/code&gt; in this build reports &lt;code&gt;replacements: 1, "changed": true&lt;/code&gt; while returning the input unchanged. The findings-based &lt;code&gt;hook&lt;/code&gt; path above is the contract to rely on; if &lt;code&gt;replace&lt;/code&gt; is your integration point, verify the output rather than the flag. This is itself a captured learning; see &lt;a href="https://terraphim.ai/posts/teaching-ai-agents-to-learn-from-mistakes/" rel="noopener noreferrer"&gt;Teaching AI Agents to Learn from Their Mistakes&lt;/a&gt; for how such a failure becomes a stored correction and eventually a new synonym.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The Loop, Closed
&lt;/h2&gt;

&lt;p&gt;Put the phases together and the checklist lifecycle is:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Declare&lt;/strong&gt;: write &lt;code&gt;kg/*.md&lt;/code&gt; files; heading = normalised item, &lt;code&gt;synonyms::&lt;/code&gt; = surface forms to catch.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Compile&lt;/strong&gt;: generate &lt;code&gt;thesaurus.json&lt;/code&gt;; ~20 ms per role.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Retrieve (pre-LLM)&lt;/strong&gt;: &lt;code&gt;terraphim-grep&lt;/code&gt; with the role thesaurus expands queries into concept terms and pulls grounded chunks — or honestly reports &lt;code&gt;kg_hits: 0&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Draft&lt;/strong&gt;: the LLM call runs with checklist-shaped context instead of a vibes-based prompt.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Gate (post-LLM)&lt;/strong&gt;: &lt;code&gt;terraphim-agent hook&lt;/code&gt; emits findings; guards intercept destructive commands; failed commands are captured by the learning hook.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Correct&lt;/strong&gt;: &lt;code&gt;learn correct&lt;/code&gt; / &lt;code&gt;learn correction add&lt;/code&gt; turn observed failures into reviewed rules; &lt;code&gt;memory capture&lt;/code&gt; stores authored lessons; the synonyms grow and the automaton recompiles.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Step 6 is what makes this different from a static lint list. Corrections feed back into the graph, so the checklist the next session runs against is the checklist this session finished — a property the &lt;code&gt;learn&lt;/code&gt;/&lt;code&gt;memory&lt;/code&gt; subcommands exist to provide, described in the &lt;a href="https://terraphim.ai/posts/skill-spotlight-learning-capture/" rel="noopener noreferrer"&gt;learning capture spotlight&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why This Is Not a Vector Problem
&lt;/h2&gt;

&lt;p&gt;A vector index answers "what is near this?" A checklist asks "which of these exact items occurred, and what was the prescribed response?" Those are different questions with different audit requirements. Graph embeddings give you the second in tens of milliseconds on a laptop, with an explainable edge for every match and no network call. The full performance case, including the 1.4-million-pattern sub-millisecond figure, is in &lt;a href="https://terraphim.ai/posts/why-graph-embeddings-matter/" rel="noopener noreferrer"&gt;Why Graph Embeddings Matter&lt;/a&gt; and &lt;a href="https://terraphim.ai/posts/sub-millisecond-context-knowledge-graphs/" rel="noopener noreferrer"&gt;Sub-Millisecond Context with Knowledge Graphs&lt;/a&gt;; the mechanism is on the &lt;a href="https://terraphim.ai/docs/graph-embeddings/" rel="noopener noreferrer"&gt;Graph Embeddings reference&lt;/a&gt; page.&lt;/p&gt;

&lt;p&gt;If you want the wiring for your own agent setup, the &lt;a href="https://terraphim.ai/how-tos/command-rewriting-howto/" rel="noopener noreferrer"&gt;command rewriting how-to&lt;/a&gt; walks through where the synonym files live, how the role graph is built, and how host hooks call the matcher. Write the checklist once; let the automaton enforce it on both sides of the call.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>knowledgegraph</category>
      <category>agents</category>
      <category>contextengineering</category>
    </item>
    <item>
      <title>Context Engineering: the book is out</title>
      <dc:creator>AlexMikhalev</dc:creator>
      <pubDate>Mon, 19 Oct 2026 10:58:34 +0000</pubDate>
      <link>https://dev.to/alexmikhalev/context-engineering-the-book-is-out-4mpa</link>
      <guid>https://dev.to/alexmikhalev/context-engineering-the-book-is-out-4mpa</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fimg24xtlfdzw3bcrqiw5.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fimg24xtlfdzw3bcrqiw5.jpg" alt="Context Engineering book cover: Designing AI That Understands, Remembers, Acts and Learns, Dr Alexander Mikhalev" width="800" height="1280"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Most AI systems don't fail because the model is wrong.&lt;/p&gt;

&lt;p&gt;They fail because the context is.&lt;/p&gt;

&lt;p&gt;But here's the uncomfortable part: context engineering isn't a new activity. We've been doing it for decades under different names:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Configuration management gave us baselines and change control. Systems engineering gave us decision gates and requirements traceability.&lt;/li&gt;
&lt;li&gt;Domain-driven design gave us the ubiquitous language and bounded contexts. The systems-thinking tradition gave us a method for building explanations rather than narratives.&lt;/li&gt;
&lt;li&gt;Then LLMs arrived, and a lot of that discipline was set aside. Context became "the prompt" — something to tweak, not something to version, validate and govern.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That's the argument in my book, Context Engineering: Designing AI That Understands, Remembers, Acts, and Learns.&lt;/p&gt;

&lt;p&gt;It isn't a new invention. It's an old discipline applied to a new kind of system — one where the "software" is partly prompts, partly knowledge, partly retrieval, partly policy, and partly the model's emergent behaviour.&lt;/p&gt;

&lt;p&gt;Inside, 25 chapters cover:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;why AI software fails differently — context drift, not crashes&lt;/li&gt;
&lt;li&gt;knowledge graphs as context infrastructure, and when deterministic search beats vector embeddings&lt;/li&gt;
&lt;li&gt;token budgets, compression and skill architecture&lt;/li&gt;
&lt;li&gt;judge harnesses, typed decision models and evidence lineage — how to make an AI's decisions inspectable&lt;/li&gt;
&lt;li&gt;validation gates, multi-agent context and enterprise governance&lt;/li&gt;
&lt;li&gt;building a context engineering practice&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It's written for senior developers, engineering managers and architects who need AI to be dependable in production, not just impressive in a demo.&lt;/p&gt;

&lt;p&gt;The book is out now on Kindle: &lt;a href="https://www.amazon.com/dp/B0HMZBWH5Q" rel="noopener noreferrer"&gt;amazon.com&lt;/a&gt; and &lt;a href="https://www.amazon.co.uk/dp/B0HMZBWH5Q" rel="noopener noreferrer"&gt;amazon.co.uk&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Which older discipline do you think AI teams have forgotten most?&lt;/p&gt;

</description>
      <category>ai</category>
      <category>book</category>
      <category>contextengineering</category>
      <category>knowledgegraphs</category>
    </item>
    <item>
      <title>3 Ways to Save Money on Tokens for Your AI Agents</title>
      <dc:creator>AlexMikhalev</dc:creator>
      <pubDate>Mon, 19 Oct 2026 09:25:58 +0000</pubDate>
      <link>https://dev.to/alexmikhalev/3-ways-to-save-money-on-tokens-for-your-ai-agents-ai7</link>
      <guid>https://dev.to/alexmikhalev/3-ways-to-save-money-on-tokens-for-your-ai-agents-ai7</guid>
      <description>&lt;p&gt;&lt;em&gt;Three levers we run in production: let a cheap model summarise the evidence, put expensive reasoning only where it earns its keep, and route every request through a proxy that knows the price of each lane.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Your agent bill is mostly input tokens. Not the clever parts: the re-reading.&lt;/p&gt;

&lt;p&gt;Every turn, a coding agent replays its entire transcript to the provider. Add a repository to explore and a handful of tool outputs, and a single session can carry a hundred thousand tokens of context that the model reads over and over at full price. The frontier model you are paying for spends most of its expensive attention budget on text it has already seen, or text a much cheaper model could have filtered first.&lt;/p&gt;

&lt;p&gt;We run a fleet of overnight coding agents on a single machine, so we feel this directly. Over the past few months we have landed on three levers that cut token spend without cutting output quality. Each one is running in production today, and each one comes with a caveat we will not hide: we have measured the mechanisms, not the end-to-end savings. The arithmetic below uses published prices and our own logs; treat it as illustrative, not invoiced.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Search first, let a cheap model summarise
&lt;/h2&gt;

&lt;p&gt;The most expensive way to give a frontier model context is to hand it raw search results. The cheapest way is to let a small model read them first.&lt;/p&gt;

&lt;p&gt;The pattern looks like this. A local search tool retrieves candidate chunks from your codebase or knowledge base. Before those chunks reach your GPT-6 or Fable-class session, a lower-cost model synthesises them into a compact answer, with deterministic references back to the source. The expensive model receives the synthesis and the few references it may need to reopen, not ten near-duplicate excerpts.&lt;/p&gt;

&lt;p&gt;We do this with &lt;code&gt;terraphim-grep&lt;/code&gt; (part of the open-source &lt;a href="https://github.com/terraphim/terraphim-clients" rel="noopener noreferrer"&gt;terraphim-clients&lt;/a&gt; repository), which resolves query terms through a curated knowledge-graph thesaurus before ranking local matches:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;OPENROUTER_MODEL&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'deepseek/deepseek-v4-flash-0731'&lt;/span&gt;

terraphim-grep provider &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--thesaurus&lt;/span&gt; docs/src/thesaurus.json &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--haystack&lt;/span&gt; code &lt;span class="nt"&gt;--paths&lt;/span&gt; crates &lt;span class="nt"&gt;-n&lt;/span&gt; 10 &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--answer&lt;/span&gt; &lt;span class="nt"&gt;--force-rlm&lt;/span&gt; &lt;span class="nt"&gt;--json&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;--answer&lt;/code&gt; requests an answer when the sufficiency check calls for one; &lt;code&gt;--force-rlm&lt;/code&gt; forces the synthesis path. Only the selected excerpts leave the machine, through OpenRouter to a DeepSeek-flash-class model. There is also &lt;code&gt;--search-only&lt;/code&gt;, which hard-disables synthesis and skips building the LLM client entirely, so a stray API key in the environment cannot cost a single network call.&lt;/p&gt;

&lt;p&gt;In our verified run, the raw chunk contents measured 505 characters, the evidence with source locations 1,108 characters, and the synthesised answer text 440 characters: the frontier model received about 40% of the context it would otherwise have been fed, with references it could reopen on demand.&lt;/p&gt;

&lt;p&gt;Two honest caveats. First, we measured characters, not tokens: the CLI does not expose token usage, so treat the ratio as directional. Second, the win is conditional on the handoff shape. The full answer object with all ten references measured 1,918 characters; forward that wholesale and the saving evaporates. Pass the synthesis plus the references needed for verification, nothing more.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Put expensive reasoning at the edges of the V, not in the middle
&lt;/h2&gt;

&lt;p&gt;The second lever is not a tool but a lifecycle decision: match the model's price to the phase of work.&lt;/p&gt;

&lt;p&gt;We structure agent work as a V-model. The left side asks "what should we build" (research, design, specification); the right side asks "did we build it correctly" (review, validation, judge panels). The long middle (implementation, test-writing, mechanical verification loops) is where most of the tokens burn, and it is precisely the part that needs the least reasoning depth.&lt;/p&gt;

&lt;p&gt;So we split the model placement:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Edges get the expensive models.&lt;/strong&gt; Research synthesis, architecture decisions, and final review stay on high-reasoning lanes, because a bad plan or a rubber-stamped review costs more than the tokens save.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The middle runs on fast delivery models.&lt;/strong&gt; Implementation and test loops run on grok, MiniMax, or Kimi highspeed lanes over flat-rate subscriptions. Our overnight agents execute on &lt;code&gt;opencode-go&lt;/code&gt; subscription models; our judge panels run on Kimi K2.5, which reaches 90% verdict agreement with human reviewers at around nine seconds per review.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The arithmetic is worth doing once. At published API prices, an illustrative workload of 100 million input and 20 million output tokens costs $800 if everything runs on a frontier model. Route 80% of it to a mid-tier model and the same token volume costs $480: 40% less, with the model count unchanged. That is a counterfactual at published prices, not a measured bill, but the shape of the saving is real: you are not paying for fewer tokens, you are paying less per token for the phases that do not need frontier reasoning.&lt;/p&gt;

&lt;p&gt;The catch is discipline. Left to itself, an agent uses whatever model it started on for everything. The phases have to be explicit, which is why this lever only works inside a structured lifecycle rather than a free-running session.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Put a proxy in front of the providers
&lt;/h2&gt;

&lt;p&gt;The third lever makes the cheap route the default: an LLM proxy between the agent and every provider, routing each request by what it contains or how fast each lane currently is.&lt;/p&gt;

&lt;p&gt;Ours is &lt;code&gt;terraphim-llm-proxy&lt;/code&gt;, shared with our &lt;a href="https://github.com/sponsors/terraphim" rel="noopener noreferrer"&gt;GitHub Sponsors&lt;/a&gt; supporters. It sits on localhost, exposes OpenAI and Anthropic compatible endpoints, and decides where each request goes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Keyword routing.&lt;/strong&gt; The proxy matches prompt content against a markdown taxonomy using Aho-Corasick string matching (microsecond overhead, the same crate our knowledge graph uses). A prompt that says "think step by step about this architecture" routes to the &lt;code&gt;think&lt;/code&gt; chain regardless of the model ID the client requested. In our logs, three consecutive requests landed on three different providers under three different scenarios, transparently to the client.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Speed and price routing.&lt;/strong&gt; Eligible candidates can be ranked by time to first token, or by cost class: free lanes first, then subscription, then metered. Per scenario you choose whether latency or price wins. Agent idle time waiting on a rate limit is a real cost, just billed in hours rather than tokens.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Fallback chains make the cheap lanes safe.&lt;/strong&gt; Cheap providers have real reliability gaps: silent API format changes, undocumented capacity errors, higher latency from Europe. Pipe-delimited fallback chains mean a dead provider just moves the request to the next target. We verify this with deliberate failure injection (pointing the primary provider's domain at localhost in &lt;code&gt;/etc/hosts&lt;/code&gt;) rather than trusting the config.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;One caveat that took us by surprise: &lt;strong&gt;prompt caches are per model, not per session&lt;/strong&gt;. Measured across real coding sessions, 82% of mid-session model switches collapsed the cache read below 10% of its previous value: a warm 107,000-token prefix became 110,000 tokens of uncached input, roughly ten times the cached price for the same text. The saving pattern is therefore to route the session or the scenario, not each turn at random. Pick a lane for the job and stay on it.&lt;/p&gt;

&lt;h2&gt;
  
  
  What we do not claim
&lt;/h2&gt;

&lt;p&gt;Token savings are not measured end-to-end. The synthesis example is measured in characters, not tokens; the model-mix example is arithmetic at published prices, not an invoice; the 82% cache-collapse figure comes from one operator's session logs, not a fleet benchmark. The honest metric is quality-adjusted cost per accepted task, and we are still building the instrumentation to report it.&lt;/p&gt;

&lt;p&gt;What we can claim is mechanism: retrieval that filters before the expensive model reads, a lifecycle that spends reasoning budget where judgement lives, and a proxy that prices the lanes before it forwards the request. None of these require trusting a benchmark. All three are running today.&lt;/p&gt;

&lt;p&gt;The underlying pieces have full write-ups: &lt;a href="https://terraphim.ai/posts/skill-spotlight-terraphim-grep/" rel="noopener noreferrer"&gt;terraphim-grep and role-aware search&lt;/a&gt; and &lt;a href="https://terraphim.ai/posts/disciplined-engineering-ai-systems/" rel="noopener noreferrer"&gt;the V-model for AI agents&lt;/a&gt;. The grep tooling is in &lt;a href="https://github.com/terraphim/terraphim-clients" rel="noopener noreferrer"&gt;terraphim-clients&lt;/a&gt;. The routing proxy from section 3 is &lt;code&gt;terraphim-llm-proxy&lt;/code&gt;, shared with &lt;a href="https://github.com/sponsors/terraphim" rel="noopener noreferrer"&gt;GitHub Sponsors&lt;/a&gt; supporters. If you want this running inside your team rather than as homework, we do it as part of our consulting work at &lt;a href="https://zestic.ai" rel="noopener noreferrer"&gt;zestic.ai&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>agents</category>
      <category>llm</category>
      <category>engineering</category>
    </item>
    <item>
      <title>Testing a learning hook from failed command to real execution</title>
      <dc:creator>AlexMikhalev</dc:creator>
      <pubDate>Tue, 13 Oct 2026 08:55:34 +0000</pubDate>
      <link>https://dev.to/alexmikhalev/testing-a-learning-hook-from-failed-command-to-real-execution-4bgn</link>
      <guid>https://dev.to/alexmikhalev/testing-a-learning-hook-from-failed-command-to-real-execution-4bgn</guid>
      <description>&lt;h2&gt;
  
  
  Update: what the model requested, and what actually ran
&lt;/h2&gt;

&lt;p&gt;The hook rewrites the command; OpenCode executes it. I extended the included adapter so one execution record now links the original request, matching compiled rule ID and graph hash, final executed command, tool result and saved output file. The result file carries the same execution ID and its SHA-256 is checked.&lt;/p&gt;

&lt;p&gt;The new 66-second demo uses actual saved outputs and synthetic British narration. All 22 regression tests pass, and the downloadable ZIP was extracted and run again with released terraphim-agent 1.21.19 and OpenCode 2.0.20. The adapter source is version 2.0.0; this covers the public example’s sequential whole-command mapping.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://terraphim.ai/how-tos/command-rewriting-howto/" rel="noopener noreferrer"&gt;Watch the new demo&lt;/a&gt; · &lt;a href="https://terraphim.ai/demos/hooks-execution-evidence/terraphim-hooks-execution-evidence-v2.zip" rel="noopener noreferrer"&gt;Download the source, tests and saved evidence&lt;/a&gt; · &lt;a href="https://terraphim.ai/demos/hooks-execution-evidence/execution-receipt.json" rel="noopener noreferrer"&gt;Inspect the execution receipt&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The original walkthrough below retains its original recorded outputs.&lt;/p&gt;




&lt;p&gt;The adapter normalizes OpenCode V2 after-tool events for learn hook and applies the pre-tool result through mutable event.input. A failure-record correction is explicitly promoted to a tool-preference record, then compiled to the role thesaurus. Returned JSON and actual shell execution are verified separately.&lt;/p&gt;

&lt;p&gt;A coding agent uses the wrong flag. You explain the correction, and the command works. The useful question is what happens when another session makes the same mistake.&lt;/p&gt;

&lt;p&gt;This walkthrough follows one harmless error from failure to saved correction to actual execution. It uses the Harbour project brief from the &lt;a href="https://terraphim.ai/posts/cold-start-tax-agentic-memory/" rel="noopener noreferrer"&gt;memory walkthrough&lt;/a&gt;, a released Terraphim agent, and an OpenCode adapter included in the download.&lt;/p&gt;

&lt;p&gt;Watch the narrated demonstration: &lt;a href="https://terraphim.ai/how-tos/command-rewriting-howto/" rel="noopener noreferrer"&gt;https://terraphim.ai/how-tos/command-rewriting-howto/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://terraphim.ai/demos/agent-hooks/harbour-hooks-example.zip" rel="noopener noreferrer"&gt;Download the Harbour hooks example&lt;/a&gt; · &lt;a href="https://terraphim.ai/demos/agent-hooks/transcript.txt" rel="noopener noreferrer"&gt;Read the transcript&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Start with the command that fails
&lt;/h2&gt;

&lt;p&gt;Harbour's validator checks that its brief contains a decision, a risk and an owner. The correct command ends with &lt;code&gt;--check&lt;/code&gt;. In the baseline run, OpenCode actually attempts:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python3 validate-brief.py &lt;span class="nt"&gt;--chek&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The argument is misspelled. Python's argument parser reports that &lt;code&gt;--check&lt;/code&gt; is required and exits with status 2. No &lt;code&gt;validation.json&lt;/code&gt; is created. The downloadable trace contains the host's actual tool result, including that output and exit status.&lt;/p&gt;

&lt;p&gt;That distinction matters: the coding host itself can finish normally after reporting a failed tool. Its overall process exit code is not evidence that the validator succeeded. Here we inspect the shell tool's result and the expected output file.&lt;/p&gt;

&lt;h2&gt;
  
  
  Capture the failure that really happened
&lt;/h2&gt;

&lt;p&gt;The included project-local adapter receives OpenCode's after-tool event. It translates the real command, combined output and exit status into Terraphim's learning-hook schema, then calls the released agent.&lt;/p&gt;

&lt;p&gt;The saved Markdown learning contains the command, exit code 2 and the parser's actual error. A new CLI process can list it again. This gives the correction a concrete source: an observed failure, with a saved record that can be inspected.&lt;/p&gt;

&lt;p&gt;The adapter is part of this example. In the tested release, passing a native OpenCode event directly with &lt;code&gt;--format opencode&lt;/code&gt; does not by itself establish that a learning was captured. The script checks the resulting file and later readback.&lt;/p&gt;

&lt;h2&gt;
  
  
  Review and promote the correction
&lt;/h2&gt;

&lt;p&gt;We add the intended command to the failure record with &lt;code&gt;learn correct&lt;/code&gt;. That records a proposed correction. It does not automatically make it a replacement rule: compiling the failure record alone produces zero correction entries in this release.&lt;/p&gt;

&lt;p&gt;The next step is explicit human review and promotion to a tool preference. The reproduction script runs this command inside its isolated store:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;terraphim-agent learn correction add &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--correction-type&lt;/span&gt; tool-preference &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--original&lt;/span&gt; &lt;span class="s1"&gt;'python3 validate-brief.py --chek'&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--corrected&lt;/span&gt; &lt;span class="s1"&gt;'python3 validate-brief.py --check'&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--context&lt;/span&gt; &lt;span class="s1"&gt;'Manually reviewed correction from the captured failure'&lt;/span&gt;
terraphim-agent learn compile &lt;span class="nt"&gt;--output&lt;/span&gt; compiled-corrections.json
terraphim-agent learn export-kg &lt;span class="nt"&gt;--output&lt;/span&gt; kg
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Compilation now reports one correction. The selected &lt;strong&gt;Harbour Validator&lt;/strong&gt; role loads that compiled JSON. The exported Markdown makes the relationship readable:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="gh"&gt;# python3 validate-brief.py --check&lt;/span&gt;
synonyms:: python3 validate-brief.py --chek
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This uses the same explicit &lt;code&gt;synonyms::&lt;/code&gt; idea as the &lt;a href="https://terraphim.ai/how-tos/synonym-search/" rel="noopener noreferrer"&gt;editor-to-search flow&lt;/a&gt;. The correction says which command this project prefers. In this walkthrough the hook reads the compiled JSON; exporting a Markdown file alone is not the activation step.&lt;/p&gt;

&lt;h2&gt;
  
  
  Inspect the hook before involving execution
&lt;/h2&gt;

&lt;p&gt;First we call the pre-tool hook on a saved input. Without &lt;code&gt;--rewrite&lt;/code&gt;, the returned command keeps &lt;code&gt;--chek&lt;/code&gt; and includes a warning about a replaceable match. With &lt;code&gt;--rewrite&lt;/code&gt;, the returned JSON contains:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"tool_input"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;"command"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"python3 validate-brief.py --check"&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"tool_name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Bash"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That is a hook result. It has not executed Python. The example retains both results so you can compare the disabled and enabled behavior. An unrelated command and a role without this correction remain unchanged.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F8uobg8gnbq3m50b56i0e.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F8uobg8gnbq3m50b56i0e.jpg" alt="The actual hook outputs preserve the typo with rewriting disabled and return the corrected command with rewriting enabled" width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Verify what the coding host actually runs
&lt;/h2&gt;

&lt;p&gt;Now start a fresh OpenCode process and ask it to try the same misspelled command. Its before-tool event reaches the adapter. The adapter calls Terraphim with rewriting enabled, then applies the returned command through OpenCode V2's mutable tool input.&lt;/p&gt;

&lt;p&gt;The after-tool event records &lt;code&gt;python3 validate-brief.py --check&lt;/code&gt;. Its exit status is 0. The validator prints a valid Harbour result and writes this file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"project"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Harbour"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"status"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"valid"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"fields"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"Decision"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Risk"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Owner"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The host transcript can still display the model's original attempted input. That is why the download includes adapter events, the actual tool result and &lt;code&gt;validation.json&lt;/code&gt;, as well as the transcript. Together they show the attempted command, the applied correction and the resulting execution.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F1ehtidje94i0xfo9tp48.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F1ehtidje94i0xfo9tp48.jpg" alt="The real after-tool event and saved validation JSON confirm exit zero and the expected Harbour fields" width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Reproduce it in a new folder
&lt;/h2&gt;

&lt;p&gt;The example was verified with &lt;a href="https://github.com/terraphim/terraphim-clients/releases/tag/v1.21.19" rel="noopener noreferrer"&gt;terraphim-agent v1.21.19&lt;/a&gt; and OpenCode 2.0.20. Follow the ZIP's README to check the release archive, choose your already authenticated coding model and run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python3 reproduce.py &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--agent&lt;/span&gt; /absolute/path/to/terraphim-agent &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--model&lt;/span&gt; kimi-code-plan-global/k3 &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--output&lt;/span&gt; /absolute/path/to/a-new-harbour-run
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use your configured model identifier if it differs. The script uses a new folder for the fixture, settings, learning store and project-local adapter. It does not install global hooks or select a paid fallback. The recorded run used the existing Kimi coding-plan route.&lt;/p&gt;

&lt;p&gt;Read &lt;code&gt;evidence/verification.json&lt;/code&gt;, the host events and &lt;code&gt;validation.json&lt;/code&gt;. The script fails if the host does not perform the expected command or the saved outputs do not match. You can inspect the source before running it; only the two local validator commands are permitted by the fixture's host configuration.&lt;/p&gt;

&lt;h2&gt;
  
  
  Keep the scope of the example visible
&lt;/h2&gt;

&lt;p&gt;This demonstrates one reviewed correction with one tested host adapter. It does not prove every coding host applies the same JSON, or that failure capture should automatically approve arbitrary substitutions. The earlier memory example and this learning store also remain separate; neither silently copies into the other.&lt;/p&gt;

&lt;p&gt;Use public sample data for this release's learning capture. Tests with deliberately fake secret-shaped values found redaction gaps in saved command and working-directory fields, and in some hook passthrough values. The example makes no blanket secret-redaction claim. The coding host uses its configured online model; Terraphim's demonstrated correction lookup uses the local compiled graph.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://terraphim.ai/demos/agent-hooks/harbour-hooks-example.zip" rel="noopener noreferrer"&gt;Download the example and saved outputs&lt;/a&gt; to follow the whole chain: a failure that happened, a correction someone reviewed, and a later command whose result can be checked.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Updated 13 October 2026. The video uses synthetic British female narration and readable excerpts from actual released-binary and host outputs. The Harbour project is fictional public sample data.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>agents</category>
      <category>coding</category>
      <category>learning</category>
    </item>
    <item>
      <title>Testing authored memory across fresh CLI processes</title>
      <dc:creator>AlexMikhalev</dc:creator>
      <pubDate>Tue, 13 Oct 2026 08:25:25 +0000</pubDate>
      <link>https://dev.to/alexmikhalev/testing-authored-memory-across-fresh-cli-processes-4fmk</link>
      <guid>https://dev.to/alexmikhalev/testing-authored-memory-across-fresh-cli-processes-4fmk</guid>
      <description>&lt;p&gt;The example separates persistence from retrieval: an evolution-store record survives process exit, while a role thesaurus and co-occurrence graph select relevant memory items. Nine assertions check exact capture/readback/export, useful retrieval and negative controls. Roles are retrieval filters, not access controls.&lt;/p&gt;

&lt;p&gt;You explain the project's validation command. The session ends. Next time, the agent needs the same explanation. Keeping the instruction somewhere is useful only if the next run can find the right instruction again.&lt;/p&gt;

&lt;p&gt;This walkthrough saves one lesson from a fictional project, opens it in a new process, and retrieves it through a small knowledge graph. You can inspect the exact saved text and repeat the same checks with the downloadable example.&lt;/p&gt;

&lt;p&gt;Watch the narrated demonstration: &lt;a href="https://terraphim.ai/posts/cold-start-tax-agentic-memory/" rel="noopener noreferrer"&gt;https://terraphim.ai/posts/cold-start-tax-agentic-memory/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://terraphim.ai/demos/agent-memory/harbour-memory-example.zip" rel="noopener noreferrer"&gt;Download the Harbour example&lt;/a&gt; · &lt;a href="https://terraphim.ai/demos/agent-memory/transcript.txt" rel="noopener noreferrer"&gt;Read the transcript&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Start with an instruction worth keeping
&lt;/h2&gt;

&lt;p&gt;Harbour is a small public project brief. It records a decision, a risk and an owner. Before publication, its validator checks that all three fields are present. The instruction we want the next session to remember is deliberately specific:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Validate the Harbour project brief with python3 validate-brief.py --check.
Keep the source decisions in brief.md intact.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That gives a future agent an action and a boundary. “Remember to be careful” would be much harder to use. The example also includes the brief and validator, so the instruction has something concrete to refer to.&lt;/p&gt;

&lt;p&gt;The first step is to save this actual text. Download and extract the example, then install &lt;a href="https://github.com/terraphim/terraphim-clients/releases/tag/v1.21.20" rel="noopener noreferrer"&gt;terraphim-agent v1.21.20&lt;/a&gt;. From the example folder, prepare a new, isolated run before entering the manual commands below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python3 reproduce.py &lt;span class="nt"&gt;--agent&lt;/span&gt; /path/to/terraphim-agent &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--output&lt;/span&gt; ./harbour-run &lt;span class="nt"&gt;--prepare-only&lt;/span&gt;
&lt;span class="nb"&gt;cd &lt;/span&gt;harbour-run/fixture
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;TERRAPHIM_DEFAULT_DATA_PATH&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; .. &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;pwd&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;/data"&lt;/span&gt;
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;TERRAPHIM_SETTINGS_PATH&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; .. &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;pwd&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;/settings"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use your actual binary path in the first command and put that same verified binary on your PATH for the remaining commands. Preparation creates the role configuration, settings and &lt;code&gt;lesson.md&lt;/code&gt;; it has not captured anything yet. To run all checks automatically instead, omit &lt;code&gt;--prepare-only&lt;/code&gt; and choose a fresh output folder.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;terraphim-agent &lt;span class="nt"&gt;--format&lt;/span&gt; json memory capture &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--file&lt;/span&gt; lesson.md &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--provenance-tag&lt;/span&gt; harbour-public-brief-v1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Capture returns a memory identifier. We use that identifier to inspect the saved item, rather than treating a successful exit code as the whole result. The saved content is the lesson itself, and the provenance tag identifies which public example supplied it.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;--content&lt;/code&gt; accepts a short instruction directly. &lt;code&gt;--file&lt;/code&gt; is convenient for a multiline note. Both preserve the supplied text. Missing, blank, unreadable or conflicting inputs fail without creating a substitute placeholder.&lt;/p&gt;

&lt;h2&gt;
  
  
  End the process, then open the memory
&lt;/h2&gt;

&lt;p&gt;Each command in the demonstration starts a new process. After capture exits, &lt;code&gt;memory show&lt;/code&gt; opens the saved identifier. &lt;code&gt;memory list&lt;/code&gt; finds the item, and &lt;code&gt;memory export&lt;/code&gt; includes the same instruction in JSON.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;terraphim-agent &lt;span class="nt"&gt;--format&lt;/span&gt; json memory show MEMORY_ID
terraphim-agent &lt;span class="nt"&gt;--format&lt;/span&gt; json memory list
terraphim-agent memory &lt;span class="nb"&gt;export&lt;/span&gt; &lt;span class="nt"&gt;--format&lt;/span&gt; json &lt;span class="nt"&gt;--output&lt;/span&gt; memories.json
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Replace &lt;code&gt;MEMORY_ID&lt;/code&gt; with the identifier returned by capture. The reproduction script does this automatically and checks that the reopened and exported text exactly matches &lt;code&gt;lesson.md&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fvmurz1cq9dzy6kvtbvks.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fvmurz1cq9dzy6kvtbvks.jpg" alt="A new process displays the exact saved Harbour instruction and its provenance tag" width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The store has an explicit location. The example sets &lt;code&gt;TERRAPHIM_DEFAULT_DATA_PATH&lt;/code&gt; to a new folder for that run; the evolution file lives beneath &lt;code&gt;terraphim/evolution/cli-agent.json&lt;/code&gt;. A second empty folder supplies the independent-store check. This keeps the demonstration separate from your existing memory files.&lt;/p&gt;

&lt;p&gt;Without an explicit data root, the agent retains its usual platform configuration-directory location. Changing the root selects another store; it does not silently migrate or merge your previous one.&lt;/p&gt;

&lt;h2&gt;
  
  
  Teach the role the words used by the project
&lt;/h2&gt;

&lt;p&gt;Knowing an identifier is useful for inspection. Day to day, you are more likely to ask a question such as “validate brief”. The &lt;strong&gt;Brief Reviewer&lt;/strong&gt; role supplies the terminology for that question.&lt;/p&gt;

&lt;p&gt;Its small graph has a &lt;strong&gt;Brief validation&lt;/strong&gt; concept:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="gh"&gt;# Brief validation&lt;/span&gt;
synonyms:: validate brief, brief validation, --check
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A second concept describes the &lt;strong&gt;Project brief&lt;/strong&gt;, including &lt;code&gt;brief.md&lt;/code&gt;. Both definitions are ordinary Markdown in the download. The saved instruction mentions these concepts, connecting an action with the document it applies to.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;synonyms::&lt;/code&gt; property makes the relationship visible: “validate brief” and &lt;code&gt;--check&lt;/code&gt; are labels for the same concept in this project. You can review or change that relationship. Saving a memory does not invent new terminology or update every other role automatically.&lt;/p&gt;

&lt;p&gt;This is the same explicit-knowledge principle used in the &lt;a href="https://terraphim.ai/how-tos/synonym-search/" rel="noopener noreferrer"&gt;editor-to-search example&lt;/a&gt;: record the relationship, then use the configured graph to find relevant work. Here the searched material is an authored memory item.&lt;/p&gt;

&lt;h2&gt;
  
  
  Retrieve the instruction, then check the empty cases
&lt;/h2&gt;

&lt;p&gt;With the example's role configuration loaded, this query retrieves the stored lesson:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;terraphim-agent &lt;span class="nt"&gt;--config&lt;/span&gt; ../config.json memory retrieve &lt;span class="s1"&gt;'validate brief'&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--role&lt;/span&gt; &lt;span class="s1"&gt;'Brief Reviewer'&lt;/span&gt; &lt;span class="nt"&gt;--format&lt;/span&gt; json
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The result includes the original text, its memory identifier, the provenance tag and a matched concept. It is a retrieved instruction, not a generated paraphrase. The viewer can compare it directly with the file that was captured.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fmwf28yixgoi5osqr6f28.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fmwf28yixgoi5osqr6f28.jpg" alt="The Brief Reviewer retrieves one saved lesson while unrelated-query, other-role and empty-store controls return zero" width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The accompanying controls matter just as much. “Volcanic eruption” returns no memory. The &lt;strong&gt;Finance Reviewer&lt;/strong&gt; role, which has budget and grant concepts, does not match the validation query. The same useful query against a separate empty store also returns nothing.&lt;/p&gt;

&lt;p&gt;Those observations distinguish useful retrieval from a command that always prints the latest note. Roles shape which concepts are recognised. They are not an access-control system: use separate stores and ordinary filesystem permissions where separation is required.&lt;/p&gt;

&lt;h2&gt;
  
  
  What happens inside the CLI
&lt;/h2&gt;

&lt;p&gt;The agent stores the lesson using Terraphim's existing evolution types. During retrieval, the role's thesaurus matches terms, and the role graph ranks memory items by their concept relationships. There is no lexical fallback when a question matches none of the configured concepts.&lt;/p&gt;

&lt;p&gt;This graph uses co-occurrence edges, so the example intentionally connects validation with the project brief. A single isolated concept is not enough to assume the same retrieval behavior. Keep the graph and the note inspectable, and test the questions people will actually ask.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;memory apply&lt;/code&gt; can preview proposed context for a prompt. That preview does not execute a command or prove a coding host consumed it. The separate hooks walkthrough will follow the instruction into actual execution. Captured memories and reviewed learning corrections also use different stores; neither is an automatic copy of the other.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try the next run yourself
&lt;/h2&gt;

&lt;p&gt;The ZIP contains the public brief, validator, lesson, Markdown concepts, reproduction script and saved outputs. Follow its README to verify the released binary, create an isolated run and compare the positive and negative results. The script checks the saved content, rather than relying on expected screenshots.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://terraphim.ai/demos/agent-memory/harbour-memory-example.zip" rel="noopener noreferrer"&gt;Download and reproduce the memory example&lt;/a&gt;. You can also inspect the &lt;a href="https://terraphim.ai/demos/agent-memory/manifest.json" rel="noopener noreferrer"&gt;saved outputs and verification manifest&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The useful result here is modest and concrete: an instruction survives the process that captured it, and the intended project terminology can find it again. Measuring whether that saves tokens or improves later decisions needs a separate experiment.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Updated 13 October 2026 with a reproducible walkthrough. The broader memory-lifecycle vocabulary was inspired by &lt;a href="https://www.memco.ai/field-guide" rel="noopener noreferrer"&gt;memco.ai's field guide&lt;/a&gt;. The video uses synthetic British female narration and readable views of actual CLI outputs. The Harbour fixture is public sample data.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>agents</category>
      <category>cli</category>
      <category>testing</category>
    </item>
    <item>
      <title>From editor alternatives to synonym-aware search with Terraphim</title>
      <dc:creator>AlexMikhalev</dc:creator>
      <pubDate>Mon, 12 Oct 2026 10:45:02 +0000</pubDate>
      <link>https://dev.to/alexmikhalev/from-editor-alternatives-to-synonym-aware-search-with-terraphim-12g9</link>
      <guid>https://dev.to/alexmikhalev/from-editor-alternatives-to-synonym-aware-search-with-terraphim-12g9</guid>
      <description>&lt;p&gt;&lt;a href="https://x.com/jasonfried/status/2105403067793584590" rel="noopener noreferrer"&gt;Jason Fried shared a video of Write_On&lt;/a&gt;, and it clicked. I had a Terraphim Editor built in Rust and WebAssembly that I’d abandoned two years ago. His idea of “alternative control” gave me a meaningful way to return to it: keep the alternatives we choose while writing connected to a knowledge graph, then use that same graph to find our work. Now I can finish the editor with a clear purpose.&lt;/p&gt;

&lt;p&gt;I’m building Terraphim around a small frustration in knowledge work: we change our words, then lose track of the ideas behind them.&lt;/p&gt;

&lt;p&gt;A project brief calls something a risk. A colleague asks about their concerns. A literal search can miss the useful decision sitting beside the word neither person remembered to type.&lt;/p&gt;

&lt;p&gt;We made an 80-second demonstration of a different flow. It starts with choosing a word in an editor and ends with finding a decision from the command line. The connection is an explicit, exportable knowledge graph.&lt;/p&gt;

&lt;p&gt;  &lt;iframe src="https://www.youtube.com/embed/zZWjuqqVN4I" width="710" height="399"&gt;
  &lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;&lt;a href="https://terraphim.ai/how-tos/synonym-search/" rel="noopener noreferrer"&gt;Try the editor and download the actual files&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Start with the sentence
&lt;/h2&gt;

&lt;p&gt;The example is a public community garden brief. Timber might arrive late, rain might delay planting, and volunteers might cancel. Each risk has a decision beside it: keep a backup supplier, reserve a covered area, or keep a reserve list.&lt;/p&gt;

&lt;p&gt;In Terraphim Editor, I add “Concern” as an alternative to “Risk”. I can swap between the two without losing the other wording. For the final clean document, I keep “Risk”. The word “Concern” is absent.&lt;/p&gt;

&lt;p&gt;That last detail matters. Otherwise a successful search for “concern” could simply be a literal match dressed up as a knowledge-graph demonstration.&lt;/p&gt;

&lt;h2&gt;
  
  
  Make the relationship inspectable
&lt;/h2&gt;

&lt;p&gt;The editor’s Knowledge graph export shows the authored relationship:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;synonyms:: Risk, Concern&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Those alternatives refer to the same idea in this document. I download the graph as a Terraphim thesaurus and export the clean text. This is an explicit sharing step; creating an alternative does not silently change every role or every other application’s graph.&lt;/p&gt;

&lt;p&gt;The downloads are part of the demonstration. You can inspect the graph, reopen the Markdown with alternatives, and compare it with the clean brief.&lt;/p&gt;

&lt;h2&gt;
  
  
  Search with the meaning you just recorded
&lt;/h2&gt;

&lt;p&gt;I pass that exported graph to terraphim-grep:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;terraphim-grep concern &lt;span class="nt"&gt;--thesaurus&lt;/span&gt; knowledge-graph.json &lt;span class="nt"&gt;--paths&lt;/span&gt; corpus &lt;span class="nt"&gt;-C&lt;/span&gt; 2 &lt;span class="nt"&gt;--search-only&lt;/span&gt; &lt;span class="nt"&gt;--json&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It finds all three “Risk” passages and the decisions next to them, even though “Concern” does not appear in the clean text.&lt;/p&gt;

&lt;p&gt;The released-binary verification also includes a baseline. With the editor’s default role, which does not contain this authored synonym, the query returns zero passages. Supplying the exported graph produces three. That makes the effect of sharing the synonym visible.&lt;/p&gt;

&lt;h2&gt;
  
  
  Decide whether you need a generated answer
&lt;/h2&gt;

&lt;p&gt;Search alone gives the source passages and their locations. Replace &lt;code&gt;--search-only&lt;/code&gt; with &lt;code&gt;--answer&lt;/code&gt; to request synthesis from your configured model provider.&lt;/p&gt;

&lt;p&gt;The paired results retrieve the same three passages. The generated answer adds a summary with references; it does not replace the evidence. It also should not turn a decision into a completed action. “Keep a backup supplier” is a recorded decision, not proof that someone has already contacted one.&lt;/p&gt;

&lt;p&gt;Editing and local retrieval run locally. Optional synthesis sends the retrieved passages to the configured provider. A fresh answer may use different wording.&lt;/p&gt;

&lt;h2&gt;
  
  
  Open the same example in Obsidian
&lt;/h2&gt;

&lt;p&gt;The &lt;a href="https://terraphim.ai/how-tos/synonym-search/#try-it-with-an-obsidian-vault" rel="noopener noreferrer"&gt;Obsidian walkthrough&lt;/a&gt; now includes a &lt;a href="https://terraphim.ai/demos/obsidian-synonym-search/obsidian-synonym-search-example.zip" rel="noopener noreferrer"&gt;downloadable sample vault&lt;/a&gt; and an actual screenshot from the installed app.&lt;/p&gt;

&lt;p&gt;The raw &lt;code&gt;synonyms:: Risk, Concern&lt;/code&gt; property lives in &lt;code&gt;Notes/Risk.md&lt;/code&gt;. The separate project brief contains “Risk” and no literal “Concern”. The search-results note contains only saved CLI passages; it does not define the synonyms.&lt;/p&gt;

&lt;p&gt;Using released terraphim-grep 1.21.19 against &lt;code&gt;Notes/Projects&lt;/code&gt;, the baseline returns zero passages and the supplied synonym graph returns three exact passages at lines 7, 10 and 13. The concept note and saved results are outside that search corpus. The ZIP includes both graphs, source notes, actual outputs and a checksum manifest.&lt;/p&gt;

&lt;p&gt;Terraphim’s &lt;code&gt;synonyms::&lt;/code&gt; convention uses Logseq-compatible Markdown property syntax. Obsidian native aliases use YAML &lt;code&gt;aliases&lt;/code&gt;. This example passes the exported graph explicitly; saving the note does not automatically rebuild it. Obsidian displays saved CLI output, and this additional capture demonstrates retrieval only. The main narrated video separately compares synthesis off and on.&lt;/p&gt;

&lt;h2&gt;
  
  
  Open the same example in Logseq
&lt;/h2&gt;

&lt;p&gt;The &lt;a href="https://terraphim.ai/how-tos/synonym-search/#try-it-with-a-logseq-graph" rel="noopener noreferrer"&gt;Logseq walkthrough&lt;/a&gt; includes a &lt;a href="https://terraphim.ai/demos/logseq-synonym-search/logseq-synonym-search-example.zip" rel="noopener noreferrer"&gt;downloadable graph&lt;/a&gt; and a screenshot from Logseq 2.0.2. Import the included Markdown graph through &lt;strong&gt;Import existing notes → File to DB graph&lt;/strong&gt;, then open &lt;strong&gt;Risk&lt;/strong&gt; and the &lt;strong&gt;Concern search&lt;/strong&gt; sidebar.&lt;/p&gt;

&lt;p&gt;The Risk concept owns &lt;code&gt;alias:: Concern&lt;/code&gt; and &lt;code&gt;synonyms:: Risk, Concern&lt;/code&gt;; the project brief holds the decisions. Native Logseq aliases give a page another name. Terraphim uses the explicitly supplied editor-exported graph for the CLI search.&lt;/p&gt;

&lt;p&gt;Run released terraphim-grep 1.21.19 from the extracted &lt;code&gt;graph&lt;/code&gt; folder:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;terraphim-grep concern &lt;span class="nt"&gt;--thesaurus&lt;/span&gt; baseline-role.json &lt;span class="nt"&gt;--paths&lt;/span&gt; pages/Projects &lt;span class="nt"&gt;-C&lt;/span&gt; 2 &lt;span class="nt"&gt;--json&lt;/span&gt; &lt;span class="nt"&gt;--search-only&lt;/span&gt;
terraphim-grep concern &lt;span class="nt"&gt;--thesaurus&lt;/span&gt; knowledge-graph.json &lt;span class="nt"&gt;--paths&lt;/span&gt; pages/Projects &lt;span class="nt"&gt;-C&lt;/span&gt; 2 &lt;span class="nt"&gt;--json&lt;/span&gt; &lt;span class="nt"&gt;--search-only&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The baseline returns zero passages; the shared graph retrieves three decisions about a backup supplier, a covered area and a volunteer reserve list. The searched project notes never contain “concern”; concept definitions and saved results are outside the corpus. Logseq displays imported notes and saved CLI results. Its database import is a copy; the commands read the original Markdown folder.&lt;/p&gt;

&lt;p&gt;The graph-view screenshot shows the project brief connected to Risk, Start here and the saved-results page. Its arrows are native Logseq page links; the Risk note holds the synonym definition shared through the supplied Terraphim graph.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F1oe38kjpj2x3l5ni61qs.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F1oe38kjpj2x3l5ni61qs.jpg" alt="The actual Logseq graph view beside saved CLI passages" width="799" height="571"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Try the released VS Code extension and the Kilo example
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://marketplace.visualstudio.com/items?itemName=applied-knowledge-systems.terraphim-it" rel="noopener noreferrer"&gt;Install Terraphim for VS Code&lt;/a&gt;, then create an alternative, save your document and explicitly export its knowledge graph. Keep the graph separate from the clean text you search.&lt;/p&gt;

&lt;p&gt;The tutorial also includes a &lt;a href="https://terraphim.ai/how-tos/synonym-search/#see-the-same-workflow-in-kilo" rel="noopener noreferrer"&gt;44-second captioned replay of a saved Kilo integration run&lt;/a&gt;. Its &lt;a href="https://terraphim.ai/demos/kilo-synonym-search/kilo-synonym-search-example.zip" rel="noopener noreferrer"&gt;example ZIP&lt;/a&gt; contains the actual graph, annotated Markdown, clean brief and results from both search modes. The replay is silent and retains the versions used in that run; the candidate Kilo marketplace skills are still under review.&lt;/p&gt;

&lt;p&gt;Extract that ZIP and run these commands from its folder with released terraphim-grep 1.21.20:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;terraphim-grep Concern &lt;span class="nt"&gt;--thesaurus&lt;/span&gt; knowledge-graph.json &lt;span class="nt"&gt;--paths&lt;/span&gt; corpus &lt;span class="nt"&gt;-n&lt;/span&gt; 3 &lt;span class="nt"&gt;--search-only&lt;/span&gt; &lt;span class="nt"&gt;--json&lt;/span&gt;
terraphim-grep Concern &lt;span class="nt"&gt;--thesaurus&lt;/span&gt; knowledge-graph.json &lt;span class="nt"&gt;--paths&lt;/span&gt; corpus &lt;span class="nt"&gt;-n&lt;/span&gt; 3 &lt;span class="nt"&gt;--answer&lt;/span&gt; &lt;span class="nt"&gt;--json&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The first returns the source passages. The second uses your configured model provider to synthesize an answer from them. A fresh answer may differ from the saved example. I rechecked the downloaded graph and clean corpus with the released binary: an empty-graph baseline returned zero passages, and the exported synonym graph returned all three Risk passages. The corpus contains no literal Concern.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try the evidence, not just the video
&lt;/h2&gt;

&lt;p&gt;The tutorial includes the graph, clean brief, annotated Markdown, actual results with and without synthesis, captions, transcript, and a ZIP with reproduction instructions. Follow the included README to try the same search on your machine.&lt;/p&gt;

&lt;p&gt;“Grammarly for knowledge work” is the ambition: help with the wording now, and preserve enough meaning to make the work easier to find later.&lt;/p&gt;

&lt;p&gt;Which pairs of words cause missed searches in your project notes?&lt;/p&gt;

&lt;p&gt;Demo and reproducible downloads: &lt;a href="https://terraphim.ai/how-tos/synonym-search/" rel="noopener noreferrer"&gt;https://terraphim.ai/how-tos/synonym-search/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Disclosure: I work on Terraphim. The example is public sample input; the graph exports and search results are actual outputs. The video uses synthetic British female narration. This article was prepared with AI assistance and checked against the actual outputs.&lt;/p&gt;

</description>
      <category>rust</category>
      <category>opensource</category>
      <category>productivity</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Plug Terraphim Search into Claude Code and opencode (CLI First, MCP When You Need It)</title>
      <dc:creator>AlexMikhalev</dc:creator>
      <pubDate>Sat, 18 Apr 2026 08:53:07 +0000</pubDate>
      <link>https://dev.to/alexmikhalev/plug-terraphim-search-into-claude-code-and-opencode-cli-first-mcp-when-you-need-it-4404</link>
      <guid>https://dev.to/alexmikhalev/plug-terraphim-search-into-claude-code-and-opencode-cli-first-mcp-when-you-need-it-4404</guid>
      <description>&lt;p&gt;Your AI coding agent already has a knowledge graph. It is just not yours yet. The model knows GitHub, Stack Overflow, and the public training corpus -- it has no idea that in your project &lt;code&gt;npm&lt;/code&gt; should be &lt;code&gt;bun&lt;/code&gt;, that &lt;code&gt;RFP&lt;/code&gt; is shorthand for &lt;code&gt;acquisition need&lt;/code&gt;, or that the email about the Stripe receipt for the Obsidian licence lives in your Fastmail mailbox. This post shows the smallest path to fixing that for both &lt;a href="https://claude.com/claude-code" rel="noopener noreferrer"&gt;Claude Code&lt;/a&gt; and &lt;a href="https://opencode.ai" rel="noopener noreferrer"&gt;opencode&lt;/a&gt;, using &lt;a href="https://terraphim.ai" rel="noopener noreferrer"&gt;Terraphim&lt;/a&gt; and the three roles we have published over the last week (Terraphim Engineer, &lt;a href="https://terraphim.ai/posts/personal-assistant-role-jmap-obsidian/" rel="noopener noreferrer"&gt;Personal Assistant&lt;/a&gt;, &lt;a href="https://terraphim.ai/posts/system-operator-logseq-knowledge-graph/" rel="noopener noreferrer"&gt;System Operator&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;Two paths. CLI first.&lt;/p&gt;

&lt;h2&gt;
  
  
  What "integrate" means here
&lt;/h2&gt;

&lt;p&gt;The host -- Claude Code or opencode -- needs a way to ask your role-aware Terraphim setup a question and get back ranked, source-attributed results. The model decides when to ask. The role decides which haystacks to search. Terraphim's &lt;code&gt;terraphim-graph&lt;/code&gt; ranker decides which results come back first.&lt;/p&gt;

&lt;p&gt;Concrete example. You are working in opencode and you type:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/tsearch "System Operator" RFP
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The slash command runs against the System Operator role. The role's knowledge graph normalises &lt;code&gt;RFP&lt;/code&gt; to its INCOSE-canonical form &lt;code&gt;acquisition need&lt;/code&gt;. The Aho-Corasick matcher walks the role's haystack (1,347 Logseq pages from the &lt;a href="https://github.com/terraphim/system-operator" rel="noopener noreferrer"&gt;terraphim/system-operator&lt;/a&gt; repository). The top hit comes back ranked 13 -- &lt;code&gt;Acquisition need.md&lt;/code&gt; -- with the &lt;code&gt;synonyms::&lt;/code&gt; line that mapped your query to it visible in the snippet. The model now has the right page in its context window and can answer your follow-up without a hallucinated INCOSE handbook reference.&lt;/p&gt;

&lt;p&gt;This works in both hosts because both speak the same two integration languages: shell-out slash commands and MCP servers. We are going to use both.&lt;/p&gt;

&lt;h2&gt;
  
  
  Path A -- CLI via slash command
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Why this is the recommended starting point
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;terraphim-agent&lt;/code&gt; already exists, takes &lt;code&gt;--role&lt;/code&gt; and &lt;code&gt;--limit&lt;/code&gt;, and writes ranked results to stdout. There is nothing to build. Both Claude Code and opencode let slash commands shell out via Bash. So a two-line command file is the entire integration.&lt;/p&gt;

&lt;h3&gt;
  
  
  One file, two hosts
&lt;/h3&gt;

&lt;p&gt;Drop this at &lt;code&gt;~/.claude/commands/tsearch.md&lt;/code&gt; (and an identical copy at &lt;code&gt;~/.config/opencode/command/tsearch.md&lt;/code&gt; -- both hosts read the same frontmatter shape):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="nn"&gt;---&lt;/span&gt;
&lt;span class="na"&gt;description&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Terraphim&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;search&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;across&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;configured&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;roles.&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;Usage:&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;/tsearch&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;[role]&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;lt;query&amp;gt;"&lt;/span&gt;
&lt;span class="na"&gt;allowed-tools&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Bash(terraphim-agent search:*), Bash(terraphim-agent-pa search:*)&lt;/span&gt;
&lt;span class="nn"&gt;---&lt;/span&gt;
Run &lt;span class="sb"&gt;`terraphim-agent search --role "&amp;lt;role&amp;gt;" --limit 5 "&amp;lt;query&amp;gt;"`&lt;/span&gt; (or
&lt;span class="sb"&gt;`terraphim-agent-pa search ...`&lt;/span&gt; if the role is "Personal Assistant" and
the query needs the JMAP haystack). Return the top results as a numbered
list with title, source path/URL, and a 120-char snippet.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That is it. The &lt;code&gt;allowed-tools&lt;/code&gt; line auto-approves the two CLI invocations so the model does not have to ask permission per call. Restart the host (or reload commands) and &lt;code&gt;/tsearch&lt;/code&gt; is live.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why fast enough
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;terraphim-agent&lt;/code&gt; reads its persisted role state at start (low milliseconds), runs the query against the role's haystacks, and returns. For a typical knowledge-graph query against the Terraphim Engineer role on a laptop, the round trip from slash command to formatted output is well under a second. The agent already has the typed CLI -- &lt;code&gt;--role&lt;/code&gt;, &lt;code&gt;--limit&lt;/code&gt;, &lt;code&gt;--format json&lt;/code&gt; -- so there is nothing the MCP layer adds for the search-only flow.&lt;/p&gt;

&lt;h3&gt;
  
  
  Three example queries
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/tsearch "Terraphim Engineer" rolegraph
/tsearch "System Operator" RFP
/tsearch "Personal Assistant" invoice    # uses terraphim-agent-pa wrapper for JMAP
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The Personal Assistant case is the most interesting because it crosses surfaces -- Obsidian notes interleave with &lt;code&gt;jmap:///email/&amp;lt;id&amp;gt;&lt;/code&gt; URLs from your Fastmail mailbox, ranked by the same &lt;code&gt;terraphim-graph&lt;/code&gt; scoring. The wrapper script injects &lt;code&gt;JMAP_ACCESS_TOKEN&lt;/code&gt; from 1Password at call time so the secret never lands on disk; the bare &lt;code&gt;terraphim-agent&lt;/code&gt; continues to work for the other five roles without paying the unlock cost.&lt;/p&gt;

&lt;h2&gt;
  
  
  Path B -- MCP server (when you want typed tools)
&lt;/h2&gt;

&lt;p&gt;The CLI path is enough for search. If you want the model to call &lt;code&gt;search&lt;/code&gt; as a first-class tool with structured JSON parameters -- alongside &lt;code&gt;autocomplete_terms&lt;/code&gt;, &lt;code&gt;autocomplete_with_snippets&lt;/code&gt;, four flavours of fuzzy autocomplete, &lt;code&gt;build_autocomplete_index&lt;/code&gt;, and &lt;code&gt;update_config_tool&lt;/code&gt; -- that is what &lt;code&gt;terraphim_mcp_server&lt;/code&gt; exposes. It reads the same &lt;code&gt;~/.config/terraphim/embedded_config.json&lt;/code&gt;, so the role list is identical.&lt;/p&gt;

&lt;h3&gt;
  
  
  Build and install
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; ~/projects/terraphim/terraphim-ai
cargo build &lt;span class="nt"&gt;--release&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; terraphim_mcp_server &lt;span class="nt"&gt;--features&lt;/span&gt; jmap
&lt;span class="nb"&gt;cp &lt;/span&gt;target/release/terraphim_mcp_server ~/.cargo/bin/terraphim_mcp_server
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For the Personal Assistant role, mirror the existing &lt;code&gt;terraphim-agent-pa&lt;/code&gt; wrapper at &lt;code&gt;~/bin/terraphim_mcp_server-pa&lt;/code&gt; so the JMAP token flows through &lt;code&gt;op run&lt;/code&gt; instead of being baked into config.&lt;/p&gt;

&lt;h3&gt;
  
  
  Register
&lt;/h3&gt;

&lt;p&gt;opencode -- add to &lt;code&gt;~/.config/opencode/opencode.json&lt;/code&gt; under &lt;code&gt;mcp&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json-doc"&gt;&lt;code&gt;&lt;span class="nl"&gt;"terraphim"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"local"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"command"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"/Users/alex/.cargo/bin/terraphim_mcp_server"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="err"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="nl"&gt;"terraphim-pa"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"local"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nl"&gt;"command"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"/Users/alex/bin/terraphim_mcp_server-pa"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Claude Code -- one shell command per server:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;claude mcp add terraphim    /Users/alex/.cargo/bin/terraphim_mcp_server
claude mcp add terraphim-pa /Users/alex/bin/terraphim_mcp_server-pa
claude mcp list      &lt;span class="c"&gt;# both should show as Connected&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The model now sees &lt;code&gt;mcp__terraphim__search&lt;/code&gt; and &lt;code&gt;mcp__terraphim_pa__search&lt;/code&gt; (plus the autocomplete tools) in its tool list.&lt;/p&gt;

&lt;h2&gt;
  
  
  SessionStart primer (both paths)
&lt;/h2&gt;

&lt;p&gt;Slash commands and MCP tools are useless if the model does not know the roles exist. Extend the SessionStart hook in &lt;code&gt;~/.claude/settings.json&lt;/code&gt; to print a one-screen role index when each session starts:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;printf&lt;/span&gt; &lt;span class="s1"&gt;'\n--- Terraphim search via /tsearch [role] &amp;lt;query&amp;gt; ---\n'&lt;/span&gt;
&lt;span class="nb"&gt;printf&lt;/span&gt; &lt;span class="s1"&gt;'  Terraphim Engineer  (Rust/agent KG)\n'&lt;/span&gt;
&lt;span class="nb"&gt;printf&lt;/span&gt; &lt;span class="s1"&gt;'  Personal Assistant  (Obsidian + Fastmail JMAP, use terraphim-agent-pa for email)\n'&lt;/span&gt;
&lt;span class="nb"&gt;printf&lt;/span&gt; &lt;span class="s1"&gt;'  System Operator     (INCOSE/MBSE Logseq KG)\n'&lt;/span&gt;
&lt;span class="nb"&gt;printf&lt;/span&gt; &lt;span class="s1"&gt;'  Context Engineering Author, Rust Engineer, Default\n'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Equivalent hook in opencode. Cost: one screen of context per session. Benefit: the model picks the right role on the first try instead of guessing.&lt;/p&gt;

&lt;h2&gt;
  
  
  When to pick which path
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;CLI (Path A)&lt;/th&gt;
&lt;th&gt;MCP (Path B)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;New binaries&lt;/td&gt;
&lt;td&gt;None&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;terraphim_mcp_server&lt;/code&gt; plus wrapper&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Cold start&lt;/td&gt;
&lt;td&gt;~50-200 ms per call&lt;/td&gt;
&lt;td&gt;~10-50 ms per call (long-lived process)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Tools exposed&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;search&lt;/code&gt; only&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;search&lt;/code&gt; + 4 autocomplete + &lt;code&gt;build_autocomplete_index&lt;/code&gt; + &lt;code&gt;update_config_tool&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Works in any host&lt;/td&gt;
&lt;td&gt;Yes -- anything that runs a slash command&lt;/td&gt;
&lt;td&gt;Only hosts that speak MCP&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Token handling&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;terraphim-agent-pa&lt;/code&gt; wrapper&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;terraphim_mcp_server-pa&lt;/code&gt; wrapper&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;For the search-across-roles flow, CLI is enough. Add MCP when the model needs autocomplete-as-you-type, when you want it to manage role configuration without leaving the conversation, or when you are using a host where the typed-tool surface matters more than the cold-start cost.&lt;/p&gt;

&lt;p&gt;You do not have to choose. Wire both. The slash command above defaults to CLI and falls back to MCP if the binary is missing -- the two paths coexist cleanly because they read the same role config.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why this is the right shape
&lt;/h2&gt;

&lt;p&gt;Most "AI assistant + knowledge base" integrations end up tightly coupled to a specific host. Vendor X's plugin marketplace, Vendor Y's tool format. Terraphim takes the opposite stance: the role configuration lives in your filesystem, the haystacks live in your filesystem (or your mailbox), the ranker runs in a process you own, and the integration with the AI host is the thinnest possible shim -- a slash command or an MCP server, both of which are commodity surfaces.&lt;/p&gt;

&lt;p&gt;Yesterday the Personal Assistant role was a private setup on one laptop. Today it is callable from inside two different AI coding hosts via a one-file slash command. Tomorrow you can add Cursor or Aider with the same two-line wrapper because the integration surface is &lt;code&gt;terraphim-agent search&lt;/code&gt;, not &lt;code&gt;vendor-specific-tool-protocol-v3&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The expensive part of context engineering is not the ranker. It is the vocabulary in the knowledge graph and the haystacks the role can reach. The integration layer should not be allowed to compete for that budget. CLI-first keeps it small.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Build (or install the published crate when JMAP feature lands on crates.io)&lt;/span&gt;
&lt;span class="nb"&gt;cd&lt;/span&gt; ~/projects/terraphim/terraphim-ai
cargo &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;--path&lt;/span&gt; crates/terraphim_agent &lt;span class="nt"&gt;--features&lt;/span&gt; jmap

&lt;span class="c"&gt;# Configure roles -- copy the snippets from the how-tos linked below&lt;/span&gt;
&lt;span class="nv"&gt;$EDITOR&lt;/span&gt; ~/.config/terraphim/embedded_config.json

&lt;span class="c"&gt;# Install the slash command&lt;/span&gt;
&lt;span class="nb"&gt;mkdir&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; ~/.claude/commands ~/.config/opencode/command
&lt;span class="nb"&gt;cp&lt;/span&gt; ~/projects/terraphim/terraphim-ai/docs/src/howto/mcp-integration-claude-opencode.md &lt;span class="se"&gt;\&lt;/span&gt;
   /tmp/tsearch.md  &lt;span class="c"&gt;# adapt to your slash command file shape&lt;/span&gt;

&lt;span class="c"&gt;# Reload roles&lt;/span&gt;
terraphim-agent config reload

&lt;span class="c"&gt;# Try&lt;/span&gt;
terraphim-agent search &lt;span class="nt"&gt;--role&lt;/span&gt; &lt;span class="s2"&gt;"Terraphim Engineer"&lt;/span&gt; &lt;span class="nt"&gt;--limit&lt;/span&gt; 3 &lt;span class="s2"&gt;"rolegraph"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Step-by-step in the docs: &lt;a href="https://docs.terraphim.ai/howto/mcp-integration-claude-opencode.html" rel="noopener noreferrer"&gt;Plug Terraphim Search into Claude Code and opencode&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;For the underlying engine, start with &lt;a href="https://terraphim.ai/posts/why-graph-embeddings-matter/" rel="noopener noreferrer"&gt;Why Graph Embeddings Matter&lt;/a&gt;. For the two roles this integration most cleanly exposes, see &lt;a href="https://terraphim.ai/posts/personal-assistant-role-jmap-obsidian/" rel="noopener noreferrer"&gt;Personal Assistant&lt;/a&gt; and &lt;a href="https://terraphim.ai/posts/system-operator-logseq-knowledge-graph/" rel="noopener noreferrer"&gt;System Operator&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>terraphim</category>
      <category>claudecode</category>
      <category>opencode</category>
      <category>mcp</category>
    </item>
    <item>
      <title>System Operator Demo: A Logseq Knowledge Graph Drives Enterprise MBSE Search</title>
      <dc:creator>AlexMikhalev</dc:creator>
      <pubDate>Fri, 17 Apr 2026 18:31:00 +0000</pubDate>
      <link>https://dev.to/alexmikhalev/system-operator-demo-a-logseq-knowledge-graph-drives-enterprise-mbse-search-1kb</link>
      <guid>https://dev.to/alexmikhalev/system-operator-demo-a-logseq-knowledge-graph-drives-enterprise-mbse-search-1kb</guid>
      <description>&lt;p&gt;Terraphim's &lt;a href="https://github.com/terraphim/system-operator" rel="noopener noreferrer"&gt;System Operator role&lt;/a&gt; is the demo we point people at when they want to see a real Logseq knowledge graph drive search. 1,347 Logseq pages, 52 of them carrying explicit &lt;code&gt;synonyms::&lt;/code&gt; lines, covering Model-Based Systems Engineering vocabulary -- requirements, architecture, verification, validation, life cycle concepts. This post walks the demo end-to-end and shows the piece people miss: the KG is doing real work, not just re-ranking text matches.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the demo is
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;terraphim/system-operator&lt;/code&gt; repository on GitHub is a &lt;strong&gt;Logseq vault&lt;/strong&gt; -- flat folder of markdown files under &lt;code&gt;pages/&lt;/code&gt;, one page per concept, with Logseq's bullet-tree syntax for structure and Terraphim-format &lt;code&gt;synonyms::&lt;/code&gt; lines for the knowledge-graph layer. Two things make it a useful demo rather than a toy:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Real MBSE vocabulary.&lt;/strong&gt; The synonyms are not invented; they track the INCOSE Systems Engineering Handbook v.4, the V-Model, and SEMP conventions. When you type &lt;code&gt;RFP&lt;/code&gt;, the automaton normalises it to &lt;code&gt;acquisition need&lt;/code&gt; because that is what the handbook calls it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Real scale.&lt;/strong&gt; 1,347 markdown files is enough to expose cold-start behaviour (~5-10 seconds to index on a laptop) without being so large it obscures the ranking signal.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Run it
&lt;/h2&gt;

&lt;p&gt;There is an automated setup script in the repo. As of today it clones to a durable path under &lt;code&gt;~/.config/terraphim/system_operator&lt;/code&gt; instead of &lt;code&gt;/tmp&lt;/code&gt;, so the vault survives a reboot:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;./scripts/setup_system_operator.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then either drive the role via the server --&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;cargo run &lt;span class="nt"&gt;--bin&lt;/span&gt; terraphim_server &lt;span class="nt"&gt;--&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--config&lt;/span&gt; terraphim_server/default/system_operator_config.json
curl &lt;span class="s2"&gt;"http://127.0.0.1:8000/documents/search?q=RFP&amp;amp;role=System%20Operator&amp;amp;limit=5"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;-- or via the &lt;code&gt;terraphim-agent&lt;/code&gt; CLI after adding the role entry to &lt;code&gt;~/.config/terraphim/embedded_config.json&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;terraphim-agent config reload
terraphim-agent search &lt;span class="nt"&gt;--role&lt;/span&gt; &lt;span class="s2"&gt;"System Operator"&lt;/span&gt; &lt;span class="nt"&gt;--limit&lt;/span&gt; 5 &lt;span class="s2"&gt;"RFP"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The full config snippet and the &lt;code&gt;embedded_config.json&lt;/code&gt; entry are in the &lt;a href="https://github.com/terraphim/terraphim-ai/blob/main/terraphim_server/README_SYSTEM_OPERATOR.md" rel="noopener noreferrer"&gt;&lt;code&gt;README_SYSTEM_OPERATOR.md&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  The piece people miss
&lt;/h2&gt;

&lt;p&gt;Search-over-notes tools usually describe ranking in terms of "it uses a knowledge graph". That sentence hides a lot. Is the graph actually consulted at query time? Is it just a post-hoc re-ranker on top of BM25? Does it expand synonyms? On what vocabulary?&lt;/p&gt;

&lt;p&gt;Terraphim exposes the answer directly. &lt;code&gt;validate --connectivity&lt;/code&gt; prints which words in your query the automaton matched and what canonical terms they normalised to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;terraphim-agent validate &lt;span class="nt"&gt;--role&lt;/span&gt; &lt;span class="s2"&gt;"System Operator"&lt;/span&gt; &lt;span class="nt"&gt;--connectivity&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="s2"&gt;"RFP business analysis life cycle model business requirements documentation tree"&lt;/span&gt;

Connectivity Check &lt;span class="k"&gt;for &lt;/span&gt;role &lt;span class="s1"&gt;'System Operator'&lt;/span&gt;:
  Connected: &lt;span class="nb"&gt;false
  &lt;/span&gt;Matched terms: &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"acquisition need"&lt;/span&gt;, &lt;span class="s2"&gt;"business or mission analysis"&lt;/span&gt;,
                  &lt;span class="s2"&gt;"business requirements"&lt;/span&gt;, &lt;span class="s2"&gt;"documentation tree"&lt;/span&gt;,
                  &lt;span class="s2"&gt;"life cycle concepts"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Five query fragments, five canonical matches. &lt;code&gt;RFP&lt;/code&gt; collapsed to &lt;code&gt;acquisition need&lt;/code&gt; (its synonym, from &lt;code&gt;Acquisition need.md&lt;/code&gt; in the vault). &lt;code&gt;business analysis&lt;/code&gt; collapsed to &lt;code&gt;business or mission analysis&lt;/code&gt; (INCOSE terminology). &lt;code&gt;life cycle model&lt;/code&gt; collapsed to &lt;code&gt;life cycle concepts&lt;/code&gt;. None of this is text matching -- the word &lt;code&gt;RFP&lt;/code&gt; does not appear in the canonical page body; it lives in the &lt;code&gt;synonyms::&lt;/code&gt; line.&lt;/p&gt;

&lt;p&gt;Once a query is normalised, the ranker walks the graph. A document that mentions &lt;code&gt;acquisition need&lt;/code&gt; directly outranks one that mentions it through three synonym hops, and both outrank a document that mentions none of the canonical terms at all. Ranks come back with concrete integer scores -- &lt;code&gt;[13]&lt;/code&gt; on a top result, not an opaque 0.87 cosine.&lt;/p&gt;

&lt;h2&gt;
  
  
  How it compares to the Personal Assistant role
&lt;/h2&gt;

&lt;p&gt;We &lt;a href="https://terraphim.ai/posts/personal-assistant-role-jmap-obsidian/" rel="noopener noreferrer"&gt;wrote up the Personal Assistant role yesterday&lt;/a&gt;: a private per-user role that indexes a Fastmail mailbox plus an Obsidian vault. Same engine, same ranker, different haystacks. The knowledge graph there is a small &lt;code&gt;kg/&lt;/code&gt; folder inside the user's vault with 14 synonym files covering personal vocabulary (&lt;code&gt;bun&lt;/code&gt; with &lt;code&gt;npm&lt;/code&gt;/&lt;code&gt;yarn&lt;/code&gt;/&lt;code&gt;pnpm&lt;/code&gt; synonyms, &lt;code&gt;odilo&lt;/code&gt;, &lt;code&gt;invoice&lt;/code&gt;, &lt;code&gt;meeting&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;The two roles expose the same pattern at two scales:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;System Operator&lt;/th&gt;
&lt;th&gt;Personal Assistant&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;KG size&lt;/td&gt;
&lt;td&gt;52 synonym files, 1,300-concept vocabulary&lt;/td&gt;
&lt;td&gt;14 synonym files, ~30-concept personal vocabulary&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Haystacks&lt;/td&gt;
&lt;td&gt;1 (Logseq repo)&lt;/td&gt;
&lt;td&gt;2 (Obsidian vault + Fastmail JMAP)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Source&lt;/td&gt;
&lt;td&gt;Public GitHub repo&lt;/td&gt;
&lt;td&gt;Private user files and mailbox&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Audience&lt;/td&gt;
&lt;td&gt;Demos, onboarding, public showcase&lt;/td&gt;
&lt;td&gt;One user&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Lifetime&lt;/td&gt;
&lt;td&gt;Frozen per release&lt;/td&gt;
&lt;td&gt;Edited daily, rebuilt in 20 ms per edit&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Both use &lt;code&gt;terraphim-graph&lt;/code&gt; ranking. Both build an Aho-Corasick automaton once at role-load time. Both run in a 4 GB process on a laptop with no cloud round-trip. The only interesting difference is the vocabulary, which is exactly the separation of concerns a knowledge-graph-first design is supposed to deliver.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why this matters for teams evaluating MBSE tooling
&lt;/h2&gt;

&lt;p&gt;If you are evaluating Terraphim for a systems engineering group, the System Operator role is the honest starting point. It runs on a laptop against a public vault; you can check that every synonym mapping traces back to a concrete page; you can diff the &lt;code&gt;pages/&lt;/code&gt; folder against the INCOSE handbook and argue about terminology. When your team's own vocabulary diverges (every organisation's does), you clone the repo, edit &lt;code&gt;synonyms::&lt;/code&gt; lines, and the graph rebuilds in 20 milliseconds without a retraining step.&lt;/p&gt;

&lt;p&gt;The expensive part of enterprise search is not the ranker. It is the vocabulary. A deterministic graph makes the vocabulary an asset you curate, not a black box you tune.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/terraphim/terraphim-ai
&lt;span class="nb"&gt;cd &lt;/span&gt;terraphim-ai
./scripts/setup_system_operator.sh
cargo run &lt;span class="nt"&gt;--bin&lt;/span&gt; terraphim_server &lt;span class="nt"&gt;--&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--config&lt;/span&gt; terraphim_server/default/system_operator_config.json
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or cut to the CLI if you already have &lt;code&gt;terraphim-agent&lt;/code&gt; installed -- the &lt;code&gt;embedded_config.json&lt;/code&gt; snippet is in the &lt;a href="https://github.com/terraphim/terraphim-ai/blob/main/terraphim_server/README_SYSTEM_OPERATOR.md" rel="noopener noreferrer"&gt;README&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;For the underlying engine, start with &lt;a href="https://terraphim.ai/posts/why-graph-embeddings-matter/" rel="noopener noreferrer"&gt;Why Graph Embeddings Matter&lt;/a&gt;. For the personal-productivity analogue, see the &lt;a href="https://terraphim.ai/posts/personal-assistant-role-jmap-obsidian/" rel="noopener noreferrer"&gt;Personal Assistant role post&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>terraphim</category>
      <category>logseq</category>
      <category>knowledgegraph</category>
      <category>mbse</category>
    </item>
  </channel>
</rss>
