Core Concepts
Agents and RAG
What Agent Frameworks Do
Agent frameworks like LangGraph, OpenAI Assistants, and custom agent loops focus on retrieving context, selecting tools, chaining operations, and generating recommendations from retrieved information.
They are excellent at reasoning. They are not designed to govern whether the resulting action is authorized, attributable, or auditable.
The Governance Gap
A typical agentic flow:
1Knowledge Base2 ↓3RAG Retrieval <- context retrieval4 ↓5LLM / Agent Reasoning <- recommendation6 ↓7Tool / API Execution <- actionThis works for low-risk autonomous tasks.
In enterprise production - supply chain, financial approvals, healthcare, infrastructure - the gap between "agent recommends" and "system executes" needs an explicit governance layer.
Where Loop Engine Fits
1Knowledge Base2 ↓3RAG Retrieval4 ↓5LLM / Agent Reasoning6 ↓7Loop Engine <- decision governance8 ↓9Workflow ExecutionThe agent's recommendation becomes a proposed transition in a Loop Engine loop. Guards evaluate it. A human approves when policy requires. The action executes only after the loop allows it.
RAG Outputs as Evidence
RAG systems already produce high-value evidence: retrieved documents, confidence scores, and graph relationships.
Loop Engine attaches this context directly to transitions as structured evidence, creating a permanent record of what the model used, what it recommended, and why the system allowed the action.
Code Example
1import Anthropic from "@anthropic-ai/sdk";2import { createAnthropicActorAdapter } from "@loop-engine/adapter-anthropic";3import { createLoopSystem } from "@loop-engine/sdk";4 5const anthropic = new Anthropic({ apiKey: process.env.ANTHROPIC_API_KEY });6const adapter = createAnthropicActorAdapter(anthropic, { modelId: "claude-opus-4-6" });7const { engine } = await createLoopSystem({ loops: [/* procurement loop */] });8 9const ragResults = {10 retrievedDocs: 12,11 confidence: 0.84,12 ragSource: "vendor-policy-kb"13};14 15const { actor, decision } = await adapter.createSubmission({16 loopId: "procurement",17 loopName: "SCM Procurement",18 currentState: "pending_analysis",19 availableSignals: [{ signalId: "submit_recommendation", name: "Submit Recommendation" }],20 instruction: "Recommend whether to proceed with purchase order issuance.",21 evidence: { ...ragResults }22});23 24await engine.transition({25 aggregateId: "PO-10042" as never,26 transitionId: "submit_recommendation" as never,27 actor,28 evidence: { ...decision, ragResults }29});