a11oy / console /assets /AgenticRag-DbzjUV_h.js
betterwithage's picture
deploy(hf): sync szl-holdings/a11oy@main derived COPY set
da2854c verified
Raw
History Blame
16 kB
import{o as e}from"./chunk-CMxvf4Kt.js";import{t}from"./react-DrNXigiH.js";import{C as n}from"./index-Caa1r77e.js";import{t as r}from"./layout-BtJ5ShnN.js";import{c as i}from"./ui-Ddu9t0Or.js";var a=e(t(),1),o=n(),s=[{id:`kc-1`,name:`Governance Policies`,description:`All covenant policies, constitution, compliance frameworks`,documentCount:847,chunkCount:12340,embeddingModel:`BAAI/bge-m3`,lastIngested:Date.now()-36e5,sizeBytes:234e6,vertical:`Governance`},{id:`kc-2`,name:`Deal Intelligence`,description:`Deal memos, approval chains, revenue forecasts, pipeline data`,documentCount:2341,chunkCount:45600,embeddingModel:`BAAI/bge-m3`,lastIngested:Date.now()-18e5,sizeBytes:567e6,vertical:`Revenue`},{id:`kc-3`,name:`Security Findings`,description:`Vulnerability reports, threat intel, incident post-mortems`,documentCount:1567,chunkCount:23400,embeddingModel:`BAAI/bge-m3`,lastIngested:Date.now()-72e5,sizeBytes:345e6,vertical:`Security`},{id:`kc-4`,name:`Agent Execution History`,description:`Workcell traces, proof packets, agent decision logs`,documentCount:8934,chunkCount:134500,embeddingModel:`BAAI/bge-m3`,lastIngested:Date.now()-9e5,sizeBytes:123e7,vertical:`Operations`},{id:`kc-5`,name:`Maritime Intelligence`,description:`Vessel positions, port schedules, compliance records, sanctions data`,documentCount:4567,chunkCount:67800,embeddingModel:`BAAI/bge-m3`,lastIngested:Date.now()-144e5,sizeBytes:89e7,vertical:`Maritime`},{id:`kc-6`,name:`Legal Corpus`,description:`Case law, filings, contract templates, regulatory updates`,documentCount:3456,chunkCount:89e3,embeddingModel:`BAAI/bge-m3`,lastIngested:Date.now()-288e5,sizeBytes:678e6,vertical:`Legal`}],c={id:`rq-1`,query:`What is the current approval chain policy for deals exceeding $1M, and have there been any recent violations?`,answer:`Based on the governance corpus and recent execution history, here is the current state:
**Active Policy: COV-APPROVAL-3**
Deals exceeding $1M require explicit human approval from a designated approver at VP level or above. Automated escalation is permitted but automated approval is blocked.
**Recent Violations (Last 30 Days):**
1. **WC-0491 (Vantex Acquisition)** — Approval chain void since March 11. Primary approver departed with no fallback delegate. 3 automated escalation attempts were correctly blocked by the policy. Revenue exposure: $4.2M.
2. **WC-0523 (Stratford Expansion)** — Near-violation flagged. Approver responded 6 hours past SLA but within the 24h grace window. No policy breach, but workflow health impact noted.
**Recommendation:** Configure fallback delegates for all approval chains to prevent future void states. The Vantex situation would have been avoided with a single delegate assignment.`,steps:[{id:`s-1`,type:`query_rewrite`,label:`Query Understanding`,detail:`Decomposed into 2 sub-queries: (1) approval chain policy for >$1M deals, (2) recent violations/breaches`,durationMs:45,confidence:.97},{id:`s-2`,type:`retrieve`,label:`Vector Retrieval`,detail:`Searched Governance Policies collection — top 20 chunks retrieved with bge-m3 embeddings`,durationMs:89,resultCount:20},{id:`s-3`,type:`retrieve`,label:`Graph Lookup`,detail:`Queried knowledge graph for COV-APPROVAL-* policies linked to deal entities`,durationMs:56,resultCount:7},{id:`s-4`,type:`retrieve`,label:`Execution History`,detail:`Searched Agent Execution History for workcells with covenant violations in last 30 days`,durationMs:112,resultCount:34},{id:`s-5`,type:`rerank`,label:`Cross-Encoder Reranking`,detail:`Re-ranked 61 passages using cross-encoder — kept top 12 above 0.7 threshold`,durationMs:78,resultCount:12,confidence:.92},{id:`s-6`,type:`filter`,label:`Policy Compliance Filter`,detail:`Filtered results through covenant compliance checker — removed 2 stale policies`,durationMs:23,resultCount:10},{id:`s-7`,type:`synthesize`,label:`Answer Generation`,detail:`Synthesized answer from 10 verified passages with citation tracking`,durationMs:890,confidence:.94},{id:`s-8`,type:`verify`,label:`Proof Verification`,detail:`Created proof packet PP-31204 — all claims verified against source documents`,durationMs:134,confidence:.91}],sources:[{title:`COV-APPROVAL-3 Policy Document`,uri:`a11oy://governance/policies/cov-approval-3`,score:.97,chunk:`Section 4.2: Any deal with estimated value exceeding $1,000,000 USD requires explicit human approval from a designated approver...`},{title:`WC-0491 Execution Trace`,uri:`a11oy://workcells/wc-0491/trace`,score:.94,chunk:`Step 7 — Approval gate reached. Primary approver David Chen (VP Sales) not found in active directory...`},{title:`Covenant Enforcement Log`,uri:`a11oy://governance/enforcement/2026-04`,score:.91,chunk:`April 2026: 3 escalation attempts blocked by COV-APPROVAL-3 for WC-0491. Automated approval bypass denied...`},{title:`WC-0523 Execution Trace`,uri:`a11oy://workcells/wc-0523/trace`,score:.88,chunk:`Approval received at T+6h02m. SLA threshold: 6h. Grace window: 24h. Status: within grace, no violation...`}],totalLatencyMs:1427,tokensUsed:3456,proofId:`PP-31204`},l=[{name:`Chronicle`,description:`Permanent organizational narrative`,size:`12.4 GB`,entries:`234K`,retention:`Forever`,icon:`📜`},{name:`Episodic`,description:`Replayable session history`,size:`8.7 GB`,entries:`89K`,retention:`90 days`,icon:`🎬`},{name:`Semantic`,description:`Embedded knowledge vectors`,size:`34.2 GB`,entries:`372K`,retention:`Until superseded`,icon:`🧠`},{name:`Working`,description:`Active session context`,size:`456 MB`,entries:`2.1K`,retention:`Session`,icon:`⚡`},{name:`Procedural`,description:`Learned agent workflows`,size:`2.1 GB`,entries:`12K`,retention:`Until deprecated`,icon:`🔧`}];function u({step:e}){let t={query_rewrite:`#8b5cf6`,retrieve:`#3b82f6`,rerank:`#f59e0b`,filter:`#ef4444`,synthesize:`#22c55e`,verify:`#c9b787`}[e.type];return(0,o.jsxs)(`div`,{className:`flex items-center gap-3 py-2`,children:[(0,o.jsx)(`div`,{className:`w-6 h-6 rounded-full flex items-center justify-center flex-shrink-0`,style:{backgroundColor:`${t}15`,border:`1px solid ${t}30`},children:(0,o.jsx)(`svg`,{width:`10`,height:`10`,viewBox:`0 0 24 24`,fill:`none`,stroke:t,strokeWidth:`3`,children:(0,o.jsx)(`path`,{d:`M20 6L9 17l-5-5`})})}),(0,o.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,o.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,o.jsx)(`span`,{className:`text-xs font-medium`,style:{color:`rgba(255,255,255,0.8)`},children:e.label}),(0,o.jsxs)(`span`,{className:`text-[10px] font-mono`,style:{color:`rgba(255,255,255,0.2)`},children:[e.durationMs,`ms`]}),e.resultCount!==void 0&&(0,o.jsxs)(`span`,{className:`text-[10px] font-mono`,style:{color:`rgba(255,255,255,0.2)`},children:[e.resultCount,` results`]}),e.confidence!==void 0&&(0,o.jsxs)(`span`,{className:`text-[10px] px-1 py-0.5 rounded`,style:{backgroundColor:`rgba(34,197,94,0.08)`,color:`rgba(34,197,94,0.7)`},children:[(e.confidence*100).toFixed(0),`%`]})]}),(0,o.jsx)(`p`,{className:`text-[10px] mt-0.5 truncate`,style:{color:`rgba(255,255,255,0.3)`},children:e.detail})]})]})}function d(){let[e,t]=(0,a.useState)(`pipeline`),[n,d]=(0,a.useState)(null);return s.reduce((e,t)=>e+t.documentCount,0),s.reduce((e,t)=>e+t.chunkCount,0),s.reduce((e,t)=>e+t.sizeBytes,0),(0,o.jsx)(r,{children:(0,o.jsxs)(`div`,{className:`p-6 max-w-7xl mx-auto`,children:[(0,o.jsx)(i,{label:`KNOWLEDGE`,title:`Agentic RAG`,subtitle:`Multi-step retrieval, reasoning, and synthesis with governed knowledge`,status:`LIVE`}),(0,o.jsx)(`div`,{className:`flex gap-1 mb-6`,children:[`pipeline`,`collections`,`memory`].map(n=>(0,o.jsx)(`button`,{onClick:()=>t(n),className:`px-4 py-2 rounded-lg text-xs font-medium transition-colors capitalize`,style:{backgroundColor:e===n?`rgba(201,183,135,0.1)`:`transparent`,color:e===n?`#c9b787`:`rgba(255,255,255,0.4)`},children:n===`pipeline`?`RAG Pipeline`:n===`collections`?`Knowledge Collections`:`Memory Fabric`},n))}),e===`pipeline`&&(0,o.jsxs)(`div`,{className:`flex gap-6`,children:[(0,o.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,o.jsxs)(`div`,{className:`p-4 rounded-xl mb-4`,style:{backgroundColor:`rgba(255,255,255,0.02)`,border:`1px solid rgba(255,255,255,0.06)`},children:[(0,o.jsx)(`div`,{className:`text-[10px] uppercase tracking-wider mb-2`,style:{color:`rgba(255,255,255,0.3)`},children:`Query`}),(0,o.jsx)(`p`,{className:`text-sm`,style:{color:`rgba(255,255,255,0.85)`},children:c.query})]}),(0,o.jsxs)(`div`,{className:`mb-4`,children:[(0,o.jsxs)(`div`,{className:`text-[10px] uppercase tracking-wider mb-3`,style:{color:`rgba(255,255,255,0.3)`},children:[`Agentic Pipeline — `,c.steps.length,` steps · `,c.totalLatencyMs,`ms total`]}),(0,o.jsx)(`div`,{className:`pl-3`,style:{borderLeft:`2px solid rgba(201,183,135,0.1)`},children:c.steps.map(e=>(0,o.jsx)(u,{step:e},e.id))})]}),(0,o.jsxs)(`div`,{className:`p-4 rounded-xl`,style:{backgroundColor:`rgba(255,255,255,0.02)`,border:`1px solid rgba(255,255,255,0.06)`},children:[(0,o.jsxs)(`div`,{className:`flex items-center gap-2 mb-3`,children:[(0,o.jsx)(`div`,{className:`text-[10px] uppercase tracking-wider`,style:{color:`rgba(255,255,255,0.3)`},children:`Synthesized Answer`}),(0,o.jsxs)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded font-mono`,style:{backgroundColor:`rgba(34,197,94,0.08)`,color:`rgba(34,197,94,0.6)`},children:[`verified · `,c.proofId]})]}),(0,o.jsx)(`div`,{className:`text-sm leading-relaxed`,style:{color:`rgba(255,255,255,0.8)`},dangerouslySetInnerHTML:{__html:c.answer.replace(/\*\*(.*?)\*\*/g,`<strong style="color:rgba(255,255,255,0.95)">$1</strong>`).replace(/\n/g,`<br/>`)}}),(0,o.jsxs)(`div`,{className:`flex items-center gap-4 mt-4 pt-3 text-[10px] font-mono`,style:{color:`rgba(255,255,255,0.2)`,borderTop:`1px solid rgba(255,255,255,0.04)`},children:[(0,o.jsxs)(`span`,{children:[c.totalLatencyMs,`ms latency`]}),(0,o.jsxs)(`span`,{children:[c.tokensUsed.toLocaleString(),` tokens`]}),(0,o.jsxs)(`span`,{children:[c.sources.length,` sources cited`]})]})]})]}),(0,o.jsx)(`div`,{className:`w-80 flex-shrink-0`,children:(0,o.jsxs)(`div`,{className:`sticky top-6`,children:[(0,o.jsxs)(`div`,{className:`text-[10px] uppercase tracking-wider mb-3`,style:{color:`rgba(255,255,255,0.3)`},children:[`Sources (`,c.sources.length,`)`]}),(0,o.jsx)(`div`,{className:`flex flex-col gap-2`,children:c.sources.map((e,t)=>(0,o.jsxs)(`button`,{onClick:()=>d(n===t?null:t),className:`w-full p-3 rounded-lg text-left transition-colors`,style:{backgroundColor:`rgba(255,255,255,0.02)`,border:`1px solid ${n===t?`rgba(201,183,135,0.15)`:`rgba(255,255,255,0.06)`}`},children:[(0,o.jsxs)(`div`,{className:`flex items-center justify-between mb-1`,children:[(0,o.jsx)(`span`,{className:`text-xs font-medium truncate`,style:{color:`rgba(255,255,255,0.7)`},children:e.title}),(0,o.jsxs)(`span`,{className:`text-[10px] font-mono ml-2 flex-shrink-0`,style:{color:`rgba(34,197,94,0.6)`},children:[(e.score*100).toFixed(0),`%`]})]}),(0,o.jsx)(`div`,{className:`text-[10px] font-mono truncate`,style:{color:`rgba(201,183,135,0.4)`},children:e.uri}),n===t&&(0,o.jsx)(`div`,{className:`mt-2 p-2 rounded text-[10px] leading-relaxed`,style:{backgroundColor:`rgba(255,255,255,0.02)`,color:`rgba(255,255,255,0.5)`},children:e.chunk})]},t))}),(0,o.jsxs)(`div`,{className:`mt-6 p-3 rounded-lg`,style:{backgroundColor:`rgba(201,183,135,0.03)`,border:`1px solid rgba(201,183,135,0.08)`},children:[(0,o.jsx)(`div`,{className:`text-[10px] font-semibold mb-2`,style:{color:`#c9b787`},children:`What makes this Agentic`}),(0,o.jsxs)(`div`,{className:`space-y-2 text-[10px]`,style:{color:`rgba(255,255,255,0.4)`},children:[(0,o.jsxs)(`p`,{children:[(0,o.jsx)(`strong`,{style:{color:`rgba(255,255,255,0.6)`},children:`Multi-step retrieval`}),` — queries are decomposed, routed to multiple collections, and iteratively refined.`]}),(0,o.jsxs)(`p`,{children:[(0,o.jsx)(`strong`,{style:{color:`rgba(255,255,255,0.6)`},children:`Self-correcting`}),` — if initial retrieval is insufficient, the agent autonomously broadens or narrows its search.`]}),(0,o.jsxs)(`p`,{children:[(0,o.jsx)(`strong`,{style:{color:`rgba(255,255,255,0.6)`},children:`Knowledge graph + vectors`}),` — hybrid retrieval combining semantic similarity with structured relationships.`]}),(0,o.jsxs)(`p`,{children:[(0,o.jsx)(`strong`,{style:{color:`rgba(255,255,255,0.6)`},children:`Governed synthesis`}),` — every answer carries a proof packet linking claims to source documents.`]})]})]})]})})]}),e===`collections`&&(0,o.jsx)(`div`,{className:`grid grid-cols-2 gap-4`,children:s.map(e=>(0,o.jsxs)(`div`,{className:`p-4 rounded-xl`,style:{backgroundColor:`rgba(255,255,255,0.02)`,border:`1px solid rgba(255,255,255,0.06)`},children:[(0,o.jsxs)(`div`,{className:`flex items-center justify-between mb-2`,children:[(0,o.jsx)(`span`,{className:`text-sm font-semibold`,style:{color:`rgba(255,255,255,0.9)`},children:e.name}),(0,o.jsx)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded`,style:{backgroundColor:`rgba(201,183,135,0.08)`,color:`rgba(201,183,135,0.6)`},children:e.vertical})]}),(0,o.jsx)(`p`,{className:`text-xs mb-3`,style:{color:`rgba(255,255,255,0.4)`},children:e.description}),(0,o.jsx)(`div`,{className:`grid grid-cols-2 gap-2`,children:[{label:`Documents`,value:e.documentCount.toLocaleString()},{label:`Chunks`,value:e.chunkCount.toLocaleString()},{label:`Size`,value:`${(e.sizeBytes/1e6).toFixed(0)} MB`},{label:`Model`,value:e.embeddingModel}].map((e,t)=>(0,o.jsxs)(`div`,{children:[(0,o.jsx)(`div`,{className:`text-[10px]`,style:{color:`rgba(255,255,255,0.25)`},children:e.label}),(0,o.jsx)(`div`,{className:`text-xs font-mono`,style:{color:`rgba(255,255,255,0.6)`},children:e.value})]},t))})]},e.id))}),e===`memory`&&(0,o.jsxs)(`div`,{children:[(0,o.jsx)(`div`,{className:`grid grid-cols-5 gap-3 mb-6`,children:l.map(e=>(0,o.jsxs)(`div`,{className:`p-4 rounded-xl text-center`,style:{backgroundColor:`rgba(255,255,255,0.02)`,border:`1px solid rgba(255,255,255,0.06)`},children:[(0,o.jsx)(`div`,{className:`text-2xl mb-2`,children:e.icon}),(0,o.jsx)(`div`,{className:`text-xs font-semibold mb-1`,style:{color:`rgba(255,255,255,0.8)`},children:e.name}),(0,o.jsx)(`div`,{className:`text-[10px] mb-2`,style:{color:`rgba(255,255,255,0.35)`},children:e.description}),(0,o.jsx)(`div`,{className:`text-lg font-semibold`,style:{color:`#c9b787`},children:e.size}),(0,o.jsxs)(`div`,{className:`text-[10px] mt-1`,style:{color:`rgba(255,255,255,0.25)`},children:[e.entries,` entries`]}),(0,o.jsxs)(`div`,{className:`text-[10px] mt-1 font-mono`,style:{color:`rgba(255,255,255,0.2)`},children:[`TTL: `,e.retention]})]},e.name))}),(0,o.jsxs)(`div`,{className:`p-4 rounded-xl`,style:{backgroundColor:`rgba(201,183,135,0.03)`,border:`1px solid rgba(201,183,135,0.08)`},children:[(0,o.jsx)(`h4`,{className:`text-xs font-semibold mb-3`,style:{color:`#c9b787`},children:`Memory Fabric Architecture`}),(0,o.jsxs)(`div`,{className:`grid grid-cols-3 gap-6 text-[10px]`,style:{color:`rgba(255,255,255,0.4)`},children:[(0,o.jsxs)(`div`,{children:[(0,o.jsx)(`div`,{className:`font-medium mb-1`,style:{color:`rgba(255,255,255,0.6)`},children:`Ingestion Pipeline`}),(0,o.jsx)(`p`,{children:`Documents flow through chunking (recursive, semantic, or sliding window), embedding (bge-m3), and indexing (HNSW + IVF). Metadata is extracted and linked to the knowledge graph.`})]}),(0,o.jsxs)(`div`,{children:[(0,o.jsx)(`div`,{className:`font-medium mb-1`,style:{color:`rgba(255,255,255,0.6)`},children:`Retrieval Strategy`}),(0,o.jsx)(`p`,{children:`Hybrid retrieval combines dense vectors (cosine similarity), sparse BM25, and knowledge graph traversal. Results are re-ranked with a cross-encoder before synthesis.`})]}),(0,o.jsxs)(`div`,{children:[(0,o.jsx)(`div`,{className:`font-medium mb-1`,style:{color:`rgba(255,255,255,0.6)`},children:`Governed Provenance`}),(0,o.jsx)(`p`,{children:`Every retrieved passage carries provenance metadata — source document, ingestion timestamp, freshness score, sensitivity level, and retention policy.`})]})]})]})]})]})})}export{d as AgenticRag};