[{"data":1,"prerenderedAt":10561},["ShallowReactive",2],{"guides-/guides/knowledge":3},{"_path":4,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":8,"description":9,"navigation":10,"body":11,"_type":10555,"_id":10556,"_source":10557,"_file":10558,"_stem":10559,"_extension":10560},"/guides/knowledge","guides",false,"","Knowledge","Pull structured entities and relationships out of your documents into a queryable store — for the exact, exhaustive, and relational questions vector search can't answer",{"title":8},{"type":12,"children":13,"toc":10490},"root",[14,23,37,65,99,125,130,137,151,418,460,465,471,476,485,546,558,563,569,574,606,1437,1450,1553,1558,1564,1569,1576,1594,1600,1619,1680,1700,1706,1740,1752,1758,1797,1817,1823,1840,1846,1961,1990,1996,2008,2381,2409,2414,2555,2561,2574,2822,2834,2843,2849,2854,3082,3087,3093,3105,3119,3159,3547,3575,3587,3611,3703,3716,3735,3843,3870,3903,4341,4376,4382,4387,4555,4568,4580,4599,4760,5113,5133,5145,5157,5279,5578,5596,5602,5630,5713,5732,5738,5795,6114,6119,6125,6145,6358,6371,6377,6389,6443,6448,6578,6629,6641,6649,6661,6674,6679,6712,6718,6723,6771,6790,6796,6801,6900,6918,6930,6942,7048,7054,7059,7221,7240,7246,7252,7335,7341,7559,7565,7690,7696,7951,7957,8150,8156,8161,8436,8441,8541,8547,8552,9130,9136,9159,9190,9207,9232,9242,9274,9280,9330,9340,9373,9420,9435,9474,9480,9491,9498,9601,9609,9718,9725,9814,9820,10169,10175,10253,10259,10345,10382,10388,10443,10449,10484],{"type":15,"tag":16,"props":17,"children":19},"element","h1",{"id":18},"knowledge-guide",[20],{"type":21,"value":22},"text","Knowledge Guide",{"type":15,"tag":24,"props":25,"children":26},"p",{},[27,29,35],{"type":21,"value":28},"This guide is for the developer who has documents and needs\n",{"type":15,"tag":30,"props":31,"children":32},"em",{},[33],{"type":21,"value":34},"exact",{"type":21,"value":36}," answers from them. You have a folder full of Excel\nproject sheets, PowerPoint case studies, PDFs and Word files,\nand your users keep asking questions that vector search can't\nanswer well:",{"type":15,"tag":38,"props":39,"children":40},"ul",{},[41,55,60],{"type":15,"tag":42,"props":43,"children":44},"li",{},[45,47,53],{"type":21,"value":46},"\"List ",{"type":15,"tag":48,"props":49,"children":50},"strong",{},[51],{"type":21,"value":52},"every",{"type":21,"value":54}," company we've worked with in retail.\"",{"type":15,"tag":42,"props":56,"children":57},{},[58],{"type":21,"value":59},"\"How many of our people have a competence in Java?\"",{"type":15,"tag":42,"props":61,"children":62},{},[63],{"type":21,"value":64},"\"Which consultants have worked with a fintech client?\"",{"type":15,"tag":24,"props":66,"children":67},{},[68,70,75,77,81,83,88,90,97],{"type":21,"value":69},"These are ",{"type":15,"tag":30,"props":71,"children":72},{},[73],{"type":21,"value":74},"exhaustive",{"type":21,"value":76},", ",{"type":15,"tag":30,"props":78,"children":79},{},[80],{"type":21,"value":34},{"type":21,"value":82},", and ",{"type":15,"tag":30,"props":84,"children":85},{},[86],{"type":21,"value":87},"relational",{"type":21,"value":89}," questions.\nRetrieval-augmented generation (",{"type":15,"tag":91,"props":92,"children":94},"a",{"href":93},"/guides/ai-agents",[95],{"type":21,"value":96},"RAG",{"type":21,"value":98},") is\ngreat at fuzzy, open-ended ones (\"find a project like this\",\n\"what did we say about pricing\") but it cannot guarantee a\ncomplete, deduplicated list, and it cannot count. The reason is\nsimple: the entities — the company names, the people, the skills\n— never leave the document. Only a lossy summary embedding does.",{"type":15,"tag":24,"props":100,"children":101},{},[102,104,109,111,116,118,123],{"type":21,"value":103},"The ",{"type":15,"tag":48,"props":105,"children":106},{},[107],{"type":21,"value":108},"knowledge layer",{"type":21,"value":110}," fixes that. It pulls structured entities\nand the relationships between them ",{"type":15,"tag":30,"props":112,"children":113},{},[114],{"type":21,"value":115},"out",{"type":21,"value":117}," of your documents and\ninto a queryable store, so the questions above become\ndeterministic queries instead of similarity guesses. It runs\n",{"type":15,"tag":30,"props":119,"children":120},{},[121],{"type":21,"value":122},"alongside",{"type":21,"value":124}," the existing RAG layer, not instead of it.",{"type":15,"tag":24,"props":126,"children":127},{},[128],{"type":21,"value":129},"This guide explains the mental model, walks you through the\ncommon patterns from a trivial \"hello world\" to a relational\nmulti-hop agent, and ends with a reference cheat sheet you can\nkeep open while you work.",{"type":15,"tag":131,"props":132,"children":134},"h2",{"id":133},"what-you-get",[135],{"type":21,"value":136},"What You Get",{"type":15,"tag":24,"props":138,"children":139},{},[140,142,149],{"type":21,"value":141},"The platform gives you one cooperating set of capabilities,\nreached through ",{"type":15,"tag":143,"props":144,"children":146},"code",{"className":145},[],[147],{"type":21,"value":148},"context.getKnowledge()",{"type":21,"value":150}," inside any Action, plus\ntwo native AITools the LLM can call on its own.",{"type":15,"tag":152,"props":153,"children":154},"table",{},[155,179],{"type":15,"tag":156,"props":157,"children":158},"thead",{},[159],{"type":15,"tag":160,"props":161,"children":162},"tr",{},[163,169,174],{"type":15,"tag":164,"props":165,"children":166},"th",{},[167],{"type":21,"value":168},"Capability",{"type":15,"tag":164,"props":170,"children":171},{},[172],{"type":21,"value":173},"Accessor",{"type":15,"tag":164,"props":175,"children":176},{},[177],{"type":21,"value":178},"What it does",{"type":15,"tag":180,"props":181,"children":182},"tbody",{},[183,244,283,322,354,386],{"type":15,"tag":160,"props":184,"children":185},{},[186,195,225],{"type":15,"tag":187,"props":188,"children":189},"td",{},[190],{"type":15,"tag":48,"props":191,"children":192},{},[193],{"type":21,"value":194},"Config",{"type":15,"tag":187,"props":196,"children":197},{},[198,204,205,211,212,218,219],{"type":15,"tag":143,"props":199,"children":201},{"className":200},[],[202],{"type":21,"value":203},"context.getKnowledge().createDataset(...)",{"type":21,"value":76},{"type":15,"tag":143,"props":206,"children":208},{"className":207},[],[209],{"type":21,"value":210},"addEntityType(...)",{"type":21,"value":76},{"type":15,"tag":143,"props":213,"children":215},{"className":214},[],[216],{"type":21,"value":217},"addRelationshipType(...)",{"type":21,"value":76},{"type":15,"tag":143,"props":220,"children":222},{"className":221},[],[223],{"type":21,"value":224},"addTaxonomyTerm(...)",{"type":15,"tag":187,"props":226,"children":227},{},[228,230,235,237,242],{"type":21,"value":229},"Declare ",{"type":15,"tag":30,"props":231,"children":232},{},[233],{"type":21,"value":234},"what",{"type":21,"value":236}," to extract and ",{"type":15,"tag":30,"props":238,"children":239},{},[240],{"type":21,"value":241},"how to deduplicate",{"type":21,"value":243}," it — no code, just configuration.",{"type":15,"tag":160,"props":245,"children":246},{},[247,255,278],{"type":15,"tag":187,"props":248,"children":249},{},[250],{"type":15,"tag":48,"props":251,"children":252},{},[253],{"type":21,"value":254},"Ingestion",{"type":15,"tag":187,"props":256,"children":257},{},[258,264,265,271,272],{"type":15,"tag":143,"props":259,"children":261},{"className":260},[],[262],{"type":21,"value":263},"preview(...)",{"type":21,"value":76},{"type":15,"tag":143,"props":266,"children":268},{"className":267},[],[269],{"type":21,"value":270},"backfill(...)",{"type":21,"value":76},{"type":15,"tag":143,"props":273,"children":275},{"className":274},[],[276],{"type":21,"value":277},"reprocess(...)",{"type":15,"tag":187,"props":279,"children":280},{},[281],{"type":21,"value":282},"Dry-run extraction, then enqueue documents for extraction in the background.",{"type":15,"tag":160,"props":284,"children":285},{},[286,294,317],{"type":15,"tag":187,"props":287,"children":288},{},[289],{"type":15,"tag":48,"props":290,"children":291},{},[292],{"type":21,"value":293},"Jobs",{"type":15,"tag":187,"props":295,"children":296},{},[297,303,304,310,311],{"type":15,"tag":143,"props":298,"children":300},{"className":299},[],[301],{"type":21,"value":302},"jobStatus(...)",{"type":21,"value":76},{"type":15,"tag":143,"props":305,"children":307},{"className":306},[],[308],{"type":21,"value":309},"listJobs(...)",{"type":21,"value":76},{"type":15,"tag":143,"props":312,"children":314},{"className":313},[],[315],{"type":21,"value":316},"jobSummary(...)",{"type":15,"tag":187,"props":318,"children":319},{},[320],{"type":21,"value":321},"Watch extraction progress and inspect failures.",{"type":15,"tag":160,"props":323,"children":324},{},[325,333,349],{"type":15,"tag":187,"props":326,"children":327},{},[328],{"type":15,"tag":48,"props":329,"children":330},{},[331],{"type":21,"value":332},"Query",{"type":15,"tag":187,"props":334,"children":335},{},[336,342,343],{"type":15,"tag":143,"props":337,"children":339},{"className":338},[],[340],{"type":21,"value":341},"query(...)",{"type":21,"value":76},{"type":15,"tag":143,"props":344,"children":346},{"className":345},[],[347],{"type":21,"value":348},"vocabulary(...)",{"type":15,"tag":187,"props":350,"children":351},{},[352],{"type":21,"value":353},"Run exact lookups, aggregations, and 1–2 hop relational queries — always access-filtered.",{"type":15,"tag":160,"props":355,"children":356},{},[357,365,381],{"type":15,"tag":187,"props":358,"children":359},{},[360],{"type":15,"tag":48,"props":361,"children":362},{},[363],{"type":21,"value":364},"Relationships",{"type":15,"tag":187,"props":366,"children":367},{},[368,374,375],{"type":15,"tag":143,"props":369,"children":371},{"className":370},[],[372],{"type":21,"value":373},"addRelationship(...)",{"type":21,"value":76},{"type":15,"tag":143,"props":376,"children":378},{"className":377},[],[379],{"type":21,"value":380},"listRelationshipTypes(...)",{"type":15,"tag":187,"props":382,"children":383},{},[384],{"type":21,"value":385},"Read the relationship vocabulary; write edges by hand when you need to.",{"type":15,"tag":160,"props":387,"children":388},{},[389,397,413],{"type":15,"tag":187,"props":390,"children":391},{},[392],{"type":15,"tag":48,"props":393,"children":394},{},[395],{"type":21,"value":396},"Agent tools",{"type":15,"tag":187,"props":398,"children":399},{},[400,406,407],{"type":15,"tag":143,"props":401,"children":403},{"className":402},[],[404],{"type":21,"value":405},"knowledge_query",{"type":21,"value":76},{"type":15,"tag":143,"props":408,"children":410},{"className":409},[],[411],{"type":21,"value":412},"knowledge_vocabulary",{"type":15,"tag":187,"props":414,"children":415},{},[416],{"type":21,"value":417},"The LLM discovers values and runs queries itself, mid-turn.",{"type":15,"tag":24,"props":419,"children":420},{},[421,423,428,430,435,437,443,445,450,452,458],{"type":21,"value":422},"Everything is ",{"type":15,"tag":48,"props":424,"children":425},{},[426],{"type":21,"value":427},"multi-tenant",{"type":21,"value":429}," and ",{"type":15,"tag":48,"props":431,"children":432},{},[433],{"type":21,"value":434},"app-scoped",{"type":21,"value":436}," by\nconstruction. A dataset is keyed by ",{"type":15,"tag":143,"props":438,"children":440},{"className":439},[],[441],{"type":21,"value":442},"(tenant, app, datasetId)",{"type":21,"value":444},";\nyou never see another tenant's or another app's entities.\nEverything is also ",{"type":15,"tag":48,"props":446,"children":447},{},[448],{"type":21,"value":449},"access-filtered per fact",{"type":21,"value":451},": the same query\nreturns different results for different users, and that is\ncorrect behaviour (see ",{"type":15,"tag":91,"props":453,"children":455},{"href":454},"#access-control",[456],{"type":21,"value":457},"Access Control",{"type":21,"value":459},").",{"type":15,"tag":24,"props":461,"children":462},{},[463],{"type":21,"value":464},"The same surface is reachable over the agent-tool layer for\nLLM-driven use. This guide focuses on the JS Action surface —\nthat's where most integration code lives — and then shows how to\nhand the same power to an agent.",{"type":15,"tag":131,"props":466,"children":468},{"id":467},"the-mental-model-in-one-picture",[469],{"type":21,"value":470},"The Mental Model In One Picture",{"type":15,"tag":24,"props":472,"children":473},{},[474],{"type":21,"value":475},"If you take away one mental model from this guide, take this one:",{"type":15,"tag":477,"props":478,"children":480},"pre",{"code":479},"        DOCUMENTS                         KNOWLEDGE STORE\n        ─────────                         ───────────────\n        (Excel / PPT /                    (entities + facts + edges,\n         PDF / Word)                       deduplicated, exact, queryable)\n\n   ┌─────────────────────────┐      ┌──────────────────────────────┐\n   │  project-list.xlsx      │      │  entity: \"Acme Corp\"          │\n   │  ┌────────┬─────────┐   │      │    type: company              │\n   │  │ Person │ Client  │   │ ───► │    aliases: [Acme, Acme Inc.] │\n   │  ├────────┼─────────┤   │      │    facts:                     │\n   │  │ Jane   │ Acme    │   │      │      industry=retail (doc A)  │\n   │  │ Erik   │ Acme    │   │      │      hq=Boston       (doc B)  │\n   │  └────────┴─────────┘   │      └──────────────────────────────┘\n   └─────────────────────────┘                 ▲           │\n        │                                       │           │\n        │  EXTRACTION + RESOLUTION              │           │  QUERY\n        │  (background worker,                  │           │  ( where / traverse\n        │   per-row, dedup inline)              │           │    / aggregate )\n        │                                       │           ▼\n        └───────────────────────────────────────   ┌──────────────────────┐\n                                                    │  \"list all retail    │\n            ┌───────────────────────────────┐       │   companies\" → exact │\n            │  edge: Jane —worked_on→ Acme   │ ◄───► │  \"count per industry\"│\n            │  edge: Erik —worked_on→ Acme   │       │  \"who worked w/ Acme\"│\n            └───────────────────────────────┘       └──────────────────────┘\n",[481],{"type":15,"tag":143,"props":482,"children":483},{"__ignoreMap":7},[484],{"type":21,"value":479},{"type":15,"tag":24,"props":486,"children":487},{},[488,490,495,497,502,504,509,511,516,518,523,525,530,532,537,539,544],{"type":21,"value":489},"A ",{"type":15,"tag":48,"props":491,"children":492},{},[493],{"type":21,"value":494},"document",{"type":21,"value":496}," goes in. The platform classifies each block as\n",{"type":15,"tag":30,"props":498,"children":499},{},[500],{"type":21,"value":501},"tabular",{"type":21,"value":503}," (rows of entities) or ",{"type":15,"tag":30,"props":505,"children":506},{},[507],{"type":21,"value":508},"prose",{"type":21,"value":510},", then runs an LLM\nextraction pass that pulls out ",{"type":15,"tag":48,"props":512,"children":513},{},[514],{"type":21,"value":515},"entities",{"type":21,"value":517}," (a company, a person,\na skill), their ",{"type":15,"tag":48,"props":519,"children":520},{},[521],{"type":21,"value":522},"attribute facts",{"type":21,"value":524}," (industry, headcount, each\ncarrying its own source), and the ",{"type":15,"tag":48,"props":526,"children":527},{},[528],{"type":21,"value":529},"relationships",{"type":21,"value":531}," between them\n(Jane ",{"type":15,"tag":30,"props":533,"children":534},{},[535],{"type":21,"value":536},"worked_on",{"type":21,"value":538}," Acme). Before anything is written, each entity\nis ",{"type":15,"tag":48,"props":540,"children":541},{},[542],{"type":21,"value":543},"resolved",{"type":21,"value":545}," against what's already there — \"Acme\", \"Acme\nInc.\" and \"Acme Corp\" collapse into one canonical node — so your\ncounts and lists are clean.",{"type":15,"tag":24,"props":547,"children":548},{},[549,551,556],{"type":21,"value":550},"At query time you don't do similarity search. You issue a\n",{"type":15,"tag":48,"props":552,"children":553},{},[554],{"type":21,"value":555},"structured query",{"type":21,"value":557},": select an entity type, filter by attribute\npredicates, optionally traverse one or two relationship hops, and\noptionally reduce to a count or a group-by. The answer is exact\nand exhaustive, and it's filtered to exactly the documents the\nasking user is allowed to see.",{"type":15,"tag":24,"props":559,"children":560},{},[561],{"type":21,"value":562},"That's the whole story. Everything below is mechanics.",{"type":15,"tag":131,"props":564,"children":566},{"id":565},"quick-start-from-documents-to-an-exact-list",[567],{"type":21,"value":568},"Quick Start: From Documents To An Exact List",{"type":15,"tag":24,"props":570,"children":571},{},[572],{"type":21,"value":573},"Let's do the smallest end-to-end thing that has value. You have\nan app with a Document model holding a pile of client documents.\nYou want to answer \"list every company, by industry.\"",{"type":15,"tag":24,"props":575,"children":576},{},[577,579,584,586,590,592,597,599,604],{"type":21,"value":578},"Four steps: ",{"type":15,"tag":48,"props":580,"children":581},{},[582],{"type":21,"value":583},"declare",{"type":21,"value":585}," a dataset, ",{"type":15,"tag":48,"props":587,"children":588},{},[589],{"type":21,"value":583},{"type":21,"value":591}," the entity type,\n",{"type":15,"tag":48,"props":593,"children":594},{},[595],{"type":21,"value":596},"backfill",{"type":21,"value":598}," the documents, ",{"type":15,"tag":48,"props":600,"children":601},{},[602],{"type":21,"value":603},"query",{"type":21,"value":605},".",{"type":15,"tag":477,"props":607,"children":611},{"code":608,"language":609,"meta":7,"className":610,"style":7},"// action: setupAndQueryClients\nfunction setupAndQueryClients() {\n    var k = context.getKnowledge();\n\n    // 1. Declare a dataset (idempotent per (tenant, app, datasetId))\n    if (!datasetExists(k, \"clients\")) {\n        k.createDataset(\"clients\", {\n            name: \"Client corpus\",\n            extractionModel: \"gemini-3.1-flash-lite\"\n        });\n\n        // 2. Declare what to extract and how to deduplicate it\n        k.addEntityType(\"clients\", {\n            type:           \"company\",\n            attributes:     [\"industry\", \"hq\", \"headcount\"],\n            extractionHint: \"Companies the firm has worked with as a client.\",\n            dedupKeys:      [\"canonicalName\"]\n        });\n    }\n\n    // 3. Enqueue every Document-model record for extraction.\n    //    This runs in the background; it returns immediately.\n    var enq = k.backfill(\"clients\");\n    context.log(\"Enqueued \" + enq.enqueued + \" documents\");\n\n    // 4. Query — once extraction has run (watch jobSummary), this is\n    //    an exact, deduplicated, access-filtered list.\n    var companies = k.query(\"clients\", {\n        entityType: \"company\",\n        where: [{ attr: \"industry\", op: \"eq\", value: \"retail\" }],\n        limit: 100\n    });\n    companies.forEach(function (c) {\n        context.log(c.canonicalName + \"  (\" + c.attributes.hq + \")\");\n    });\n}\n\nfunction datasetExists(k, id) {\n    try { k.listEntityTypes(id); return true; }\n    catch (e) { return false; }\n}\n","javascript","language-javascript shiki shiki-themes github-light github-dark",[612],{"type":15,"tag":143,"props":613,"children":614},{"__ignoreMap":7},[615,627,649,683,693,702,742,770,789,803,812,820,829,854,872,909,927,946,954,963,971,980,989,1028,1075,1083,1092,1101,1138,1155,1193,1208,1217,1254,1303,1311,1320,1328,1363,1402,1429],{"type":15,"tag":616,"props":617,"children":620},"span",{"class":618,"line":619},"line",1,[621],{"type":15,"tag":616,"props":622,"children":624},{"style":623},"--shiki-default:#6A737D;--shiki-dark:#6A737D",[625],{"type":21,"value":626},"// action: setupAndQueryClients\n",{"type":15,"tag":616,"props":628,"children":630},{"class":618,"line":629},2,[631,637,643],{"type":15,"tag":616,"props":632,"children":634},{"style":633},"--shiki-default:#D73A49;--shiki-dark:#F97583",[635],{"type":21,"value":636},"function",{"type":15,"tag":616,"props":638,"children":640},{"style":639},"--shiki-default:#6F42C1;--shiki-dark:#B392F0",[641],{"type":21,"value":642}," setupAndQueryClients",{"type":15,"tag":616,"props":644,"children":646},{"style":645},"--shiki-default:#24292E;--shiki-dark:#E1E4E8",[647],{"type":21,"value":648},"() {\n",{"type":15,"tag":616,"props":650,"children":652},{"class":618,"line":651},3,[653,658,663,668,673,678],{"type":15,"tag":616,"props":654,"children":655},{"style":633},[656],{"type":21,"value":657},"    var",{"type":15,"tag":616,"props":659,"children":660},{"style":645},[661],{"type":21,"value":662}," k ",{"type":15,"tag":616,"props":664,"children":665},{"style":633},[666],{"type":21,"value":667},"=",{"type":15,"tag":616,"props":669,"children":670},{"style":645},[671],{"type":21,"value":672}," context.",{"type":15,"tag":616,"props":674,"children":675},{"style":639},[676],{"type":21,"value":677},"getKnowledge",{"type":15,"tag":616,"props":679,"children":680},{"style":645},[681],{"type":21,"value":682},"();\n",{"type":15,"tag":616,"props":684,"children":686},{"class":618,"line":685},4,[687],{"type":15,"tag":616,"props":688,"children":690},{"emptyLinePlaceholder":689},true,[691],{"type":21,"value":692},"\n",{"type":15,"tag":616,"props":694,"children":696},{"class":618,"line":695},5,[697],{"type":15,"tag":616,"props":698,"children":699},{"style":623},[700],{"type":21,"value":701},"    // 1. Declare a dataset (idempotent per (tenant, app, datasetId))\n",{"type":15,"tag":616,"props":703,"children":705},{"class":618,"line":704},6,[706,711,716,721,726,731,737],{"type":15,"tag":616,"props":707,"children":708},{"style":633},[709],{"type":21,"value":710},"    if",{"type":15,"tag":616,"props":712,"children":713},{"style":645},[714],{"type":21,"value":715}," (",{"type":15,"tag":616,"props":717,"children":718},{"style":633},[719],{"type":21,"value":720},"!",{"type":15,"tag":616,"props":722,"children":723},{"style":639},[724],{"type":21,"value":725},"datasetExists",{"type":15,"tag":616,"props":727,"children":728},{"style":645},[729],{"type":21,"value":730},"(k, ",{"type":15,"tag":616,"props":732,"children":734},{"style":733},"--shiki-default:#032F62;--shiki-dark:#9ECBFF",[735],{"type":21,"value":736},"\"clients\"",{"type":15,"tag":616,"props":738,"children":739},{"style":645},[740],{"type":21,"value":741},")) {\n",{"type":15,"tag":616,"props":743,"children":745},{"class":618,"line":744},7,[746,751,756,761,765],{"type":15,"tag":616,"props":747,"children":748},{"style":645},[749],{"type":21,"value":750},"        k.",{"type":15,"tag":616,"props":752,"children":753},{"style":639},[754],{"type":21,"value":755},"createDataset",{"type":15,"tag":616,"props":757,"children":758},{"style":645},[759],{"type":21,"value":760},"(",{"type":15,"tag":616,"props":762,"children":763},{"style":733},[764],{"type":21,"value":736},{"type":15,"tag":616,"props":766,"children":767},{"style":645},[768],{"type":21,"value":769},", {\n",{"type":15,"tag":616,"props":771,"children":773},{"class":618,"line":772},8,[774,779,784],{"type":15,"tag":616,"props":775,"children":776},{"style":645},[777],{"type":21,"value":778},"            name: ",{"type":15,"tag":616,"props":780,"children":781},{"style":733},[782],{"type":21,"value":783},"\"Client corpus\"",{"type":15,"tag":616,"props":785,"children":786},{"style":645},[787],{"type":21,"value":788},",\n",{"type":15,"tag":616,"props":790,"children":792},{"class":618,"line":791},9,[793,798],{"type":15,"tag":616,"props":794,"children":795},{"style":645},[796],{"type":21,"value":797},"            extractionModel: ",{"type":15,"tag":616,"props":799,"children":800},{"style":733},[801],{"type":21,"value":802},"\"gemini-3.1-flash-lite\"\n",{"type":15,"tag":616,"props":804,"children":806},{"class":618,"line":805},10,[807],{"type":15,"tag":616,"props":808,"children":809},{"style":645},[810],{"type":21,"value":811},"        });\n",{"type":15,"tag":616,"props":813,"children":815},{"class":618,"line":814},11,[816],{"type":15,"tag":616,"props":817,"children":818},{"emptyLinePlaceholder":689},[819],{"type":21,"value":692},{"type":15,"tag":616,"props":821,"children":823},{"class":618,"line":822},12,[824],{"type":15,"tag":616,"props":825,"children":826},{"style":623},[827],{"type":21,"value":828},"        // 2. Declare what to extract and how to deduplicate it\n",{"type":15,"tag":616,"props":830,"children":832},{"class":618,"line":831},13,[833,837,842,846,850],{"type":15,"tag":616,"props":834,"children":835},{"style":645},[836],{"type":21,"value":750},{"type":15,"tag":616,"props":838,"children":839},{"style":639},[840],{"type":21,"value":841},"addEntityType",{"type":15,"tag":616,"props":843,"children":844},{"style":645},[845],{"type":21,"value":760},{"type":15,"tag":616,"props":847,"children":848},{"style":733},[849],{"type":21,"value":736},{"type":15,"tag":616,"props":851,"children":852},{"style":645},[853],{"type":21,"value":769},{"type":15,"tag":616,"props":855,"children":857},{"class":618,"line":856},14,[858,863,868],{"type":15,"tag":616,"props":859,"children":860},{"style":645},[861],{"type":21,"value":862},"            type:           ",{"type":15,"tag":616,"props":864,"children":865},{"style":733},[866],{"type":21,"value":867},"\"company\"",{"type":15,"tag":616,"props":869,"children":870},{"style":645},[871],{"type":21,"value":788},{"type":15,"tag":616,"props":873,"children":875},{"class":618,"line":874},15,[876,881,886,890,895,899,904],{"type":15,"tag":616,"props":877,"children":878},{"style":645},[879],{"type":21,"value":880},"            attributes:     [",{"type":15,"tag":616,"props":882,"children":883},{"style":733},[884],{"type":21,"value":885},"\"industry\"",{"type":15,"tag":616,"props":887,"children":888},{"style":645},[889],{"type":21,"value":76},{"type":15,"tag":616,"props":891,"children":892},{"style":733},[893],{"type":21,"value":894},"\"hq\"",{"type":15,"tag":616,"props":896,"children":897},{"style":645},[898],{"type":21,"value":76},{"type":15,"tag":616,"props":900,"children":901},{"style":733},[902],{"type":21,"value":903},"\"headcount\"",{"type":15,"tag":616,"props":905,"children":906},{"style":645},[907],{"type":21,"value":908},"],\n",{"type":15,"tag":616,"props":910,"children":912},{"class":618,"line":911},16,[913,918,923],{"type":15,"tag":616,"props":914,"children":915},{"style":645},[916],{"type":21,"value":917},"            extractionHint: ",{"type":15,"tag":616,"props":919,"children":920},{"style":733},[921],{"type":21,"value":922},"\"Companies the firm has worked with as a client.\"",{"type":15,"tag":616,"props":924,"children":925},{"style":645},[926],{"type":21,"value":788},{"type":15,"tag":616,"props":928,"children":930},{"class":618,"line":929},17,[931,936,941],{"type":15,"tag":616,"props":932,"children":933},{"style":645},[934],{"type":21,"value":935},"            dedupKeys:      [",{"type":15,"tag":616,"props":937,"children":938},{"style":733},[939],{"type":21,"value":940},"\"canonicalName\"",{"type":15,"tag":616,"props":942,"children":943},{"style":645},[944],{"type":21,"value":945},"]\n",{"type":15,"tag":616,"props":947,"children":949},{"class":618,"line":948},18,[950],{"type":15,"tag":616,"props":951,"children":952},{"style":645},[953],{"type":21,"value":811},{"type":15,"tag":616,"props":955,"children":957},{"class":618,"line":956},19,[958],{"type":15,"tag":616,"props":959,"children":960},{"style":645},[961],{"type":21,"value":962},"    }\n",{"type":15,"tag":616,"props":964,"children":966},{"class":618,"line":965},20,[967],{"type":15,"tag":616,"props":968,"children":969},{"emptyLinePlaceholder":689},[970],{"type":21,"value":692},{"type":15,"tag":616,"props":972,"children":974},{"class":618,"line":973},21,[975],{"type":15,"tag":616,"props":976,"children":977},{"style":623},[978],{"type":21,"value":979},"    // 3. Enqueue every Document-model record for extraction.\n",{"type":15,"tag":616,"props":981,"children":983},{"class":618,"line":982},22,[984],{"type":15,"tag":616,"props":985,"children":986},{"style":623},[987],{"type":21,"value":988},"    //    This runs in the background; it returns immediately.\n",{"type":15,"tag":616,"props":990,"children":992},{"class":618,"line":991},23,[993,997,1002,1006,1011,1015,1019,1023],{"type":15,"tag":616,"props":994,"children":995},{"style":633},[996],{"type":21,"value":657},{"type":15,"tag":616,"props":998,"children":999},{"style":645},[1000],{"type":21,"value":1001}," enq ",{"type":15,"tag":616,"props":1003,"children":1004},{"style":633},[1005],{"type":21,"value":667},{"type":15,"tag":616,"props":1007,"children":1008},{"style":645},[1009],{"type":21,"value":1010}," k.",{"type":15,"tag":616,"props":1012,"children":1013},{"style":639},[1014],{"type":21,"value":596},{"type":15,"tag":616,"props":1016,"children":1017},{"style":645},[1018],{"type":21,"value":760},{"type":15,"tag":616,"props":1020,"children":1021},{"style":733},[1022],{"type":21,"value":736},{"type":15,"tag":616,"props":1024,"children":1025},{"style":645},[1026],{"type":21,"value":1027},");\n",{"type":15,"tag":616,"props":1029,"children":1031},{"class":618,"line":1030},24,[1032,1037,1042,1046,1051,1056,1061,1066,1071],{"type":15,"tag":616,"props":1033,"children":1034},{"style":645},[1035],{"type":21,"value":1036},"    context.",{"type":15,"tag":616,"props":1038,"children":1039},{"style":639},[1040],{"type":21,"value":1041},"log",{"type":15,"tag":616,"props":1043,"children":1044},{"style":645},[1045],{"type":21,"value":760},{"type":15,"tag":616,"props":1047,"children":1048},{"style":733},[1049],{"type":21,"value":1050},"\"Enqueued \"",{"type":15,"tag":616,"props":1052,"children":1053},{"style":633},[1054],{"type":21,"value":1055}," +",{"type":15,"tag":616,"props":1057,"children":1058},{"style":645},[1059],{"type":21,"value":1060}," enq.enqueued ",{"type":15,"tag":616,"props":1062,"children":1063},{"style":633},[1064],{"type":21,"value":1065},"+",{"type":15,"tag":616,"props":1067,"children":1068},{"style":733},[1069],{"type":21,"value":1070}," \" documents\"",{"type":15,"tag":616,"props":1072,"children":1073},{"style":645},[1074],{"type":21,"value":1027},{"type":15,"tag":616,"props":1076,"children":1078},{"class":618,"line":1077},25,[1079],{"type":15,"tag":616,"props":1080,"children":1081},{"emptyLinePlaceholder":689},[1082],{"type":21,"value":692},{"type":15,"tag":616,"props":1084,"children":1086},{"class":618,"line":1085},26,[1087],{"type":15,"tag":616,"props":1088,"children":1089},{"style":623},[1090],{"type":21,"value":1091},"    // 4. Query — once extraction has run (watch jobSummary), this is\n",{"type":15,"tag":616,"props":1093,"children":1095},{"class":618,"line":1094},27,[1096],{"type":15,"tag":616,"props":1097,"children":1098},{"style":623},[1099],{"type":21,"value":1100},"    //    an exact, deduplicated, access-filtered list.\n",{"type":15,"tag":616,"props":1102,"children":1104},{"class":618,"line":1103},28,[1105,1109,1114,1118,1122,1126,1130,1134],{"type":15,"tag":616,"props":1106,"children":1107},{"style":633},[1108],{"type":21,"value":657},{"type":15,"tag":616,"props":1110,"children":1111},{"style":645},[1112],{"type":21,"value":1113}," companies ",{"type":15,"tag":616,"props":1115,"children":1116},{"style":633},[1117],{"type":21,"value":667},{"type":15,"tag":616,"props":1119,"children":1120},{"style":645},[1121],{"type":21,"value":1010},{"type":15,"tag":616,"props":1123,"children":1124},{"style":639},[1125],{"type":21,"value":603},{"type":15,"tag":616,"props":1127,"children":1128},{"style":645},[1129],{"type":21,"value":760},{"type":15,"tag":616,"props":1131,"children":1132},{"style":733},[1133],{"type":21,"value":736},{"type":15,"tag":616,"props":1135,"children":1136},{"style":645},[1137],{"type":21,"value":769},{"type":15,"tag":616,"props":1139,"children":1141},{"class":618,"line":1140},29,[1142,1147,1151],{"type":15,"tag":616,"props":1143,"children":1144},{"style":645},[1145],{"type":21,"value":1146},"        entityType: ",{"type":15,"tag":616,"props":1148,"children":1149},{"style":733},[1150],{"type":21,"value":867},{"type":15,"tag":616,"props":1152,"children":1153},{"style":645},[1154],{"type":21,"value":788},{"type":15,"tag":616,"props":1156,"children":1158},{"class":618,"line":1157},30,[1159,1164,1168,1173,1178,1183,1188],{"type":15,"tag":616,"props":1160,"children":1161},{"style":645},[1162],{"type":21,"value":1163},"        where: [{ attr: ",{"type":15,"tag":616,"props":1165,"children":1166},{"style":733},[1167],{"type":21,"value":885},{"type":15,"tag":616,"props":1169,"children":1170},{"style":645},[1171],{"type":21,"value":1172},", op: ",{"type":15,"tag":616,"props":1174,"children":1175},{"style":733},[1176],{"type":21,"value":1177},"\"eq\"",{"type":15,"tag":616,"props":1179,"children":1180},{"style":645},[1181],{"type":21,"value":1182},", value: ",{"type":15,"tag":616,"props":1184,"children":1185},{"style":733},[1186],{"type":21,"value":1187},"\"retail\"",{"type":15,"tag":616,"props":1189,"children":1190},{"style":645},[1191],{"type":21,"value":1192}," }],\n",{"type":15,"tag":616,"props":1194,"children":1196},{"class":618,"line":1195},31,[1197,1202],{"type":15,"tag":616,"props":1198,"children":1199},{"style":645},[1200],{"type":21,"value":1201},"        limit: ",{"type":15,"tag":616,"props":1203,"children":1205},{"style":1204},"--shiki-default:#005CC5;--shiki-dark:#79B8FF",[1206],{"type":21,"value":1207},"100\n",{"type":15,"tag":616,"props":1209,"children":1211},{"class":618,"line":1210},32,[1212],{"type":15,"tag":616,"props":1213,"children":1214},{"style":645},[1215],{"type":21,"value":1216},"    });\n",{"type":15,"tag":616,"props":1218,"children":1220},{"class":618,"line":1219},33,[1221,1226,1231,1235,1239,1243,1249],{"type":15,"tag":616,"props":1222,"children":1223},{"style":645},[1224],{"type":21,"value":1225},"    companies.",{"type":15,"tag":616,"props":1227,"children":1228},{"style":639},[1229],{"type":21,"value":1230},"forEach",{"type":15,"tag":616,"props":1232,"children":1233},{"style":645},[1234],{"type":21,"value":760},{"type":15,"tag":616,"props":1236,"children":1237},{"style":633},[1238],{"type":21,"value":636},{"type":15,"tag":616,"props":1240,"children":1241},{"style":645},[1242],{"type":21,"value":715},{"type":15,"tag":616,"props":1244,"children":1246},{"style":1245},"--shiki-default:#E36209;--shiki-dark:#FFAB70",[1247],{"type":21,"value":1248},"c",{"type":15,"tag":616,"props":1250,"children":1251},{"style":645},[1252],{"type":21,"value":1253},") {\n",{"type":15,"tag":616,"props":1255,"children":1257},{"class":618,"line":1256},34,[1258,1263,1267,1272,1276,1281,1285,1290,1294,1299],{"type":15,"tag":616,"props":1259,"children":1260},{"style":645},[1261],{"type":21,"value":1262},"        context.",{"type":15,"tag":616,"props":1264,"children":1265},{"style":639},[1266],{"type":21,"value":1041},{"type":15,"tag":616,"props":1268,"children":1269},{"style":645},[1270],{"type":21,"value":1271},"(c.canonicalName ",{"type":15,"tag":616,"props":1273,"children":1274},{"style":633},[1275],{"type":21,"value":1065},{"type":15,"tag":616,"props":1277,"children":1278},{"style":733},[1279],{"type":21,"value":1280}," \"  (\"",{"type":15,"tag":616,"props":1282,"children":1283},{"style":633},[1284],{"type":21,"value":1055},{"type":15,"tag":616,"props":1286,"children":1287},{"style":645},[1288],{"type":21,"value":1289}," c.attributes.hq ",{"type":15,"tag":616,"props":1291,"children":1292},{"style":633},[1293],{"type":21,"value":1065},{"type":15,"tag":616,"props":1295,"children":1296},{"style":733},[1297],{"type":21,"value":1298}," \")\"",{"type":15,"tag":616,"props":1300,"children":1301},{"style":645},[1302],{"type":21,"value":1027},{"type":15,"tag":616,"props":1304,"children":1306},{"class":618,"line":1305},35,[1307],{"type":15,"tag":616,"props":1308,"children":1309},{"style":645},[1310],{"type":21,"value":1216},{"type":15,"tag":616,"props":1312,"children":1314},{"class":618,"line":1313},36,[1315],{"type":15,"tag":616,"props":1316,"children":1317},{"style":645},[1318],{"type":21,"value":1319},"}\n",{"type":15,"tag":616,"props":1321,"children":1323},{"class":618,"line":1322},37,[1324],{"type":15,"tag":616,"props":1325,"children":1326},{"emptyLinePlaceholder":689},[1327],{"type":21,"value":692},{"type":15,"tag":616,"props":1329,"children":1331},{"class":618,"line":1330},38,[1332,1336,1341,1345,1350,1354,1359],{"type":15,"tag":616,"props":1333,"children":1334},{"style":633},[1335],{"type":21,"value":636},{"type":15,"tag":616,"props":1337,"children":1338},{"style":639},[1339],{"type":21,"value":1340}," datasetExists",{"type":15,"tag":616,"props":1342,"children":1343},{"style":645},[1344],{"type":21,"value":760},{"type":15,"tag":616,"props":1346,"children":1347},{"style":1245},[1348],{"type":21,"value":1349},"k",{"type":15,"tag":616,"props":1351,"children":1352},{"style":645},[1353],{"type":21,"value":76},{"type":15,"tag":616,"props":1355,"children":1356},{"style":1245},[1357],{"type":21,"value":1358},"id",{"type":15,"tag":616,"props":1360,"children":1361},{"style":645},[1362],{"type":21,"value":1253},{"type":15,"tag":616,"props":1364,"children":1366},{"class":618,"line":1365},39,[1367,1372,1377,1382,1387,1392,1397],{"type":15,"tag":616,"props":1368,"children":1369},{"style":633},[1370],{"type":21,"value":1371},"    try",{"type":15,"tag":616,"props":1373,"children":1374},{"style":645},[1375],{"type":21,"value":1376}," { k.",{"type":15,"tag":616,"props":1378,"children":1379},{"style":639},[1380],{"type":21,"value":1381},"listEntityTypes",{"type":15,"tag":616,"props":1383,"children":1384},{"style":645},[1385],{"type":21,"value":1386},"(id); ",{"type":15,"tag":616,"props":1388,"children":1389},{"style":633},[1390],{"type":21,"value":1391},"return",{"type":15,"tag":616,"props":1393,"children":1394},{"style":1204},[1395],{"type":21,"value":1396}," true",{"type":15,"tag":616,"props":1398,"children":1399},{"style":645},[1400],{"type":21,"value":1401},"; }\n",{"type":15,"tag":616,"props":1403,"children":1405},{"class":618,"line":1404},40,[1406,1411,1416,1420,1425],{"type":15,"tag":616,"props":1407,"children":1408},{"style":633},[1409],{"type":21,"value":1410},"    catch",{"type":15,"tag":616,"props":1412,"children":1413},{"style":645},[1414],{"type":21,"value":1415}," (e) { ",{"type":15,"tag":616,"props":1417,"children":1418},{"style":633},[1419],{"type":21,"value":1391},{"type":15,"tag":616,"props":1421,"children":1422},{"style":1204},[1423],{"type":21,"value":1424}," false",{"type":15,"tag":616,"props":1426,"children":1427},{"style":645},[1428],{"type":21,"value":1401},{"type":15,"tag":616,"props":1430,"children":1432},{"class":618,"line":1431},41,[1433],{"type":15,"tag":616,"props":1434,"children":1435},{"style":645},[1436],{"type":21,"value":1319},{"type":15,"tag":24,"props":1438,"children":1439},{},[1440,1442,1448],{"type":21,"value":1441},"That's it. No collections to create, no schema migration. You\ndeclared two things (a dataset and a type), pointed the pipeline\nat your documents, and got back an exact list. Adding ",{"type":15,"tag":143,"props":1443,"children":1445},{"className":1444},[],[1446],{"type":21,"value":1447},"industry",{"type":21,"value":1449},"\ncounts is one more query:",{"type":15,"tag":477,"props":1451,"children":1453},{"code":1452,"language":609,"meta":7,"className":610,"style":7},"var counts = k.query(\"clients\", {\n    entityType: \"company\",\n    aggregate: { op: \"group_by\", attr: \"industry\" }\n});\n// → [ { _id: \"retail\", count: 14 }, { _id: \"fintech\", count: 9 }, ... ]\n",[1454],{"type":15,"tag":143,"props":1455,"children":1456},{"__ignoreMap":7},[1457,1494,1510,1537,1545],{"type":15,"tag":616,"props":1458,"children":1459},{"class":618,"line":619},[1460,1465,1470,1474,1478,1482,1486,1490],{"type":15,"tag":616,"props":1461,"children":1462},{"style":633},[1463],{"type":21,"value":1464},"var",{"type":15,"tag":616,"props":1466,"children":1467},{"style":645},[1468],{"type":21,"value":1469}," counts ",{"type":15,"tag":616,"props":1471,"children":1472},{"style":633},[1473],{"type":21,"value":667},{"type":15,"tag":616,"props":1475,"children":1476},{"style":645},[1477],{"type":21,"value":1010},{"type":15,"tag":616,"props":1479,"children":1480},{"style":639},[1481],{"type":21,"value":603},{"type":15,"tag":616,"props":1483,"children":1484},{"style":645},[1485],{"type":21,"value":760},{"type":15,"tag":616,"props":1487,"children":1488},{"style":733},[1489],{"type":21,"value":736},{"type":15,"tag":616,"props":1491,"children":1492},{"style":645},[1493],{"type":21,"value":769},{"type":15,"tag":616,"props":1495,"children":1496},{"class":618,"line":629},[1497,1502,1506],{"type":15,"tag":616,"props":1498,"children":1499},{"style":645},[1500],{"type":21,"value":1501},"    entityType: ",{"type":15,"tag":616,"props":1503,"children":1504},{"style":733},[1505],{"type":21,"value":867},{"type":15,"tag":616,"props":1507,"children":1508},{"style":645},[1509],{"type":21,"value":788},{"type":15,"tag":616,"props":1511,"children":1512},{"class":618,"line":651},[1513,1518,1523,1528,1532],{"type":15,"tag":616,"props":1514,"children":1515},{"style":645},[1516],{"type":21,"value":1517},"    aggregate: { op: ",{"type":15,"tag":616,"props":1519,"children":1520},{"style":733},[1521],{"type":21,"value":1522},"\"group_by\"",{"type":15,"tag":616,"props":1524,"children":1525},{"style":645},[1526],{"type":21,"value":1527},", attr: ",{"type":15,"tag":616,"props":1529,"children":1530},{"style":733},[1531],{"type":21,"value":885},{"type":15,"tag":616,"props":1533,"children":1534},{"style":645},[1535],{"type":21,"value":1536}," }\n",{"type":15,"tag":616,"props":1538,"children":1539},{"class":618,"line":685},[1540],{"type":15,"tag":616,"props":1541,"children":1542},{"style":645},[1543],{"type":21,"value":1544},"});\n",{"type":15,"tag":616,"props":1546,"children":1547},{"class":618,"line":695},[1548],{"type":15,"tag":616,"props":1549,"children":1550},{"style":623},[1551],{"type":21,"value":1552},"// → [ { _id: \"retail\", count: 14 }, { _id: \"fintech\", count: 9 }, ... ]\n",{"type":15,"tag":24,"props":1554,"children":1555},{},[1556],{"type":21,"value":1557},"The rest of this guide unpacks each step and shows how far it\ngoes.",{"type":15,"tag":131,"props":1559,"children":1561},{"id":1560},"the-four-building-blocks",[1562],{"type":21,"value":1563},"The Four Building Blocks",{"type":15,"tag":24,"props":1565,"children":1566},{},[1567],{"type":21,"value":1568},"Everything in the knowledge layer is built from four nouns.",{"type":15,"tag":1570,"props":1571,"children":1573},"h3",{"id":1572},"dataset",[1574],{"type":21,"value":1575},"Dataset",{"type":15,"tag":24,"props":1577,"children":1578},{},[1579,1580,1584,1586,1592],{"type":21,"value":489},{"type":15,"tag":48,"props":1581,"children":1582},{},[1583],{"type":21,"value":1572},{"type":21,"value":1585}," is the container — a named knowledge graph scoped\nto your app. It holds the extraction configuration (entity types,\nrelationship types, taxonomy) and owns all the entities and edges\nextracted under it. You'll usually have one per problem domain\n(\"clients\", \"products\", \"case-law\"), keyed by a ",{"type":15,"tag":143,"props":1587,"children":1589},{"className":1588},[],[1590],{"type":21,"value":1591},"datasetId",{"type":21,"value":1593}," you\nchoose. A dataset also pins the models used for extraction and\nresolution.",{"type":15,"tag":1570,"props":1595,"children":1597},{"id":1596},"entity",[1598],{"type":21,"value":1599},"Entity",{"type":15,"tag":24,"props":1601,"children":1602},{},[1603,1605,1609,1611,1617],{"type":21,"value":1604},"An ",{"type":15,"tag":48,"props":1606,"children":1607},{},[1608],{"type":21,"value":1596},{"type":21,"value":1610}," is a resolved, real-world thing of a configured\n",{"type":15,"tag":143,"props":1612,"children":1614},{"className":1613},[],[1615],{"type":21,"value":1616},"entityType",{"type":21,"value":1618}," — a company, a person, a skill. After deduplication\nit is a single canonical node, even though it was mentioned in\ntwenty documents under five spellings. It carries:",{"type":15,"tag":38,"props":1620,"children":1621},{},[1622,1633,1644,1661],{"type":15,"tag":42,"props":1623,"children":1624},{},[1625,1631],{"type":15,"tag":143,"props":1626,"children":1628},{"className":1627},[],[1629],{"type":21,"value":1630},"canonicalName",{"type":21,"value":1632}," — the resolved, preferred form.",{"type":15,"tag":42,"props":1634,"children":1635},{},[1636,1642],{"type":15,"tag":143,"props":1637,"children":1639},{"className":1638},[],[1640],{"type":21,"value":1641},"aliases[]",{"type":21,"value":1643}," — every observed variant (\"IBM\", \"I.B.M.\",\n\"International Business Machines\"), kept, not discarded.",{"type":15,"tag":42,"props":1645,"children":1646},{},[1647,1653,1655,1659],{"type":15,"tag":143,"props":1648,"children":1650},{"className":1649},[],[1651],{"type":21,"value":1652},"attributes[]",{"type":21,"value":1654}," — an array of ",{"type":15,"tag":48,"props":1656,"children":1657},{},[1658],{"type":21,"value":522},{"type":21,"value":1660},", not a flat\nkey/value bag (see below).",{"type":15,"tag":42,"props":1662,"children":1663},{},[1664,1670,1672,1678],{"type":15,"tag":143,"props":1665,"children":1667},{"className":1666},[],[1668],{"type":21,"value":1669},"sourceDocs[]",{"type":21,"value":1671}," / ",{"type":15,"tag":143,"props":1673,"children":1675},{"className":1674},[],[1676],{"type":21,"value":1677},"folderIds[]",{"type":21,"value":1679}," — the derived union of every\nsource that contributed a fact, used for fast access\npre-filtering.",{"type":15,"tag":24,"props":1681,"children":1682},{},[1683,1685,1690,1692,1698],{"type":21,"value":1684},"When you read an entity back through ",{"type":15,"tag":143,"props":1686,"children":1688},{"className":1687},[],[1689],{"type":21,"value":341},{"type":21,"value":1691},", attributes are\nflattened to a convenient ",{"type":15,"tag":143,"props":1693,"children":1695},{"className":1694},[],[1696],{"type":21,"value":1697},"{ key: value }",{"type":21,"value":1699}," map (first-wins when a\nmerged entity holds several facts for the same key). The raw\nper-fact structure stays underneath, where access control needs\nit.",{"type":15,"tag":1570,"props":1701,"children":1703},{"id":1702},"attribute-fact",[1704],{"type":21,"value":1705},"Attribute Fact",{"type":15,"tag":24,"props":1707,"children":1708},{},[1709,1711,1716,1718,1724,1726,1731,1733,1738],{"type":21,"value":1710},"This is the subtle, important one. An attribute is ",{"type":15,"tag":48,"props":1712,"children":1713},{},[1714],{"type":21,"value":1715},"not",{"type":21,"value":1717}," a bare\nproperty on the entity. It is a ",{"type":15,"tag":143,"props":1719,"children":1721},{"className":1720},[],[1722],{"type":21,"value":1723},"{ key, value, sourceDocId, folderIds, confidence }",{"type":21,"value":1725}," record. \"Acme is in retail\" is a ",{"type":15,"tag":30,"props":1727,"children":1728},{},[1729],{"type":21,"value":1730},"fact",{"type":21,"value":1732},"\nasserted ",{"type":15,"tag":30,"props":1734,"children":1735},{},[1736],{"type":21,"value":1737},"by a specific document",{"type":21,"value":1739},". The same entity can carry the\nsame key from several documents, each with its own source and its\nown access.",{"type":15,"tag":24,"props":1741,"children":1742},{},[1743,1745,1750],{"type":21,"value":1744},"Why it matters: it's what lets one canonical \"Acme\" node present\na ",{"type":15,"tag":30,"props":1746,"children":1747},{},[1748],{"type":21,"value":1749},"different",{"type":21,"value":1751}," view of itself to different users (you only see the\nfacts whose source you can read), and it's what lets the firm\nclick \"where does it say Acme is in retail?\" Facts carry\nprovenance because provenance does triple duty — access,\ntraceability, and dedup signal.",{"type":15,"tag":1570,"props":1753,"children":1755},{"id":1754},"relationship",[1756],{"type":21,"value":1757},"Relationship",{"type":15,"tag":24,"props":1759,"children":1760},{},[1761,1762,1766,1768,1772,1774,1780,1781,1787,1789,1795],{"type":21,"value":489},{"type":15,"tag":48,"props":1763,"children":1764},{},[1765],{"type":21,"value":1754},{"type":21,"value":1767}," is a directed, typed edge between two\n",{"type":15,"tag":30,"props":1769,"children":1770},{},[1771],{"type":21,"value":543},{"type":21,"value":1773}," entities: ",{"type":15,"tag":143,"props":1775,"children":1777},{"className":1776},[],[1778],{"type":21,"value":1779},"Jane —worked_on→ \"Project Atlas\"",{"type":21,"value":788},{"type":15,"tag":143,"props":1782,"children":1784},{"className":1783},[],[1785],{"type":21,"value":1786},"\"Project Atlas\" —client_of→ Acme",{"type":21,"value":1788},". Edges are created between\ncanonical ids, never between raw name strings, so the graph\ndoesn't fragment across spelling variants. The relationship\nvocabulary is small and typed (you declare it), which keeps\ntraversal queries clean. Each edge carries ",{"type":15,"tag":143,"props":1790,"children":1792},{"className":1791},[],[1793],{"type":21,"value":1794},"confidence",{"type":21,"value":1796}," and a\nsource, just like a fact.",{"type":15,"tag":24,"props":1798,"children":1799},{},[1800,1802,1808,1810,1815],{"type":21,"value":1801},"Tabular rows are the high-confidence source for relationships:\na row ",{"type":15,"tag":143,"props":1803,"children":1805},{"className":1804},[],[1806],{"type":21,"value":1807},"person | project | client | year",{"type":21,"value":1809}," ",{"type":15,"tag":30,"props":1811,"children":1812},{},[1813],{"type":21,"value":1814},"is",{"type":21,"value":1816}," three edges, stated\nwith high reliability because row proximity is the relationship.\nProse-derived edges (\"Anna led the team at IBM\") are extracted\ntoo, but at lower confidence.",{"type":15,"tag":131,"props":1818,"children":1820},{"id":1819},"configuring-a-dataset",[1821],{"type":21,"value":1822},"Configuring A Dataset",{"type":15,"tag":24,"props":1824,"children":1825},{},[1826,1828,1832,1834,1839],{"type":21,"value":1827},"Configuration ",{"type":15,"tag":30,"props":1829,"children":1830},{},[1831],{"type":21,"value":1814},{"type":21,"value":1833}," the feature — adding or tuning a type is data,\nnot code. All config writes are on ",{"type":15,"tag":143,"props":1835,"children":1837},{"className":1836},[],[1838],{"type":21,"value":148},{"type":21,"value":605},{"type":15,"tag":1570,"props":1841,"children":1843},{"id":1842},"create-the-dataset",[1844],{"type":21,"value":1845},"Create The Dataset",{"type":15,"tag":477,"props":1847,"children":1849},{"code":1848,"language":609,"meta":7,"className":610,"style":7},"var ds = context.getKnowledge().createDataset(\"clients\", {\n    name:            \"Client corpus\",\n    extractionModel: \"gemini-3.1-flash-lite\", // bulk per-row extraction\n    resolutionModel: \"gemini-3.1-pro\"         // ambiguous-merge escalation\n});\n",[1850],{"type":15,"tag":143,"props":1851,"children":1852},{"__ignoreMap":7},[1853,1898,1914,1936,1954],{"type":15,"tag":616,"props":1854,"children":1855},{"class":618,"line":619},[1856,1860,1865,1869,1873,1877,1882,1886,1890,1894],{"type":15,"tag":616,"props":1857,"children":1858},{"style":633},[1859],{"type":21,"value":1464},{"type":15,"tag":616,"props":1861,"children":1862},{"style":645},[1863],{"type":21,"value":1864}," ds ",{"type":15,"tag":616,"props":1866,"children":1867},{"style":633},[1868],{"type":21,"value":667},{"type":15,"tag":616,"props":1870,"children":1871},{"style":645},[1872],{"type":21,"value":672},{"type":15,"tag":616,"props":1874,"children":1875},{"style":639},[1876],{"type":21,"value":677},{"type":15,"tag":616,"props":1878,"children":1879},{"style":645},[1880],{"type":21,"value":1881},"().",{"type":15,"tag":616,"props":1883,"children":1884},{"style":639},[1885],{"type":21,"value":755},{"type":15,"tag":616,"props":1887,"children":1888},{"style":645},[1889],{"type":21,"value":760},{"type":15,"tag":616,"props":1891,"children":1892},{"style":733},[1893],{"type":21,"value":736},{"type":15,"tag":616,"props":1895,"children":1896},{"style":645},[1897],{"type":21,"value":769},{"type":15,"tag":616,"props":1899,"children":1900},{"class":618,"line":629},[1901,1906,1910],{"type":15,"tag":616,"props":1902,"children":1903},{"style":645},[1904],{"type":21,"value":1905},"    name:            ",{"type":15,"tag":616,"props":1907,"children":1908},{"style":733},[1909],{"type":21,"value":783},{"type":15,"tag":616,"props":1911,"children":1912},{"style":645},[1913],{"type":21,"value":788},{"type":15,"tag":616,"props":1915,"children":1916},{"class":618,"line":651},[1917,1922,1927,1931],{"type":15,"tag":616,"props":1918,"children":1919},{"style":645},[1920],{"type":21,"value":1921},"    extractionModel: ",{"type":15,"tag":616,"props":1923,"children":1924},{"style":733},[1925],{"type":21,"value":1926},"\"gemini-3.1-flash-lite\"",{"type":15,"tag":616,"props":1928,"children":1929},{"style":645},[1930],{"type":21,"value":76},{"type":15,"tag":616,"props":1932,"children":1933},{"style":623},[1934],{"type":21,"value":1935},"// bulk per-row extraction\n",{"type":15,"tag":616,"props":1937,"children":1938},{"class":618,"line":685},[1939,1944,1949],{"type":15,"tag":616,"props":1940,"children":1941},{"style":645},[1942],{"type":21,"value":1943},"    resolutionModel: ",{"type":15,"tag":616,"props":1945,"children":1946},{"style":733},[1947],{"type":21,"value":1948},"\"gemini-3.1-pro\"",{"type":15,"tag":616,"props":1950,"children":1951},{"style":623},[1952],{"type":21,"value":1953},"         // ambiguous-merge escalation\n",{"type":15,"tag":616,"props":1955,"children":1956},{"class":618,"line":695},[1957],{"type":15,"tag":616,"props":1958,"children":1959},{"style":645},[1960],{"type":21,"value":1544},{"type":15,"tag":24,"props":1962,"children":1963},{},[1964,1969,1971,1981,1983,1988],{"type":15,"tag":143,"props":1965,"children":1967},{"className":1966},[],[1968],{"type":21,"value":755},{"type":21,"value":1970}," is ",{"type":15,"tag":48,"props":1972,"children":1973},{},[1974,1976],{"type":21,"value":1975},"one-per-",{"type":15,"tag":143,"props":1977,"children":1979},{"className":1978},[],[1980],{"type":21,"value":442},{"type":21,"value":1982}," — a\nduplicate id is rejected, so guard it (see the ",{"type":15,"tag":143,"props":1984,"children":1986},{"className":1985},[],[1987],{"type":21,"value":725},{"type":21,"value":1989},"\nhelper above). The two model fields are optional; they let you\nrun cheap, fast extraction on the bulk path and escalate only\ngenuinely ambiguous merge decisions to a stronger model.",{"type":15,"tag":1570,"props":1991,"children":1993},{"id":1992},"add-entity-types",[1994],{"type":21,"value":1995},"Add Entity Types",{"type":15,"tag":24,"props":1997,"children":1998},{},[1999,2001,2006],{"type":21,"value":2000},"An entity type declares what to pull out and, critically, ",{"type":15,"tag":30,"props":2002,"children":2003},{},[2004],{"type":21,"value":2005},"how to\ndecide two extractions are the same thing",{"type":21,"value":2007},":",{"type":15,"tag":477,"props":2009,"children":2011},{"code":2010,"language":609,"meta":7,"className":610,"style":7},"context.getKnowledge().addEntityType(\"clients\", {\n    type:           \"company\",\n    attributes:     [\"industry\", \"hq\", \"headcount\", \"ticker\"],\n    extractionHint: \"A client company the firm has done work for. \" +\n                    \"Prefer the legal name; capture stock ticker if present.\",\n    dedupKeys:      [\"canonicalName\", \"ticker\"],\n    autoMergeThreshold: 0.92,  // ≥ this similarity → merge automatically\n    reviewThreshold:    0.75,  // ≥ this but \u003C auto → flag for review\n    escalateAmbiguous:  true   // route hard calls to the resolution model\n});\n\ncontext.getKnowledge().addEntityType(\"clients\", {\n    type:           \"person\",\n    attributes:     [\"title\", \"email\"],\n    extractionHint: \"A consultant or client contact named in the document.\",\n    dedupKeys:      [\"email\"],     // people without a hard id stay conservative\n    reviewThreshold: 0.80,\n    escalateAmbiguous: true\n});\n",[2012],{"type":15,"tag":143,"props":2013,"children":2014},{"__ignoreMap":7},[2015,2047,2063,2104,2122,2134,2158,2181,2203,2221,2228,2235,2266,2282,2307,2323,2344,2361,2374],{"type":15,"tag":616,"props":2016,"children":2017},{"class":618,"line":619},[2018,2023,2027,2031,2035,2039,2043],{"type":15,"tag":616,"props":2019,"children":2020},{"style":645},[2021],{"type":21,"value":2022},"context.",{"type":15,"tag":616,"props":2024,"children":2025},{"style":639},[2026],{"type":21,"value":677},{"type":15,"tag":616,"props":2028,"children":2029},{"style":645},[2030],{"type":21,"value":1881},{"type":15,"tag":616,"props":2032,"children":2033},{"style":639},[2034],{"type":21,"value":841},{"type":15,"tag":616,"props":2036,"children":2037},{"style":645},[2038],{"type":21,"value":760},{"type":15,"tag":616,"props":2040,"children":2041},{"style":733},[2042],{"type":21,"value":736},{"type":15,"tag":616,"props":2044,"children":2045},{"style":645},[2046],{"type":21,"value":769},{"type":15,"tag":616,"props":2048,"children":2049},{"class":618,"line":629},[2050,2055,2059],{"type":15,"tag":616,"props":2051,"children":2052},{"style":645},[2053],{"type":21,"value":2054},"    type:           ",{"type":15,"tag":616,"props":2056,"children":2057},{"style":733},[2058],{"type":21,"value":867},{"type":15,"tag":616,"props":2060,"children":2061},{"style":645},[2062],{"type":21,"value":788},{"type":15,"tag":616,"props":2064,"children":2065},{"class":618,"line":651},[2066,2071,2075,2079,2083,2087,2091,2095,2100],{"type":15,"tag":616,"props":2067,"children":2068},{"style":645},[2069],{"type":21,"value":2070},"    attributes:     [",{"type":15,"tag":616,"props":2072,"children":2073},{"style":733},[2074],{"type":21,"value":885},{"type":15,"tag":616,"props":2076,"children":2077},{"style":645},[2078],{"type":21,"value":76},{"type":15,"tag":616,"props":2080,"children":2081},{"style":733},[2082],{"type":21,"value":894},{"type":15,"tag":616,"props":2084,"children":2085},{"style":645},[2086],{"type":21,"value":76},{"type":15,"tag":616,"props":2088,"children":2089},{"style":733},[2090],{"type":21,"value":903},{"type":15,"tag":616,"props":2092,"children":2093},{"style":645},[2094],{"type":21,"value":76},{"type":15,"tag":616,"props":2096,"children":2097},{"style":733},[2098],{"type":21,"value":2099},"\"ticker\"",{"type":15,"tag":616,"props":2101,"children":2102},{"style":645},[2103],{"type":21,"value":908},{"type":15,"tag":616,"props":2105,"children":2106},{"class":618,"line":685},[2107,2112,2117],{"type":15,"tag":616,"props":2108,"children":2109},{"style":645},[2110],{"type":21,"value":2111},"    extractionHint: ",{"type":15,"tag":616,"props":2113,"children":2114},{"style":733},[2115],{"type":21,"value":2116},"\"A client company the firm has done work for. \"",{"type":15,"tag":616,"props":2118,"children":2119},{"style":633},[2120],{"type":21,"value":2121}," +\n",{"type":15,"tag":616,"props":2123,"children":2124},{"class":618,"line":695},[2125,2130],{"type":15,"tag":616,"props":2126,"children":2127},{"style":733},[2128],{"type":21,"value":2129},"                    \"Prefer the legal name; capture stock ticker if present.\"",{"type":15,"tag":616,"props":2131,"children":2132},{"style":645},[2133],{"type":21,"value":788},{"type":15,"tag":616,"props":2135,"children":2136},{"class":618,"line":704},[2137,2142,2146,2150,2154],{"type":15,"tag":616,"props":2138,"children":2139},{"style":645},[2140],{"type":21,"value":2141},"    dedupKeys:      [",{"type":15,"tag":616,"props":2143,"children":2144},{"style":733},[2145],{"type":21,"value":940},{"type":15,"tag":616,"props":2147,"children":2148},{"style":645},[2149],{"type":21,"value":76},{"type":15,"tag":616,"props":2151,"children":2152},{"style":733},[2153],{"type":21,"value":2099},{"type":15,"tag":616,"props":2155,"children":2156},{"style":645},[2157],{"type":21,"value":908},{"type":15,"tag":616,"props":2159,"children":2160},{"class":618,"line":744},[2161,2166,2171,2176],{"type":15,"tag":616,"props":2162,"children":2163},{"style":645},[2164],{"type":21,"value":2165},"    autoMergeThreshold: ",{"type":15,"tag":616,"props":2167,"children":2168},{"style":1204},[2169],{"type":21,"value":2170},"0.92",{"type":15,"tag":616,"props":2172,"children":2173},{"style":645},[2174],{"type":21,"value":2175},",  ",{"type":15,"tag":616,"props":2177,"children":2178},{"style":623},[2179],{"type":21,"value":2180},"// ≥ this similarity → merge automatically\n",{"type":15,"tag":616,"props":2182,"children":2183},{"class":618,"line":772},[2184,2189,2194,2198],{"type":15,"tag":616,"props":2185,"children":2186},{"style":645},[2187],{"type":21,"value":2188},"    reviewThreshold:    ",{"type":15,"tag":616,"props":2190,"children":2191},{"style":1204},[2192],{"type":21,"value":2193},"0.75",{"type":15,"tag":616,"props":2195,"children":2196},{"style":645},[2197],{"type":21,"value":2175},{"type":15,"tag":616,"props":2199,"children":2200},{"style":623},[2201],{"type":21,"value":2202},"// ≥ this but \u003C auto → flag for review\n",{"type":15,"tag":616,"props":2204,"children":2205},{"class":618,"line":791},[2206,2211,2216],{"type":15,"tag":616,"props":2207,"children":2208},{"style":645},[2209],{"type":21,"value":2210},"    escalateAmbiguous:  ",{"type":15,"tag":616,"props":2212,"children":2213},{"style":1204},[2214],{"type":21,"value":2215},"true",{"type":15,"tag":616,"props":2217,"children":2218},{"style":623},[2219],{"type":21,"value":2220},"   // route hard calls to the resolution model\n",{"type":15,"tag":616,"props":2222,"children":2223},{"class":618,"line":805},[2224],{"type":15,"tag":616,"props":2225,"children":2226},{"style":645},[2227],{"type":21,"value":1544},{"type":15,"tag":616,"props":2229,"children":2230},{"class":618,"line":814},[2231],{"type":15,"tag":616,"props":2232,"children":2233},{"emptyLinePlaceholder":689},[2234],{"type":21,"value":692},{"type":15,"tag":616,"props":2236,"children":2237},{"class":618,"line":822},[2238,2242,2246,2250,2254,2258,2262],{"type":15,"tag":616,"props":2239,"children":2240},{"style":645},[2241],{"type":21,"value":2022},{"type":15,"tag":616,"props":2243,"children":2244},{"style":639},[2245],{"type":21,"value":677},{"type":15,"tag":616,"props":2247,"children":2248},{"style":645},[2249],{"type":21,"value":1881},{"type":15,"tag":616,"props":2251,"children":2252},{"style":639},[2253],{"type":21,"value":841},{"type":15,"tag":616,"props":2255,"children":2256},{"style":645},[2257],{"type":21,"value":760},{"type":15,"tag":616,"props":2259,"children":2260},{"style":733},[2261],{"type":21,"value":736},{"type":15,"tag":616,"props":2263,"children":2264},{"style":645},[2265],{"type":21,"value":769},{"type":15,"tag":616,"props":2267,"children":2268},{"class":618,"line":831},[2269,2273,2278],{"type":15,"tag":616,"props":2270,"children":2271},{"style":645},[2272],{"type":21,"value":2054},{"type":15,"tag":616,"props":2274,"children":2275},{"style":733},[2276],{"type":21,"value":2277},"\"person\"",{"type":15,"tag":616,"props":2279,"children":2280},{"style":645},[2281],{"type":21,"value":788},{"type":15,"tag":616,"props":2283,"children":2284},{"class":618,"line":856},[2285,2289,2294,2298,2303],{"type":15,"tag":616,"props":2286,"children":2287},{"style":645},[2288],{"type":21,"value":2070},{"type":15,"tag":616,"props":2290,"children":2291},{"style":733},[2292],{"type":21,"value":2293},"\"title\"",{"type":15,"tag":616,"props":2295,"children":2296},{"style":645},[2297],{"type":21,"value":76},{"type":15,"tag":616,"props":2299,"children":2300},{"style":733},[2301],{"type":21,"value":2302},"\"email\"",{"type":15,"tag":616,"props":2304,"children":2305},{"style":645},[2306],{"type":21,"value":908},{"type":15,"tag":616,"props":2308,"children":2309},{"class":618,"line":874},[2310,2314,2319],{"type":15,"tag":616,"props":2311,"children":2312},{"style":645},[2313],{"type":21,"value":2111},{"type":15,"tag":616,"props":2315,"children":2316},{"style":733},[2317],{"type":21,"value":2318},"\"A consultant or client contact named in the document.\"",{"type":15,"tag":616,"props":2320,"children":2321},{"style":645},[2322],{"type":21,"value":788},{"type":15,"tag":616,"props":2324,"children":2325},{"class":618,"line":911},[2326,2330,2334,2339],{"type":15,"tag":616,"props":2327,"children":2328},{"style":645},[2329],{"type":21,"value":2141},{"type":15,"tag":616,"props":2331,"children":2332},{"style":733},[2333],{"type":21,"value":2302},{"type":15,"tag":616,"props":2335,"children":2336},{"style":645},[2337],{"type":21,"value":2338},"],     ",{"type":15,"tag":616,"props":2340,"children":2341},{"style":623},[2342],{"type":21,"value":2343},"// people without a hard id stay conservative\n",{"type":15,"tag":616,"props":2345,"children":2346},{"class":618,"line":929},[2347,2352,2357],{"type":15,"tag":616,"props":2348,"children":2349},{"style":645},[2350],{"type":21,"value":2351},"    reviewThreshold: ",{"type":15,"tag":616,"props":2353,"children":2354},{"style":1204},[2355],{"type":21,"value":2356},"0.80",{"type":15,"tag":616,"props":2358,"children":2359},{"style":645},[2360],{"type":21,"value":788},{"type":15,"tag":616,"props":2362,"children":2363},{"class":618,"line":948},[2364,2369],{"type":15,"tag":616,"props":2365,"children":2366},{"style":645},[2367],{"type":21,"value":2368},"    escalateAmbiguous: ",{"type":15,"tag":616,"props":2370,"children":2371},{"style":1204},[2372],{"type":21,"value":2373},"true\n",{"type":15,"tag":616,"props":2375,"children":2376},{"class":618,"line":956},[2377],{"type":15,"tag":616,"props":2378,"children":2379},{"style":645},[2380],{"type":21,"value":1544},{"type":15,"tag":24,"props":2382,"children":2383},{},[2384,2386,2392,2394,2400,2402,2407],{"type":21,"value":2385},"The service stamps ",{"type":15,"tag":143,"props":2387,"children":2389},{"className":2388},[],[2390],{"type":21,"value":2391},"version = 1",{"type":21,"value":2393}," and an ",{"type":15,"tag":143,"props":2395,"children":2397},{"className":2396},[],[2398],{"type":21,"value":2399},"addedAt",{"type":21,"value":2401}," on each type;\nduplicate type names are rejected. The thresholds encode the\n\"",{"type":15,"tag":48,"props":2403,"children":2404},{},[2405],{"type":21,"value":2406},"prefer a duplicate over a false merge",{"type":21,"value":2408},"\" principle: a false\nmerge (\"two different people collapsed into one\") gives silently\nwrong answers and is hard to detect; a duplicate is visible and\nfixable. Be conservative, especially for people.",{"type":15,"tag":24,"props":2410,"children":2411},{},[2412],{"type":21,"value":2413},"Read them back any time:",{"type":15,"tag":477,"props":2415,"children":2417},{"code":2416,"language":609,"meta":7,"className":610,"style":7},"context.getKnowledge().listEntityTypes(\"clients\").forEach(function (t) {\n    context.log(t.type + \" v\" + t.version + \" — dedup on \" + t.dedupKeys.join(\",\"));\n});\n",[2418],{"type":15,"tag":143,"props":2419,"children":2420},{"__ignoreMap":7},[2421,2477,2548],{"type":15,"tag":616,"props":2422,"children":2423},{"class":618,"line":619},[2424,2428,2432,2436,2440,2444,2448,2452,2456,2460,2464,2468,2473],{"type":15,"tag":616,"props":2425,"children":2426},{"style":645},[2427],{"type":21,"value":2022},{"type":15,"tag":616,"props":2429,"children":2430},{"style":639},[2431],{"type":21,"value":677},{"type":15,"tag":616,"props":2433,"children":2434},{"style":645},[2435],{"type":21,"value":1881},{"type":15,"tag":616,"props":2437,"children":2438},{"style":639},[2439],{"type":21,"value":1381},{"type":15,"tag":616,"props":2441,"children":2442},{"style":645},[2443],{"type":21,"value":760},{"type":15,"tag":616,"props":2445,"children":2446},{"style":733},[2447],{"type":21,"value":736},{"type":15,"tag":616,"props":2449,"children":2450},{"style":645},[2451],{"type":21,"value":459},{"type":15,"tag":616,"props":2453,"children":2454},{"style":639},[2455],{"type":21,"value":1230},{"type":15,"tag":616,"props":2457,"children":2458},{"style":645},[2459],{"type":21,"value":760},{"type":15,"tag":616,"props":2461,"children":2462},{"style":633},[2463],{"type":21,"value":636},{"type":15,"tag":616,"props":2465,"children":2466},{"style":645},[2467],{"type":21,"value":715},{"type":15,"tag":616,"props":2469,"children":2470},{"style":1245},[2471],{"type":21,"value":2472},"t",{"type":15,"tag":616,"props":2474,"children":2475},{"style":645},[2476],{"type":21,"value":1253},{"type":15,"tag":616,"props":2478,"children":2479},{"class":618,"line":629},[2480,2484,2488,2493,2497,2502,2506,2511,2515,2520,2524,2529,2534,2538,2543],{"type":15,"tag":616,"props":2481,"children":2482},{"style":645},[2483],{"type":21,"value":1036},{"type":15,"tag":616,"props":2485,"children":2486},{"style":639},[2487],{"type":21,"value":1041},{"type":15,"tag":616,"props":2489,"children":2490},{"style":645},[2491],{"type":21,"value":2492},"(t.type ",{"type":15,"tag":616,"props":2494,"children":2495},{"style":633},[2496],{"type":21,"value":1065},{"type":15,"tag":616,"props":2498,"children":2499},{"style":733},[2500],{"type":21,"value":2501}," \" v\"",{"type":15,"tag":616,"props":2503,"children":2504},{"style":633},[2505],{"type":21,"value":1055},{"type":15,"tag":616,"props":2507,"children":2508},{"style":645},[2509],{"type":21,"value":2510}," t.version ",{"type":15,"tag":616,"props":2512,"children":2513},{"style":633},[2514],{"type":21,"value":1065},{"type":15,"tag":616,"props":2516,"children":2517},{"style":733},[2518],{"type":21,"value":2519}," \" — dedup on \"",{"type":15,"tag":616,"props":2521,"children":2522},{"style":633},[2523],{"type":21,"value":1055},{"type":15,"tag":616,"props":2525,"children":2526},{"style":645},[2527],{"type":21,"value":2528}," t.dedupKeys.",{"type":15,"tag":616,"props":2530,"children":2531},{"style":639},[2532],{"type":21,"value":2533},"join",{"type":15,"tag":616,"props":2535,"children":2536},{"style":645},[2537],{"type":21,"value":760},{"type":15,"tag":616,"props":2539,"children":2540},{"style":733},[2541],{"type":21,"value":2542},"\",\"",{"type":15,"tag":616,"props":2544,"children":2545},{"style":645},[2546],{"type":21,"value":2547},"));\n",{"type":15,"tag":616,"props":2549,"children":2550},{"class":618,"line":651},[2551],{"type":15,"tag":616,"props":2552,"children":2553},{"style":645},[2554],{"type":21,"value":1544},{"type":15,"tag":1570,"props":2556,"children":2558},{"id":2557},"add-relationship-types",[2559],{"type":21,"value":2560},"Add Relationship Types",{"type":15,"tag":24,"props":2562,"children":2563},{},[2564,2566,2572],{"type":21,"value":2565},"Declare the small, typed edge vocabulary. Each type is\nconstrained to a ",{"type":15,"tag":143,"props":2567,"children":2569},{"className":2568},[],[2570],{"type":21,"value":2571},"fromType → toType",{"type":21,"value":2573},", which both guides\nextraction and validates traversal queries:",{"type":15,"tag":477,"props":2575,"children":2577},{"code":2576,"language":609,"meta":7,"className":610,"style":7},"var k = context.getKnowledge();\nk.addRelationshipType(\"clients\", {\n    relType: \"worked_on\", fromType: \"person\",  toType: \"project\",\n    extractionHint: \"The person staffed on or delivering the project.\"\n});\nk.addRelationshipType(\"clients\", {\n    relType: \"client_of\", fromType: \"project\", toType: \"company\",\n    extractionHint: \"The client company a project was delivered for.\"\n});\nk.addRelationshipType(\"clients\", {\n    relType: \"has_skill\", fromType: \"person\",  toType: \"skill\"\n});\n",[2578],{"type":15,"tag":143,"props":2579,"children":2580},{"__ignoreMap":7},[2581,2608,2633,2669,2681,2688,2711,2744,2756,2763,2786,2815],{"type":15,"tag":616,"props":2582,"children":2583},{"class":618,"line":619},[2584,2588,2592,2596,2600,2604],{"type":15,"tag":616,"props":2585,"children":2586},{"style":633},[2587],{"type":21,"value":1464},{"type":15,"tag":616,"props":2589,"children":2590},{"style":645},[2591],{"type":21,"value":662},{"type":15,"tag":616,"props":2593,"children":2594},{"style":633},[2595],{"type":21,"value":667},{"type":15,"tag":616,"props":2597,"children":2598},{"style":645},[2599],{"type":21,"value":672},{"type":15,"tag":616,"props":2601,"children":2602},{"style":639},[2603],{"type":21,"value":677},{"type":15,"tag":616,"props":2605,"children":2606},{"style":645},[2607],{"type":21,"value":682},{"type":15,"tag":616,"props":2609,"children":2610},{"class":618,"line":629},[2611,2616,2621,2625,2629],{"type":15,"tag":616,"props":2612,"children":2613},{"style":645},[2614],{"type":21,"value":2615},"k.",{"type":15,"tag":616,"props":2617,"children":2618},{"style":639},[2619],{"type":21,"value":2620},"addRelationshipType",{"type":15,"tag":616,"props":2622,"children":2623},{"style":645},[2624],{"type":21,"value":760},{"type":15,"tag":616,"props":2626,"children":2627},{"style":733},[2628],{"type":21,"value":736},{"type":15,"tag":616,"props":2630,"children":2631},{"style":645},[2632],{"type":21,"value":769},{"type":15,"tag":616,"props":2634,"children":2635},{"class":618,"line":651},[2636,2641,2646,2651,2655,2660,2665],{"type":15,"tag":616,"props":2637,"children":2638},{"style":645},[2639],{"type":21,"value":2640},"    relType: ",{"type":15,"tag":616,"props":2642,"children":2643},{"style":733},[2644],{"type":21,"value":2645},"\"worked_on\"",{"type":15,"tag":616,"props":2647,"children":2648},{"style":645},[2649],{"type":21,"value":2650},", fromType: ",{"type":15,"tag":616,"props":2652,"children":2653},{"style":733},[2654],{"type":21,"value":2277},{"type":15,"tag":616,"props":2656,"children":2657},{"style":645},[2658],{"type":21,"value":2659},",  toType: ",{"type":15,"tag":616,"props":2661,"children":2662},{"style":733},[2663],{"type":21,"value":2664},"\"project\"",{"type":15,"tag":616,"props":2666,"children":2667},{"style":645},[2668],{"type":21,"value":788},{"type":15,"tag":616,"props":2670,"children":2671},{"class":618,"line":685},[2672,2676],{"type":15,"tag":616,"props":2673,"children":2674},{"style":645},[2675],{"type":21,"value":2111},{"type":15,"tag":616,"props":2677,"children":2678},{"style":733},[2679],{"type":21,"value":2680},"\"The person staffed on or delivering the project.\"\n",{"type":15,"tag":616,"props":2682,"children":2683},{"class":618,"line":695},[2684],{"type":15,"tag":616,"props":2685,"children":2686},{"style":645},[2687],{"type":21,"value":1544},{"type":15,"tag":616,"props":2689,"children":2690},{"class":618,"line":704},[2691,2695,2699,2703,2707],{"type":15,"tag":616,"props":2692,"children":2693},{"style":645},[2694],{"type":21,"value":2615},{"type":15,"tag":616,"props":2696,"children":2697},{"style":639},[2698],{"type":21,"value":2620},{"type":15,"tag":616,"props":2700,"children":2701},{"style":645},[2702],{"type":21,"value":760},{"type":15,"tag":616,"props":2704,"children":2705},{"style":733},[2706],{"type":21,"value":736},{"type":15,"tag":616,"props":2708,"children":2709},{"style":645},[2710],{"type":21,"value":769},{"type":15,"tag":616,"props":2712,"children":2713},{"class":618,"line":744},[2714,2718,2723,2727,2731,2736,2740],{"type":15,"tag":616,"props":2715,"children":2716},{"style":645},[2717],{"type":21,"value":2640},{"type":15,"tag":616,"props":2719,"children":2720},{"style":733},[2721],{"type":21,"value":2722},"\"client_of\"",{"type":15,"tag":616,"props":2724,"children":2725},{"style":645},[2726],{"type":21,"value":2650},{"type":15,"tag":616,"props":2728,"children":2729},{"style":733},[2730],{"type":21,"value":2664},{"type":15,"tag":616,"props":2732,"children":2733},{"style":645},[2734],{"type":21,"value":2735},", toType: ",{"type":15,"tag":616,"props":2737,"children":2738},{"style":733},[2739],{"type":21,"value":867},{"type":15,"tag":616,"props":2741,"children":2742},{"style":645},[2743],{"type":21,"value":788},{"type":15,"tag":616,"props":2745,"children":2746},{"class":618,"line":772},[2747,2751],{"type":15,"tag":616,"props":2748,"children":2749},{"style":645},[2750],{"type":21,"value":2111},{"type":15,"tag":616,"props":2752,"children":2753},{"style":733},[2754],{"type":21,"value":2755},"\"The client company a project was delivered for.\"\n",{"type":15,"tag":616,"props":2757,"children":2758},{"class":618,"line":791},[2759],{"type":15,"tag":616,"props":2760,"children":2761},{"style":645},[2762],{"type":21,"value":1544},{"type":15,"tag":616,"props":2764,"children":2765},{"class":618,"line":805},[2766,2770,2774,2778,2782],{"type":15,"tag":616,"props":2767,"children":2768},{"style":645},[2769],{"type":21,"value":2615},{"type":15,"tag":616,"props":2771,"children":2772},{"style":639},[2773],{"type":21,"value":2620},{"type":15,"tag":616,"props":2775,"children":2776},{"style":645},[2777],{"type":21,"value":760},{"type":15,"tag":616,"props":2779,"children":2780},{"style":733},[2781],{"type":21,"value":736},{"type":15,"tag":616,"props":2783,"children":2784},{"style":645},[2785],{"type":21,"value":769},{"type":15,"tag":616,"props":2787,"children":2788},{"class":618,"line":814},[2789,2793,2798,2802,2806,2810],{"type":15,"tag":616,"props":2790,"children":2791},{"style":645},[2792],{"type":21,"value":2640},{"type":15,"tag":616,"props":2794,"children":2795},{"style":733},[2796],{"type":21,"value":2797},"\"has_skill\"",{"type":15,"tag":616,"props":2799,"children":2800},{"style":645},[2801],{"type":21,"value":2650},{"type":15,"tag":616,"props":2803,"children":2804},{"style":733},[2805],{"type":21,"value":2277},{"type":15,"tag":616,"props":2807,"children":2808},{"style":645},[2809],{"type":21,"value":2659},{"type":15,"tag":616,"props":2811,"children":2812},{"style":733},[2813],{"type":21,"value":2814},"\"skill\"\n",{"type":15,"tag":616,"props":2816,"children":2817},{"class":618,"line":822},[2818],{"type":15,"tag":616,"props":2819,"children":2820},{"style":645},[2821],{"type":21,"value":1544},{"type":15,"tag":24,"props":2823,"children":2824},{},[2825,2827,2833],{"type":21,"value":2826},"The combined extraction pass then emits these edges\nautomatically from documents (tabular-first). List them with\n",{"type":15,"tag":143,"props":2828,"children":2830},{"className":2829},[],[2831],{"type":21,"value":2832},"k.listRelationshipTypes(\"clients\")",{"type":21,"value":605},{"type":15,"tag":2835,"props":2836,"children":2837},"blockquote",{},[2838],{"type":15,"tag":24,"props":2839,"children":2840},{},[2841],{"type":21,"value":2842},"Keep the vocabulary small. A handful of well-defined types\nyields cleaner queries and less extraction noise than\nopen-ended \"relate freely.\" Add a type when a concrete query\nneed appears.",{"type":15,"tag":1570,"props":2844,"children":2846},{"id":2845},"add-a-controlled-vocabulary-taxonomy",[2847],{"type":21,"value":2848},"Add A Controlled Vocabulary (Taxonomy)",{"type":15,"tag":24,"props":2850,"children":2851},{},[2852],{"type":21,"value":2853},"The \"IT is too broad\" problem: a user asks for \"people with IT\nskills\", but the data says \"Java\", \"Kubernetes\", \"React\". Declare\na taxonomy so broad terms resolve to their underlying values\ninstead of being guessed:",{"type":15,"tag":477,"props":2855,"children":2857},{"code":2856,"language":609,"meta":7,"className":610,"style":7},"var k = context.getKnowledge();\nk.addTaxonomyTerm(\"clients\", {\n    term: \"Financial Technology\",\n    aliases: [\"fintech\", \"fin-tech\", \"fin tech\"],\n    entityType: \"industry\"\n});\nk.addTaxonomyTerm(\"clients\", {\n    term: \"Java\",\n    categoryPath: \"IT/Backend\",\n    aliases: [\"java se\", \"jdk\"],\n    entityType: \"skill\"\n});\n",[2858],{"type":15,"tag":143,"props":2859,"children":2860},{"__ignoreMap":7},[2861,2888,2912,2929,2964,2976,2983,3006,3022,3039,3064,3075],{"type":15,"tag":616,"props":2862,"children":2863},{"class":618,"line":619},[2864,2868,2872,2876,2880,2884],{"type":15,"tag":616,"props":2865,"children":2866},{"style":633},[2867],{"type":21,"value":1464},{"type":15,"tag":616,"props":2869,"children":2870},{"style":645},[2871],{"type":21,"value":662},{"type":15,"tag":616,"props":2873,"children":2874},{"style":633},[2875],{"type":21,"value":667},{"type":15,"tag":616,"props":2877,"children":2878},{"style":645},[2879],{"type":21,"value":672},{"type":15,"tag":616,"props":2881,"children":2882},{"style":639},[2883],{"type":21,"value":677},{"type":15,"tag":616,"props":2885,"children":2886},{"style":645},[2887],{"type":21,"value":682},{"type":15,"tag":616,"props":2889,"children":2890},{"class":618,"line":629},[2891,2895,2900,2904,2908],{"type":15,"tag":616,"props":2892,"children":2893},{"style":645},[2894],{"type":21,"value":2615},{"type":15,"tag":616,"props":2896,"children":2897},{"style":639},[2898],{"type":21,"value":2899},"addTaxonomyTerm",{"type":15,"tag":616,"props":2901,"children":2902},{"style":645},[2903],{"type":21,"value":760},{"type":15,"tag":616,"props":2905,"children":2906},{"style":733},[2907],{"type":21,"value":736},{"type":15,"tag":616,"props":2909,"children":2910},{"style":645},[2911],{"type":21,"value":769},{"type":15,"tag":616,"props":2913,"children":2914},{"class":618,"line":651},[2915,2920,2925],{"type":15,"tag":616,"props":2916,"children":2917},{"style":645},[2918],{"type":21,"value":2919},"    term: ",{"type":15,"tag":616,"props":2921,"children":2922},{"style":733},[2923],{"type":21,"value":2924},"\"Financial Technology\"",{"type":15,"tag":616,"props":2926,"children":2927},{"style":645},[2928],{"type":21,"value":788},{"type":15,"tag":616,"props":2930,"children":2931},{"class":618,"line":685},[2932,2937,2942,2946,2951,2955,2960],{"type":15,"tag":616,"props":2933,"children":2934},{"style":645},[2935],{"type":21,"value":2936},"    aliases: [",{"type":15,"tag":616,"props":2938,"children":2939},{"style":733},[2940],{"type":21,"value":2941},"\"fintech\"",{"type":15,"tag":616,"props":2943,"children":2944},{"style":645},[2945],{"type":21,"value":76},{"type":15,"tag":616,"props":2947,"children":2948},{"style":733},[2949],{"type":21,"value":2950},"\"fin-tech\"",{"type":15,"tag":616,"props":2952,"children":2953},{"style":645},[2954],{"type":21,"value":76},{"type":15,"tag":616,"props":2956,"children":2957},{"style":733},[2958],{"type":21,"value":2959},"\"fin tech\"",{"type":15,"tag":616,"props":2961,"children":2962},{"style":645},[2963],{"type":21,"value":908},{"type":15,"tag":616,"props":2965,"children":2966},{"class":618,"line":695},[2967,2971],{"type":15,"tag":616,"props":2968,"children":2969},{"style":645},[2970],{"type":21,"value":1501},{"type":15,"tag":616,"props":2972,"children":2973},{"style":733},[2974],{"type":21,"value":2975},"\"industry\"\n",{"type":15,"tag":616,"props":2977,"children":2978},{"class":618,"line":704},[2979],{"type":15,"tag":616,"props":2980,"children":2981},{"style":645},[2982],{"type":21,"value":1544},{"type":15,"tag":616,"props":2984,"children":2985},{"class":618,"line":744},[2986,2990,2994,2998,3002],{"type":15,"tag":616,"props":2987,"children":2988},{"style":645},[2989],{"type":21,"value":2615},{"type":15,"tag":616,"props":2991,"children":2992},{"style":639},[2993],{"type":21,"value":2899},{"type":15,"tag":616,"props":2995,"children":2996},{"style":645},[2997],{"type":21,"value":760},{"type":15,"tag":616,"props":2999,"children":3000},{"style":733},[3001],{"type":21,"value":736},{"type":15,"tag":616,"props":3003,"children":3004},{"style":645},[3005],{"type":21,"value":769},{"type":15,"tag":616,"props":3007,"children":3008},{"class":618,"line":772},[3009,3013,3018],{"type":15,"tag":616,"props":3010,"children":3011},{"style":645},[3012],{"type":21,"value":2919},{"type":15,"tag":616,"props":3014,"children":3015},{"style":733},[3016],{"type":21,"value":3017},"\"Java\"",{"type":15,"tag":616,"props":3019,"children":3020},{"style":645},[3021],{"type":21,"value":788},{"type":15,"tag":616,"props":3023,"children":3024},{"class":618,"line":791},[3025,3030,3035],{"type":15,"tag":616,"props":3026,"children":3027},{"style":645},[3028],{"type":21,"value":3029},"    categoryPath: ",{"type":15,"tag":616,"props":3031,"children":3032},{"style":733},[3033],{"type":21,"value":3034},"\"IT/Backend\"",{"type":15,"tag":616,"props":3036,"children":3037},{"style":645},[3038],{"type":21,"value":788},{"type":15,"tag":616,"props":3040,"children":3041},{"class":618,"line":805},[3042,3046,3051,3055,3060],{"type":15,"tag":616,"props":3043,"children":3044},{"style":645},[3045],{"type":21,"value":2936},{"type":15,"tag":616,"props":3047,"children":3048},{"style":733},[3049],{"type":21,"value":3050},"\"java se\"",{"type":15,"tag":616,"props":3052,"children":3053},{"style":645},[3054],{"type":21,"value":76},{"type":15,"tag":616,"props":3056,"children":3057},{"style":733},[3058],{"type":21,"value":3059},"\"jdk\"",{"type":15,"tag":616,"props":3061,"children":3062},{"style":645},[3063],{"type":21,"value":908},{"type":15,"tag":616,"props":3065,"children":3066},{"class":618,"line":814},[3067,3071],{"type":15,"tag":616,"props":3068,"children":3069},{"style":645},[3070],{"type":21,"value":1501},{"type":15,"tag":616,"props":3072,"children":3073},{"style":733},[3074],{"type":21,"value":2814},{"type":15,"tag":616,"props":3076,"children":3077},{"class":618,"line":822},[3078],{"type":15,"tag":616,"props":3079,"children":3080},{"style":645},[3081],{"type":21,"value":1544},{"type":15,"tag":24,"props":3083,"children":3084},{},[3085],{"type":21,"value":3086},"At extraction time, variant surface forms normalize to the\ncanonical term; at query time the agent can resolve a category\n(\"IT/Backend\") to its members. This is what stops \"fintech\" and\n\"Financial Technology\" from being counted as two industries.",{"type":15,"tag":131,"props":3088,"children":3090},{"id":3089},"ingestion-preview-backfill-reprocess-jobs",[3091],{"type":21,"value":3092},"Ingestion: Preview, Backfill, Reprocess, Jobs",{"type":15,"tag":24,"props":3094,"children":3095},{},[3096,3098,3103],{"type":21,"value":3097},"Extraction runs as a ",{"type":15,"tag":48,"props":3099,"children":3100},{},[3101],{"type":21,"value":3102},"background job per document",{"type":21,"value":3104},", driven off\nthe platform message bus and executed by an extraction worker.\nYour code enqueues; the worker extracts, resolves, and writes.\nYou never block an Action on an LLM extraction call.",{"type":15,"tag":1570,"props":3106,"children":3108},{"id":3107},"preview-before-you-commit-preview",[3109,3111,3117],{"type":21,"value":3110},"Preview Before You Commit (",{"type":15,"tag":143,"props":3112,"children":3114},{"className":3113},[],[3115],{"type":21,"value":3116},"preview",{"type":21,"value":3118},")",{"type":15,"tag":24,"props":3120,"children":3121},{},[3122,3127,3129,3134,3136,3141,3143,3149,3151,3157],{"type":15,"tag":143,"props":3123,"children":3125},{"className":3124},[],[3126],{"type":21,"value":3116},{"type":21,"value":3128}," is a ",{"type":15,"tag":48,"props":3130,"children":3131},{},[3132],{"type":21,"value":3133},"dry run",{"type":21,"value":3135},": it shows you what ",{"type":15,"tag":30,"props":3137,"children":3138},{},[3139],{"type":21,"value":3140},"would",{"type":21,"value":3142}," be\nextracted and resolved from one document — nothing written, no\njob row created. Use it to tune an ",{"type":15,"tag":143,"props":3144,"children":3146},{"className":3145},[],[3147],{"type":21,"value":3148},"extractionHint",{"type":21,"value":3150}," or a\n",{"type":15,"tag":143,"props":3152,"children":3154},{"className":3153},[],[3155],{"type":21,"value":3156},"dedupKeys",{"type":21,"value":3158}," list before a full backfill:",{"type":15,"tag":477,"props":3160,"children":3162},{"code":3161,"language":609,"meta":7,"className":610,"style":7},"var p = context.getKnowledge().preview(\"clients\", \"doc_6631a2\");\n\np.entities.forEach(function (e) {\n    // action is CREATE (new), MERGE (folds into an existing entity),\n    // or REVIEW (ambiguous — flagged, not auto-merged)\n    context.log(e.entityType + \"  \" + e.canonicalName +\n                \"  → \" + e.action +\n                (e.targetEntityId ? \" into \" + e.targetEntityId : \"\") +\n                \"  (conf \" + e.confidence + \")\");\n});\n\np.relationships.forEach(function (r) {\n    context.log(r.fromName + \" —\" + r.relType + \"→ \" + r.toName +\n                \"  (conf \" + r.confidence + \")\");\n});\n",[3163],{"type":15,"tag":143,"props":3164,"children":3165},{"__ignoreMap":7},[3166,3219,3226,3259,3267,3275,3314,3335,3380,3409,3416,3423,3456,3512,3540],{"type":15,"tag":616,"props":3167,"children":3168},{"class":618,"line":619},[3169,3173,3178,3182,3186,3190,3194,3198,3202,3206,3210,3215],{"type":15,"tag":616,"props":3170,"children":3171},{"style":633},[3172],{"type":21,"value":1464},{"type":15,"tag":616,"props":3174,"children":3175},{"style":645},[3176],{"type":21,"value":3177}," p ",{"type":15,"tag":616,"props":3179,"children":3180},{"style":633},[3181],{"type":21,"value":667},{"type":15,"tag":616,"props":3183,"children":3184},{"style":645},[3185],{"type":21,"value":672},{"type":15,"tag":616,"props":3187,"children":3188},{"style":639},[3189],{"type":21,"value":677},{"type":15,"tag":616,"props":3191,"children":3192},{"style":645},[3193],{"type":21,"value":1881},{"type":15,"tag":616,"props":3195,"children":3196},{"style":639},[3197],{"type":21,"value":3116},{"type":15,"tag":616,"props":3199,"children":3200},{"style":645},[3201],{"type":21,"value":760},{"type":15,"tag":616,"props":3203,"children":3204},{"style":733},[3205],{"type":21,"value":736},{"type":15,"tag":616,"props":3207,"children":3208},{"style":645},[3209],{"type":21,"value":76},{"type":15,"tag":616,"props":3211,"children":3212},{"style":733},[3213],{"type":21,"value":3214},"\"doc_6631a2\"",{"type":15,"tag":616,"props":3216,"children":3217},{"style":645},[3218],{"type":21,"value":1027},{"type":15,"tag":616,"props":3220,"children":3221},{"class":618,"line":629},[3222],{"type":15,"tag":616,"props":3223,"children":3224},{"emptyLinePlaceholder":689},[3225],{"type":21,"value":692},{"type":15,"tag":616,"props":3227,"children":3228},{"class":618,"line":651},[3229,3234,3238,3242,3246,3250,3255],{"type":15,"tag":616,"props":3230,"children":3231},{"style":645},[3232],{"type":21,"value":3233},"p.entities.",{"type":15,"tag":616,"props":3235,"children":3236},{"style":639},[3237],{"type":21,"value":1230},{"type":15,"tag":616,"props":3239,"children":3240},{"style":645},[3241],{"type":21,"value":760},{"type":15,"tag":616,"props":3243,"children":3244},{"style":633},[3245],{"type":21,"value":636},{"type":15,"tag":616,"props":3247,"children":3248},{"style":645},[3249],{"type":21,"value":715},{"type":15,"tag":616,"props":3251,"children":3252},{"style":1245},[3253],{"type":21,"value":3254},"e",{"type":15,"tag":616,"props":3256,"children":3257},{"style":645},[3258],{"type":21,"value":1253},{"type":15,"tag":616,"props":3260,"children":3261},{"class":618,"line":685},[3262],{"type":15,"tag":616,"props":3263,"children":3264},{"style":623},[3265],{"type":21,"value":3266},"    // action is CREATE (new), MERGE (folds into an existing entity),\n",{"type":15,"tag":616,"props":3268,"children":3269},{"class":618,"line":695},[3270],{"type":15,"tag":616,"props":3271,"children":3272},{"style":623},[3273],{"type":21,"value":3274},"    // or REVIEW (ambiguous — flagged, not auto-merged)\n",{"type":15,"tag":616,"props":3276,"children":3277},{"class":618,"line":704},[3278,3282,3286,3291,3295,3300,3304,3309],{"type":15,"tag":616,"props":3279,"children":3280},{"style":645},[3281],{"type":21,"value":1036},{"type":15,"tag":616,"props":3283,"children":3284},{"style":639},[3285],{"type":21,"value":1041},{"type":15,"tag":616,"props":3287,"children":3288},{"style":645},[3289],{"type":21,"value":3290},"(e.entityType ",{"type":15,"tag":616,"props":3292,"children":3293},{"style":633},[3294],{"type":21,"value":1065},{"type":15,"tag":616,"props":3296,"children":3297},{"style":733},[3298],{"type":21,"value":3299}," \"  \"",{"type":15,"tag":616,"props":3301,"children":3302},{"style":633},[3303],{"type":21,"value":1055},{"type":15,"tag":616,"props":3305,"children":3306},{"style":645},[3307],{"type":21,"value":3308}," e.canonicalName ",{"type":15,"tag":616,"props":3310,"children":3311},{"style":633},[3312],{"type":21,"value":3313},"+\n",{"type":15,"tag":616,"props":3315,"children":3316},{"class":618,"line":744},[3317,3322,3326,3331],{"type":15,"tag":616,"props":3318,"children":3319},{"style":733},[3320],{"type":21,"value":3321},"                \"  → \"",{"type":15,"tag":616,"props":3323,"children":3324},{"style":633},[3325],{"type":21,"value":1055},{"type":15,"tag":616,"props":3327,"children":3328},{"style":645},[3329],{"type":21,"value":3330}," e.action ",{"type":15,"tag":616,"props":3332,"children":3333},{"style":633},[3334],{"type":21,"value":3313},{"type":15,"tag":616,"props":3336,"children":3337},{"class":618,"line":772},[3338,3343,3348,3353,3357,3362,3366,3371,3376],{"type":15,"tag":616,"props":3339,"children":3340},{"style":645},[3341],{"type":21,"value":3342},"                (e.targetEntityId ",{"type":15,"tag":616,"props":3344,"children":3345},{"style":633},[3346],{"type":21,"value":3347},"?",{"type":15,"tag":616,"props":3349,"children":3350},{"style":733},[3351],{"type":21,"value":3352}," \" into \"",{"type":15,"tag":616,"props":3354,"children":3355},{"style":633},[3356],{"type":21,"value":1055},{"type":15,"tag":616,"props":3358,"children":3359},{"style":645},[3360],{"type":21,"value":3361}," e.targetEntityId ",{"type":15,"tag":616,"props":3363,"children":3364},{"style":633},[3365],{"type":21,"value":2007},{"type":15,"tag":616,"props":3367,"children":3368},{"style":733},[3369],{"type":21,"value":3370}," \"\"",{"type":15,"tag":616,"props":3372,"children":3373},{"style":645},[3374],{"type":21,"value":3375},") ",{"type":15,"tag":616,"props":3377,"children":3378},{"style":633},[3379],{"type":21,"value":3313},{"type":15,"tag":616,"props":3381,"children":3382},{"class":618,"line":791},[3383,3388,3392,3397,3401,3405],{"type":15,"tag":616,"props":3384,"children":3385},{"style":733},[3386],{"type":21,"value":3387},"                \"  (conf \"",{"type":15,"tag":616,"props":3389,"children":3390},{"style":633},[3391],{"type":21,"value":1055},{"type":15,"tag":616,"props":3393,"children":3394},{"style":645},[3395],{"type":21,"value":3396}," e.confidence ",{"type":15,"tag":616,"props":3398,"children":3399},{"style":633},[3400],{"type":21,"value":1065},{"type":15,"tag":616,"props":3402,"children":3403},{"style":733},[3404],{"type":21,"value":1298},{"type":15,"tag":616,"props":3406,"children":3407},{"style":645},[3408],{"type":21,"value":1027},{"type":15,"tag":616,"props":3410,"children":3411},{"class":618,"line":805},[3412],{"type":15,"tag":616,"props":3413,"children":3414},{"style":645},[3415],{"type":21,"value":1544},{"type":15,"tag":616,"props":3417,"children":3418},{"class":618,"line":814},[3419],{"type":15,"tag":616,"props":3420,"children":3421},{"emptyLinePlaceholder":689},[3422],{"type":21,"value":692},{"type":15,"tag":616,"props":3424,"children":3425},{"class":618,"line":822},[3426,3431,3435,3439,3443,3447,3452],{"type":15,"tag":616,"props":3427,"children":3428},{"style":645},[3429],{"type":21,"value":3430},"p.relationships.",{"type":15,"tag":616,"props":3432,"children":3433},{"style":639},[3434],{"type":21,"value":1230},{"type":15,"tag":616,"props":3436,"children":3437},{"style":645},[3438],{"type":21,"value":760},{"type":15,"tag":616,"props":3440,"children":3441},{"style":633},[3442],{"type":21,"value":636},{"type":15,"tag":616,"props":3444,"children":3445},{"style":645},[3446],{"type":21,"value":715},{"type":15,"tag":616,"props":3448,"children":3449},{"style":1245},[3450],{"type":21,"value":3451},"r",{"type":15,"tag":616,"props":3453,"children":3454},{"style":645},[3455],{"type":21,"value":1253},{"type":15,"tag":616,"props":3457,"children":3458},{"class":618,"line":831},[3459,3463,3467,3472,3476,3481,3485,3490,3494,3499,3503,3508],{"type":15,"tag":616,"props":3460,"children":3461},{"style":645},[3462],{"type":21,"value":1036},{"type":15,"tag":616,"props":3464,"children":3465},{"style":639},[3466],{"type":21,"value":1041},{"type":15,"tag":616,"props":3468,"children":3469},{"style":645},[3470],{"type":21,"value":3471},"(r.fromName ",{"type":15,"tag":616,"props":3473,"children":3474},{"style":633},[3475],{"type":21,"value":1065},{"type":15,"tag":616,"props":3477,"children":3478},{"style":733},[3479],{"type":21,"value":3480}," \" —\"",{"type":15,"tag":616,"props":3482,"children":3483},{"style":633},[3484],{"type":21,"value":1055},{"type":15,"tag":616,"props":3486,"children":3487},{"style":645},[3488],{"type":21,"value":3489}," r.relType ",{"type":15,"tag":616,"props":3491,"children":3492},{"style":633},[3493],{"type":21,"value":1065},{"type":15,"tag":616,"props":3495,"children":3496},{"style":733},[3497],{"type":21,"value":3498}," \"→ \"",{"type":15,"tag":616,"props":3500,"children":3501},{"style":633},[3502],{"type":21,"value":1055},{"type":15,"tag":616,"props":3504,"children":3505},{"style":645},[3506],{"type":21,"value":3507}," r.toName ",{"type":15,"tag":616,"props":3509,"children":3510},{"style":633},[3511],{"type":21,"value":3313},{"type":15,"tag":616,"props":3513,"children":3514},{"class":618,"line":856},[3515,3519,3523,3528,3532,3536],{"type":15,"tag":616,"props":3516,"children":3517},{"style":733},[3518],{"type":21,"value":3387},{"type":15,"tag":616,"props":3520,"children":3521},{"style":633},[3522],{"type":21,"value":1055},{"type":15,"tag":616,"props":3524,"children":3525},{"style":645},[3526],{"type":21,"value":3527}," r.confidence ",{"type":15,"tag":616,"props":3529,"children":3530},{"style":633},[3531],{"type":21,"value":1065},{"type":15,"tag":616,"props":3533,"children":3534},{"style":733},[3535],{"type":21,"value":1298},{"type":15,"tag":616,"props":3537,"children":3538},{"style":645},[3539],{"type":21,"value":1027},{"type":15,"tag":616,"props":3541,"children":3542},{"class":618,"line":874},[3543],{"type":15,"tag":616,"props":3544,"children":3545},{"style":645},[3546],{"type":21,"value":1544},{"type":15,"tag":24,"props":3548,"children":3549},{},[3550,3552,3558,3560,3565,3567,3573],{"type":21,"value":3551},"If you see two obviously-different companies coming back as one\n",{"type":15,"tag":143,"props":3553,"children":3555},{"className":3554},[],[3556],{"type":21,"value":3557},"MERGE",{"type":21,"value":3559},", tighten ",{"type":15,"tag":143,"props":3561,"children":3563},{"className":3562},[],[3564],{"type":21,"value":3156},{"type":21,"value":3566}," or raise ",{"type":15,"tag":143,"props":3568,"children":3570},{"className":3569},[],[3571],{"type":21,"value":3572},"autoMergeThreshold",{"type":21,"value":3574}," and\npreview again. This is your tuning loop.",{"type":15,"tag":1570,"props":3576,"children":3578},{"id":3577},"backfill-the-corpus-backfill",[3579,3581,3586],{"type":21,"value":3580},"Backfill The Corpus (",{"type":15,"tag":143,"props":3582,"children":3584},{"className":3583},[],[3585],{"type":21,"value":596},{"type":21,"value":3118},{"type":15,"tag":24,"props":3588,"children":3589},{},[3590,3595,3597,3602,3604,3609],{"type":15,"tag":143,"props":3591,"children":3593},{"className":3592},[],[3594],{"type":21,"value":596},{"type":21,"value":3596}," walks every Document-model record in the app and\nenqueues each one for extraction into the dataset. It is\n",{"type":15,"tag":48,"props":3598,"children":3599},{},[3600],{"type":21,"value":3601},"idempotent",{"type":21,"value":3603}," (a re-enqueue replaces the queued job and re-runs\nthe document) and ",{"type":15,"tag":48,"props":3605,"children":3606},{},[3607],{"type":21,"value":3608},"bounded per call",{"type":21,"value":3610}," (it processes a slice;\ncall it again to continue a large corpus):",{"type":15,"tag":477,"props":3612,"children":3614},{"code":3613,"language":609,"meta":7,"className":610,"style":7},"var r = context.getKnowledge().backfill(\"clients\");\ncontext.log(\"Enqueued \" + r.enqueued + \" documents this pass\");\n",[3615],{"type":15,"tag":143,"props":3616,"children":3617},{"__ignoreMap":7},[3618,3662],{"type":15,"tag":616,"props":3619,"children":3620},{"class":618,"line":619},[3621,3625,3630,3634,3638,3642,3646,3650,3654,3658],{"type":15,"tag":616,"props":3622,"children":3623},{"style":633},[3624],{"type":21,"value":1464},{"type":15,"tag":616,"props":3626,"children":3627},{"style":645},[3628],{"type":21,"value":3629}," r ",{"type":15,"tag":616,"props":3631,"children":3632},{"style":633},[3633],{"type":21,"value":667},{"type":15,"tag":616,"props":3635,"children":3636},{"style":645},[3637],{"type":21,"value":672},{"type":15,"tag":616,"props":3639,"children":3640},{"style":639},[3641],{"type":21,"value":677},{"type":15,"tag":616,"props":3643,"children":3644},{"style":645},[3645],{"type":21,"value":1881},{"type":15,"tag":616,"props":3647,"children":3648},{"style":639},[3649],{"type":21,"value":596},{"type":15,"tag":616,"props":3651,"children":3652},{"style":645},[3653],{"type":21,"value":760},{"type":15,"tag":616,"props":3655,"children":3656},{"style":733},[3657],{"type":21,"value":736},{"type":15,"tag":616,"props":3659,"children":3660},{"style":645},[3661],{"type":21,"value":1027},{"type":15,"tag":616,"props":3663,"children":3664},{"class":618,"line":629},[3665,3669,3673,3677,3681,3685,3690,3694,3699],{"type":15,"tag":616,"props":3666,"children":3667},{"style":645},[3668],{"type":21,"value":2022},{"type":15,"tag":616,"props":3670,"children":3671},{"style":639},[3672],{"type":21,"value":1041},{"type":15,"tag":616,"props":3674,"children":3675},{"style":645},[3676],{"type":21,"value":760},{"type":15,"tag":616,"props":3678,"children":3679},{"style":733},[3680],{"type":21,"value":1050},{"type":15,"tag":616,"props":3682,"children":3683},{"style":633},[3684],{"type":21,"value":1055},{"type":15,"tag":616,"props":3686,"children":3687},{"style":645},[3688],{"type":21,"value":3689}," r.enqueued ",{"type":15,"tag":616,"props":3691,"children":3692},{"style":633},[3693],{"type":21,"value":1065},{"type":15,"tag":616,"props":3695,"children":3696},{"style":733},[3697],{"type":21,"value":3698}," \" documents this pass\"",{"type":15,"tag":616,"props":3700,"children":3701},{"style":645},[3702],{"type":21,"value":1027},{"type":15,"tag":1570,"props":3704,"children":3706},{"id":3705},"reprocess-after-a-config-change-reprocess",[3707,3709,3715],{"type":21,"value":3708},"Reprocess After A Config Change (",{"type":15,"tag":143,"props":3710,"children":3712},{"className":3711},[],[3713],{"type":21,"value":3714},"reprocess",{"type":21,"value":3118},{"type":15,"tag":24,"props":3717,"children":3718},{},[3719,3721,3726,3728,3733],{"type":21,"value":3720},"When you add or change an entity type ",{"type":15,"tag":30,"props":3722,"children":3723},{},[3724],{"type":21,"value":3725},"after",{"type":21,"value":3727}," documents are\nalready extracted, you don't want to re-run the whole corpus —\nonly the documents that the new/bumped type still needs.\n",{"type":15,"tag":143,"props":3729,"children":3731},{"className":3730},[],[3732],{"type":21,"value":3714},{"type":21,"value":3734}," re-enqueues exactly those: documents whose completed\njob lacks the type or predates its current version.",{"type":15,"tag":477,"props":3736,"children":3738},{"code":3737,"language":609,"meta":7,"className":610,"style":7},"// You just added a \"skill\" type. Catch up only what's stale:\nvar r = context.getKnowledge().reprocess(\"clients\", \"skill\");\ncontext.log(\"Reprocessing \" + r.enqueued + \" documents for 'skill'\");\n",[3739],{"type":15,"tag":143,"props":3740,"children":3741},{"__ignoreMap":7},[3742,3750,3802],{"type":15,"tag":616,"props":3743,"children":3744},{"class":618,"line":619},[3745],{"type":15,"tag":616,"props":3746,"children":3747},{"style":623},[3748],{"type":21,"value":3749},"// You just added a \"skill\" type. Catch up only what's stale:\n",{"type":15,"tag":616,"props":3751,"children":3752},{"class":618,"line":629},[3753,3757,3761,3765,3769,3773,3777,3781,3785,3789,3793,3798],{"type":15,"tag":616,"props":3754,"children":3755},{"style":633},[3756],{"type":21,"value":1464},{"type":15,"tag":616,"props":3758,"children":3759},{"style":645},[3760],{"type":21,"value":3629},{"type":15,"tag":616,"props":3762,"children":3763},{"style":633},[3764],{"type":21,"value":667},{"type":15,"tag":616,"props":3766,"children":3767},{"style":645},[3768],{"type":21,"value":672},{"type":15,"tag":616,"props":3770,"children":3771},{"style":639},[3772],{"type":21,"value":677},{"type":15,"tag":616,"props":3774,"children":3775},{"style":645},[3776],{"type":21,"value":1881},{"type":15,"tag":616,"props":3778,"children":3779},{"style":639},[3780],{"type":21,"value":3714},{"type":15,"tag":616,"props":3782,"children":3783},{"style":645},[3784],{"type":21,"value":760},{"type":15,"tag":616,"props":3786,"children":3787},{"style":733},[3788],{"type":21,"value":736},{"type":15,"tag":616,"props":3790,"children":3791},{"style":645},[3792],{"type":21,"value":76},{"type":15,"tag":616,"props":3794,"children":3795},{"style":733},[3796],{"type":21,"value":3797},"\"skill\"",{"type":15,"tag":616,"props":3799,"children":3800},{"style":645},[3801],{"type":21,"value":1027},{"type":15,"tag":616,"props":3803,"children":3804},{"class":618,"line":651},[3805,3809,3813,3817,3822,3826,3830,3834,3839],{"type":15,"tag":616,"props":3806,"children":3807},{"style":645},[3808],{"type":21,"value":2022},{"type":15,"tag":616,"props":3810,"children":3811},{"style":639},[3812],{"type":21,"value":1041},{"type":15,"tag":616,"props":3814,"children":3815},{"style":645},[3816],{"type":21,"value":760},{"type":15,"tag":616,"props":3818,"children":3819},{"style":733},[3820],{"type":21,"value":3821},"\"Reprocessing \"",{"type":15,"tag":616,"props":3823,"children":3824},{"style":633},[3825],{"type":21,"value":1055},{"type":15,"tag":616,"props":3827,"children":3828},{"style":645},[3829],{"type":21,"value":3689},{"type":15,"tag":616,"props":3831,"children":3832},{"style":633},[3833],{"type":21,"value":1065},{"type":15,"tag":616,"props":3835,"children":3836},{"style":733},[3837],{"type":21,"value":3838}," \" documents for 'skill'\"",{"type":15,"tag":616,"props":3840,"children":3841},{"style":645},[3842],{"type":21,"value":1027},{"type":15,"tag":1570,"props":3844,"children":3846},{"id":3845},"watch-the-jobs-jobsummary-listjobs-jobstatus",[3847,3849,3855,3856,3862,3863,3869],{"type":21,"value":3848},"Watch The Jobs (",{"type":15,"tag":143,"props":3850,"children":3852},{"className":3851},[],[3853],{"type":21,"value":3854},"jobSummary",{"type":21,"value":76},{"type":15,"tag":143,"props":3857,"children":3859},{"className":3858},[],[3860],{"type":21,"value":3861},"listJobs",{"type":21,"value":76},{"type":15,"tag":143,"props":3864,"children":3866},{"className":3865},[],[3867],{"type":21,"value":3868},"jobStatus",{"type":21,"value":3118},{"type":15,"tag":24,"props":3871,"children":3872},{},[3873,3875,3881,3882,3888,3889,3895,3896,3902],{"type":21,"value":3874},"Extraction is asynchronous, so you watch it through the job API.\nStatuses are ",{"type":15,"tag":143,"props":3876,"children":3878},{"className":3877},[],[3879],{"type":21,"value":3880},"QUEUED",{"type":21,"value":76},{"type":15,"tag":143,"props":3883,"children":3885},{"className":3884},[],[3886],{"type":21,"value":3887},"RUNNING",{"type":21,"value":76},{"type":15,"tag":143,"props":3890,"children":3892},{"className":3891},[],[3893],{"type":21,"value":3894},"DONE",{"type":21,"value":76},{"type":15,"tag":143,"props":3897,"children":3899},{"className":3898},[],[3900],{"type":21,"value":3901},"FAILED",{"type":21,"value":605},{"type":15,"tag":477,"props":3904,"children":3906},{"code":3905,"language":609,"meta":7,"className":610,"style":7},"var k = context.getKnowledge();\n\n// Dashboard counts\nvar s = k.jobSummary(\"clients\");\ncontext.log(s.DONE + \" done, \" + s.QUEUED + \" queued, \" +\n            s.RUNNING + \" running, \" + s.FAILED + \" failed\");\n\n// Drill into failures (newest first; limit caps at 200)\nk.listJobs(\"clients\", \"FAILED\", 20).forEach(function (j) {\n    context.log(j.documentRecordId + \" (attempt \" + j.attempts + \"): \" + j.error);\n});\n\n// One document's status\nvar job = k.jobStatus(\"clients\", \"doc_6631a2\");\nif (job) context.log(\"status=\" + job.status + \" types=\" + job.extractedTypes);\n",[3907],{"type":15,"tag":143,"props":3908,"children":3909},{"__ignoreMap":7},[3910,3937,3944,3952,3988,4043,4089,4096,4104,4170,4222,4229,4236,4244,4288],{"type":15,"tag":616,"props":3911,"children":3912},{"class":618,"line":619},[3913,3917,3921,3925,3929,3933],{"type":15,"tag":616,"props":3914,"children":3915},{"style":633},[3916],{"type":21,"value":1464},{"type":15,"tag":616,"props":3918,"children":3919},{"style":645},[3920],{"type":21,"value":662},{"type":15,"tag":616,"props":3922,"children":3923},{"style":633},[3924],{"type":21,"value":667},{"type":15,"tag":616,"props":3926,"children":3927},{"style":645},[3928],{"type":21,"value":672},{"type":15,"tag":616,"props":3930,"children":3931},{"style":639},[3932],{"type":21,"value":677},{"type":15,"tag":616,"props":3934,"children":3935},{"style":645},[3936],{"type":21,"value":682},{"type":15,"tag":616,"props":3938,"children":3939},{"class":618,"line":629},[3940],{"type":15,"tag":616,"props":3941,"children":3942},{"emptyLinePlaceholder":689},[3943],{"type":21,"value":692},{"type":15,"tag":616,"props":3945,"children":3946},{"class":618,"line":651},[3947],{"type":15,"tag":616,"props":3948,"children":3949},{"style":623},[3950],{"type":21,"value":3951},"// Dashboard counts\n",{"type":15,"tag":616,"props":3953,"children":3954},{"class":618,"line":685},[3955,3959,3964,3968,3972,3976,3980,3984],{"type":15,"tag":616,"props":3956,"children":3957},{"style":633},[3958],{"type":21,"value":1464},{"type":15,"tag":616,"props":3960,"children":3961},{"style":645},[3962],{"type":21,"value":3963}," s ",{"type":15,"tag":616,"props":3965,"children":3966},{"style":633},[3967],{"type":21,"value":667},{"type":15,"tag":616,"props":3969,"children":3970},{"style":645},[3971],{"type":21,"value":1010},{"type":15,"tag":616,"props":3973,"children":3974},{"style":639},[3975],{"type":21,"value":3854},{"type":15,"tag":616,"props":3977,"children":3978},{"style":645},[3979],{"type":21,"value":760},{"type":15,"tag":616,"props":3981,"children":3982},{"style":733},[3983],{"type":21,"value":736},{"type":15,"tag":616,"props":3985,"children":3986},{"style":645},[3987],{"type":21,"value":1027},{"type":15,"tag":616,"props":3989,"children":3990},{"class":618,"line":695},[3991,3995,3999,4004,4008,4012,4017,4021,4026,4030,4034,4039],{"type":15,"tag":616,"props":3992,"children":3993},{"style":645},[3994],{"type":21,"value":2022},{"type":15,"tag":616,"props":3996,"children":3997},{"style":639},[3998],{"type":21,"value":1041},{"type":15,"tag":616,"props":4000,"children":4001},{"style":645},[4002],{"type":21,"value":4003},"(s.",{"type":15,"tag":616,"props":4005,"children":4006},{"style":1204},[4007],{"type":21,"value":3894},{"type":15,"tag":616,"props":4009,"children":4010},{"style":633},[4011],{"type":21,"value":1055},{"type":15,"tag":616,"props":4013,"children":4014},{"style":733},[4015],{"type":21,"value":4016}," \" done, \"",{"type":15,"tag":616,"props":4018,"children":4019},{"style":633},[4020],{"type":21,"value":1055},{"type":15,"tag":616,"props":4022,"children":4023},{"style":645},[4024],{"type":21,"value":4025}," s.",{"type":15,"tag":616,"props":4027,"children":4028},{"style":1204},[4029],{"type":21,"value":3880},{"type":15,"tag":616,"props":4031,"children":4032},{"style":633},[4033],{"type":21,"value":1055},{"type":15,"tag":616,"props":4035,"children":4036},{"style":733},[4037],{"type":21,"value":4038}," \" queued, \"",{"type":15,"tag":616,"props":4040,"children":4041},{"style":633},[4042],{"type":21,"value":2121},{"type":15,"tag":616,"props":4044,"children":4045},{"class":618,"line":704},[4046,4051,4055,4059,4064,4068,4072,4076,4080,4085],{"type":15,"tag":616,"props":4047,"children":4048},{"style":645},[4049],{"type":21,"value":4050},"            s.",{"type":15,"tag":616,"props":4052,"children":4053},{"style":1204},[4054],{"type":21,"value":3887},{"type":15,"tag":616,"props":4056,"children":4057},{"style":633},[4058],{"type":21,"value":1055},{"type":15,"tag":616,"props":4060,"children":4061},{"style":733},[4062],{"type":21,"value":4063}," \" running, \"",{"type":15,"tag":616,"props":4065,"children":4066},{"style":633},[4067],{"type":21,"value":1055},{"type":15,"tag":616,"props":4069,"children":4070},{"style":645},[4071],{"type":21,"value":4025},{"type":15,"tag":616,"props":4073,"children":4074},{"style":1204},[4075],{"type":21,"value":3901},{"type":15,"tag":616,"props":4077,"children":4078},{"style":633},[4079],{"type":21,"value":1055},{"type":15,"tag":616,"props":4081,"children":4082},{"style":733},[4083],{"type":21,"value":4084}," \" failed\"",{"type":15,"tag":616,"props":4086,"children":4087},{"style":645},[4088],{"type":21,"value":1027},{"type":15,"tag":616,"props":4090,"children":4091},{"class":618,"line":744},[4092],{"type":15,"tag":616,"props":4093,"children":4094},{"emptyLinePlaceholder":689},[4095],{"type":21,"value":692},{"type":15,"tag":616,"props":4097,"children":4098},{"class":618,"line":772},[4099],{"type":15,"tag":616,"props":4100,"children":4101},{"style":623},[4102],{"type":21,"value":4103},"// Drill into failures (newest first; limit caps at 200)\n",{"type":15,"tag":616,"props":4105,"children":4106},{"class":618,"line":791},[4107,4111,4115,4119,4123,4127,4132,4136,4141,4145,4149,4153,4157,4161,4166],{"type":15,"tag":616,"props":4108,"children":4109},{"style":645},[4110],{"type":21,"value":2615},{"type":15,"tag":616,"props":4112,"children":4113},{"style":639},[4114],{"type":21,"value":3861},{"type":15,"tag":616,"props":4116,"children":4117},{"style":645},[4118],{"type":21,"value":760},{"type":15,"tag":616,"props":4120,"children":4121},{"style":733},[4122],{"type":21,"value":736},{"type":15,"tag":616,"props":4124,"children":4125},{"style":645},[4126],{"type":21,"value":76},{"type":15,"tag":616,"props":4128,"children":4129},{"style":733},[4130],{"type":21,"value":4131},"\"FAILED\"",{"type":15,"tag":616,"props":4133,"children":4134},{"style":645},[4135],{"type":21,"value":76},{"type":15,"tag":616,"props":4137,"children":4138},{"style":1204},[4139],{"type":21,"value":4140},"20",{"type":15,"tag":616,"props":4142,"children":4143},{"style":645},[4144],{"type":21,"value":459},{"type":15,"tag":616,"props":4146,"children":4147},{"style":639},[4148],{"type":21,"value":1230},{"type":15,"tag":616,"props":4150,"children":4151},{"style":645},[4152],{"type":21,"value":760},{"type":15,"tag":616,"props":4154,"children":4155},{"style":633},[4156],{"type":21,"value":636},{"type":15,"tag":616,"props":4158,"children":4159},{"style":645},[4160],{"type":21,"value":715},{"type":15,"tag":616,"props":4162,"children":4163},{"style":1245},[4164],{"type":21,"value":4165},"j",{"type":15,"tag":616,"props":4167,"children":4168},{"style":645},[4169],{"type":21,"value":1253},{"type":15,"tag":616,"props":4171,"children":4172},{"class":618,"line":805},[4173,4177,4181,4186,4190,4195,4199,4204,4208,4213,4217],{"type":15,"tag":616,"props":4174,"children":4175},{"style":645},[4176],{"type":21,"value":1036},{"type":15,"tag":616,"props":4178,"children":4179},{"style":639},[4180],{"type":21,"value":1041},{"type":15,"tag":616,"props":4182,"children":4183},{"style":645},[4184],{"type":21,"value":4185},"(j.documentRecordId ",{"type":15,"tag":616,"props":4187,"children":4188},{"style":633},[4189],{"type":21,"value":1065},{"type":15,"tag":616,"props":4191,"children":4192},{"style":733},[4193],{"type":21,"value":4194}," \" (attempt \"",{"type":15,"tag":616,"props":4196,"children":4197},{"style":633},[4198],{"type":21,"value":1055},{"type":15,"tag":616,"props":4200,"children":4201},{"style":645},[4202],{"type":21,"value":4203}," j.attempts ",{"type":15,"tag":616,"props":4205,"children":4206},{"style":633},[4207],{"type":21,"value":1065},{"type":15,"tag":616,"props":4209,"children":4210},{"style":733},[4211],{"type":21,"value":4212}," \"): \"",{"type":15,"tag":616,"props":4214,"children":4215},{"style":633},[4216],{"type":21,"value":1055},{"type":15,"tag":616,"props":4218,"children":4219},{"style":645},[4220],{"type":21,"value":4221}," j.error);\n",{"type":15,"tag":616,"props":4223,"children":4224},{"class":618,"line":814},[4225],{"type":15,"tag":616,"props":4226,"children":4227},{"style":645},[4228],{"type":21,"value":1544},{"type":15,"tag":616,"props":4230,"children":4231},{"class":618,"line":822},[4232],{"type":15,"tag":616,"props":4233,"children":4234},{"emptyLinePlaceholder":689},[4235],{"type":21,"value":692},{"type":15,"tag":616,"props":4237,"children":4238},{"class":618,"line":831},[4239],{"type":15,"tag":616,"props":4240,"children":4241},{"style":623},[4242],{"type":21,"value":4243},"// One document's status\n",{"type":15,"tag":616,"props":4245,"children":4246},{"class":618,"line":856},[4247,4251,4256,4260,4264,4268,4272,4276,4280,4284],{"type":15,"tag":616,"props":4248,"children":4249},{"style":633},[4250],{"type":21,"value":1464},{"type":15,"tag":616,"props":4252,"children":4253},{"style":645},[4254],{"type":21,"value":4255}," job ",{"type":15,"tag":616,"props":4257,"children":4258},{"style":633},[4259],{"type":21,"value":667},{"type":15,"tag":616,"props":4261,"children":4262},{"style":645},[4263],{"type":21,"value":1010},{"type":15,"tag":616,"props":4265,"children":4266},{"style":639},[4267],{"type":21,"value":3868},{"type":15,"tag":616,"props":4269,"children":4270},{"style":645},[4271],{"type":21,"value":760},{"type":15,"tag":616,"props":4273,"children":4274},{"style":733},[4275],{"type":21,"value":736},{"type":15,"tag":616,"props":4277,"children":4278},{"style":645},[4279],{"type":21,"value":76},{"type":15,"tag":616,"props":4281,"children":4282},{"style":733},[4283],{"type":21,"value":3214},{"type":15,"tag":616,"props":4285,"children":4286},{"style":645},[4287],{"type":21,"value":1027},{"type":15,"tag":616,"props":4289,"children":4290},{"class":618,"line":874},[4291,4296,4301,4305,4309,4314,4318,4323,4327,4332,4336],{"type":15,"tag":616,"props":4292,"children":4293},{"style":633},[4294],{"type":21,"value":4295},"if",{"type":15,"tag":616,"props":4297,"children":4298},{"style":645},[4299],{"type":21,"value":4300}," (job) context.",{"type":15,"tag":616,"props":4302,"children":4303},{"style":639},[4304],{"type":21,"value":1041},{"type":15,"tag":616,"props":4306,"children":4307},{"style":645},[4308],{"type":21,"value":760},{"type":15,"tag":616,"props":4310,"children":4311},{"style":733},[4312],{"type":21,"value":4313},"\"status=\"",{"type":15,"tag":616,"props":4315,"children":4316},{"style":633},[4317],{"type":21,"value":1055},{"type":15,"tag":616,"props":4319,"children":4320},{"style":645},[4321],{"type":21,"value":4322}," job.status ",{"type":15,"tag":616,"props":4324,"children":4325},{"style":633},[4326],{"type":21,"value":1065},{"type":15,"tag":616,"props":4328,"children":4329},{"style":733},[4330],{"type":21,"value":4331}," \" types=\"",{"type":15,"tag":616,"props":4333,"children":4334},{"style":633},[4335],{"type":21,"value":1055},{"type":15,"tag":616,"props":4337,"children":4338},{"style":645},[4339],{"type":21,"value":4340}," job.extractedTypes);\n",{"type":15,"tag":24,"props":4342,"children":4343},{},[4344,4346,4352,4353,4359,4361,4367,4369,4374],{"type":21,"value":4345},"Failed jobs are retried with backoff by the platform; the\n",{"type":15,"tag":143,"props":4347,"children":4349},{"className":4348},[],[4350],{"type":21,"value":4351},"attempts",{"type":21,"value":429},{"type":15,"tag":143,"props":4354,"children":4356},{"className":4355},[],[4357],{"type":21,"value":4358},"error",{"type":21,"value":4360}," fields tell you what's happening. A\nhealthy ingestion trends ",{"type":15,"tag":143,"props":4362,"children":4364},{"className":4363},[],[4365],{"type":21,"value":4366},"QUEUED → DONE",{"type":21,"value":4368}," with ",{"type":15,"tag":143,"props":4370,"children":4372},{"className":4371},[],[4373],{"type":21,"value":3901},{"type":21,"value":4375}," near zero.",{"type":15,"tag":131,"props":4377,"children":4379},{"id":4378},"querying-the-knowledge-store",[4380],{"type":21,"value":4381},"Querying The Knowledge Store",{"type":15,"tag":24,"props":4383,"children":4384},{},[4385],{"type":21,"value":4386},"This is where the value is realised. You issue a structured query\nthrough a small, validated DSL — never raw Mongo. The structure is\nthe point: because the agent or app can only ever produce a\nwell-formed query of this shape, the access-control stages can\nnever be bypassed, and injection is impossible.",{"type":15,"tag":477,"props":4388,"children":4390},{"code":4389,"language":609,"meta":7,"className":610,"style":7},"var rows = context.getKnowledge().query(\"clients\", {\n    entityType: \"company\",                    // required\n    where:      [ /* attribute predicates */ ],\n    traverse:   [ /* 1–2 relationship hops */ ],\n    aggregate:  { /* optional terminal reduction */ },\n    limit:      50,                           // default 50\n    offset:     0\n});\n",[4391],{"type":15,"tag":143,"props":4392,"children":4393},{"__ignoreMap":7},[4394,4438,4459,4477,4494,4512,4535,4548],{"type":15,"tag":616,"props":4395,"children":4396},{"class":618,"line":619},[4397,4401,4406,4410,4414,4418,4422,4426,4430,4434],{"type":15,"tag":616,"props":4398,"children":4399},{"style":633},[4400],{"type":21,"value":1464},{"type":15,"tag":616,"props":4402,"children":4403},{"style":645},[4404],{"type":21,"value":4405}," rows ",{"type":15,"tag":616,"props":4407,"children":4408},{"style":633},[4409],{"type":21,"value":667},{"type":15,"tag":616,"props":4411,"children":4412},{"style":645},[4413],{"type":21,"value":672},{"type":15,"tag":616,"props":4415,"children":4416},{"style":639},[4417],{"type":21,"value":677},{"type":15,"tag":616,"props":4419,"children":4420},{"style":645},[4421],{"type":21,"value":1881},{"type":15,"tag":616,"props":4423,"children":4424},{"style":639},[4425],{"type":21,"value":603},{"type":15,"tag":616,"props":4427,"children":4428},{"style":645},[4429],{"type":21,"value":760},{"type":15,"tag":616,"props":4431,"children":4432},{"style":733},[4433],{"type":21,"value":736},{"type":15,"tag":616,"props":4435,"children":4436},{"style":645},[4437],{"type":21,"value":769},{"type":15,"tag":616,"props":4439,"children":4440},{"class":618,"line":629},[4441,4445,4449,4454],{"type":15,"tag":616,"props":4442,"children":4443},{"style":645},[4444],{"type":21,"value":1501},{"type":15,"tag":616,"props":4446,"children":4447},{"style":733},[4448],{"type":21,"value":867},{"type":15,"tag":616,"props":4450,"children":4451},{"style":645},[4452],{"type":21,"value":4453},",                    ",{"type":15,"tag":616,"props":4455,"children":4456},{"style":623},[4457],{"type":21,"value":4458},"// required\n",{"type":15,"tag":616,"props":4460,"children":4461},{"class":618,"line":651},[4462,4467,4472],{"type":15,"tag":616,"props":4463,"children":4464},{"style":645},[4465],{"type":21,"value":4466},"    where:      [ ",{"type":15,"tag":616,"props":4468,"children":4469},{"style":623},[4470],{"type":21,"value":4471},"/* attribute predicates */",{"type":15,"tag":616,"props":4473,"children":4474},{"style":645},[4475],{"type":21,"value":4476}," ],\n",{"type":15,"tag":616,"props":4478,"children":4479},{"class":618,"line":685},[4480,4485,4490],{"type":15,"tag":616,"props":4481,"children":4482},{"style":645},[4483],{"type":21,"value":4484},"    traverse:   [ ",{"type":15,"tag":616,"props":4486,"children":4487},{"style":623},[4488],{"type":21,"value":4489},"/* 1–2 relationship hops */",{"type":15,"tag":616,"props":4491,"children":4492},{"style":645},[4493],{"type":21,"value":4476},{"type":15,"tag":616,"props":4495,"children":4496},{"class":618,"line":695},[4497,4502,4507],{"type":15,"tag":616,"props":4498,"children":4499},{"style":645},[4500],{"type":21,"value":4501},"    aggregate:  { ",{"type":15,"tag":616,"props":4503,"children":4504},{"style":623},[4505],{"type":21,"value":4506},"/* optional terminal reduction */",{"type":15,"tag":616,"props":4508,"children":4509},{"style":645},[4510],{"type":21,"value":4511}," },\n",{"type":15,"tag":616,"props":4513,"children":4514},{"class":618,"line":704},[4515,4520,4525,4530],{"type":15,"tag":616,"props":4516,"children":4517},{"style":645},[4518],{"type":21,"value":4519},"    limit:      ",{"type":15,"tag":616,"props":4521,"children":4522},{"style":1204},[4523],{"type":21,"value":4524},"50",{"type":15,"tag":616,"props":4526,"children":4527},{"style":645},[4528],{"type":21,"value":4529},",                           ",{"type":15,"tag":616,"props":4531,"children":4532},{"style":623},[4533],{"type":21,"value":4534},"// default 50\n",{"type":15,"tag":616,"props":4536,"children":4537},{"class":618,"line":744},[4538,4543],{"type":15,"tag":616,"props":4539,"children":4540},{"style":645},[4541],{"type":21,"value":4542},"    offset:     ",{"type":15,"tag":616,"props":4544,"children":4545},{"style":1204},[4546],{"type":21,"value":4547},"0\n",{"type":15,"tag":616,"props":4549,"children":4550},{"class":618,"line":772},[4551],{"type":15,"tag":616,"props":4552,"children":4553},{"style":645},[4554],{"type":21,"value":1544},{"type":15,"tag":24,"props":4556,"children":4557},{},[4558,4560,4566],{"type":21,"value":4559},"Any top-level field outside ",{"type":15,"tag":143,"props":4561,"children":4563},{"className":4562},[],[4564],{"type":21,"value":4565},"{entityType, where, traverse, aggregate, limit, offset}",{"type":21,"value":4567}," is rejected.",{"type":15,"tag":1570,"props":4569,"children":4571},{"id":4570},"where-attribute-predicates",[4572,4578],{"type":15,"tag":143,"props":4573,"children":4575},{"className":4574},[],[4576],{"type":21,"value":4577},"where",{"type":21,"value":4579},": Attribute Predicates",{"type":15,"tag":24,"props":4581,"children":4582},{},[4583,4584,4589,4591,4597],{"type":21,"value":489},{"type":15,"tag":143,"props":4585,"children":4587},{"className":4586},[],[4588],{"type":21,"value":4577},{"type":21,"value":4590}," is a list of ",{"type":15,"tag":143,"props":4592,"children":4594},{"className":4593},[],[4595],{"type":21,"value":4596},"{ attr, op, value | min/max }",{"type":21,"value":4598}," clauses,\nAND-ed together. The operator is one of a whitelisted set —\nnothing else is expressible:",{"type":15,"tag":152,"props":4600,"children":4601},{},[4602,4627],{"type":15,"tag":156,"props":4603,"children":4604},{},[4605],{"type":15,"tag":160,"props":4606,"children":4607},{},[4608,4617,4622],{"type":15,"tag":164,"props":4609,"children":4610},{},[4611],{"type":15,"tag":143,"props":4612,"children":4614},{"className":4613},[],[4615],{"type":21,"value":4616},"op",{"type":15,"tag":164,"props":4618,"children":4619},{},[4620],{"type":21,"value":4621},"Shape",{"type":15,"tag":164,"props":4623,"children":4624},{},[4625],{"type":21,"value":4626},"Meaning",{"type":15,"tag":180,"props":4628,"children":4629},{},[4630,4656,4682,4708,4734],{"type":15,"tag":160,"props":4631,"children":4632},{},[4633,4642,4651],{"type":15,"tag":187,"props":4634,"children":4635},{},[4636],{"type":15,"tag":143,"props":4637,"children":4639},{"className":4638},[],[4640],{"type":21,"value":4641},"eq",{"type":15,"tag":187,"props":4643,"children":4644},{},[4645],{"type":15,"tag":143,"props":4646,"children":4648},{"className":4647},[],[4649],{"type":21,"value":4650},"{ attr, op:\"eq\", value }",{"type":15,"tag":187,"props":4652,"children":4653},{},[4654],{"type":21,"value":4655},"attribute equals value",{"type":15,"tag":160,"props":4657,"children":4658},{},[4659,4668,4677],{"type":15,"tag":187,"props":4660,"children":4661},{},[4662],{"type":15,"tag":143,"props":4663,"children":4665},{"className":4664},[],[4666],{"type":21,"value":4667},"in",{"type":15,"tag":187,"props":4669,"children":4670},{},[4671],{"type":15,"tag":143,"props":4672,"children":4674},{"className":4673},[],[4675],{"type":21,"value":4676},"{ attr, op:\"in\", value:[…] }",{"type":15,"tag":187,"props":4678,"children":4679},{},[4680],{"type":21,"value":4681},"attribute is one of a set",{"type":15,"tag":160,"props":4683,"children":4684},{},[4685,4694,4703],{"type":15,"tag":187,"props":4686,"children":4687},{},[4688],{"type":15,"tag":143,"props":4689,"children":4691},{"className":4690},[],[4692],{"type":21,"value":4693},"contains",{"type":15,"tag":187,"props":4695,"children":4696},{},[4697],{"type":15,"tag":143,"props":4698,"children":4700},{"className":4699},[],[4701],{"type":21,"value":4702},"{ attr, op:\"contains\", value }",{"type":15,"tag":187,"props":4704,"children":4705},{},[4706],{"type":21,"value":4707},"attribute contains value (substring / member)",{"type":15,"tag":160,"props":4709,"children":4710},{},[4711,4720,4729],{"type":15,"tag":187,"props":4712,"children":4713},{},[4714],{"type":15,"tag":143,"props":4715,"children":4717},{"className":4716},[],[4718],{"type":21,"value":4719},"range",{"type":15,"tag":187,"props":4721,"children":4722},{},[4723],{"type":15,"tag":143,"props":4724,"children":4726},{"className":4725},[],[4727],{"type":21,"value":4728},"{ attr, op:\"range\", min, max }",{"type":15,"tag":187,"props":4730,"children":4731},{},[4732],{"type":21,"value":4733},"numeric/date range",{"type":15,"tag":160,"props":4735,"children":4736},{},[4737,4746,4755],{"type":15,"tag":187,"props":4738,"children":4739},{},[4740],{"type":15,"tag":143,"props":4741,"children":4743},{"className":4742},[],[4744],{"type":21,"value":4745},"exists",{"type":15,"tag":187,"props":4747,"children":4748},{},[4749],{"type":15,"tag":143,"props":4750,"children":4752},{"className":4751},[],[4753],{"type":21,"value":4754},"{ attr, op:\"exists\" }",{"type":15,"tag":187,"props":4756,"children":4757},{},[4758],{"type":21,"value":4759},"the attribute is present at all",{"type":15,"tag":477,"props":4761,"children":4763},{"code":4762,"language":609,"meta":7,"className":610,"style":7},"// Retail companies headquartered in Boston with a known headcount\ncontext.getKnowledge().query(\"clients\", {\n    entityType: \"company\",\n    where: [\n        { attr: \"industry\", op: \"eq\",     value: \"retail\" },\n        { attr: \"hq\",       op: \"eq\",     value: \"Boston\" },\n        { attr: \"headcount\",op: \"exists\" }\n    ]\n});\n\n// Companies in any of three industries, headcount 500–5000\ncontext.getKnowledge().query(\"clients\", {\n    entityType: \"company\",\n    where: [\n        { attr: \"industry\",  op: \"in\",    value: [\"retail\", \"fintech\", \"logistics\"] },\n        { attr: \"headcount\", op: \"range\", min: 500, max: 5000 }\n    ]\n});\n",[4764],{"type":15,"tag":143,"props":4765,"children":4766},{"__ignoreMap":7},[4767,4775,4806,4821,4829,4862,4895,4920,4928,4935,4942,4950,4981,4996,5003,5055,5099,5106],{"type":15,"tag":616,"props":4768,"children":4769},{"class":618,"line":619},[4770],{"type":15,"tag":616,"props":4771,"children":4772},{"style":623},[4773],{"type":21,"value":4774},"// Retail companies headquartered in Boston with a known headcount\n",{"type":15,"tag":616,"props":4776,"children":4777},{"class":618,"line":629},[4778,4782,4786,4790,4794,4798,4802],{"type":15,"tag":616,"props":4779,"children":4780},{"style":645},[4781],{"type":21,"value":2022},{"type":15,"tag":616,"props":4783,"children":4784},{"style":639},[4785],{"type":21,"value":677},{"type":15,"tag":616,"props":4787,"children":4788},{"style":645},[4789],{"type":21,"value":1881},{"type":15,"tag":616,"props":4791,"children":4792},{"style":639},[4793],{"type":21,"value":603},{"type":15,"tag":616,"props":4795,"children":4796},{"style":645},[4797],{"type":21,"value":760},{"type":15,"tag":616,"props":4799,"children":4800},{"style":733},[4801],{"type":21,"value":736},{"type":15,"tag":616,"props":4803,"children":4804},{"style":645},[4805],{"type":21,"value":769},{"type":15,"tag":616,"props":4807,"children":4808},{"class":618,"line":651},[4809,4813,4817],{"type":15,"tag":616,"props":4810,"children":4811},{"style":645},[4812],{"type":21,"value":1501},{"type":15,"tag":616,"props":4814,"children":4815},{"style":733},[4816],{"type":21,"value":867},{"type":15,"tag":616,"props":4818,"children":4819},{"style":645},[4820],{"type":21,"value":788},{"type":15,"tag":616,"props":4822,"children":4823},{"class":618,"line":685},[4824],{"type":15,"tag":616,"props":4825,"children":4826},{"style":645},[4827],{"type":21,"value":4828},"    where: [\n",{"type":15,"tag":616,"props":4830,"children":4831},{"class":618,"line":695},[4832,4837,4841,4845,4849,4854,4858],{"type":15,"tag":616,"props":4833,"children":4834},{"style":645},[4835],{"type":21,"value":4836},"        { attr: ",{"type":15,"tag":616,"props":4838,"children":4839},{"style":733},[4840],{"type":21,"value":885},{"type":15,"tag":616,"props":4842,"children":4843},{"style":645},[4844],{"type":21,"value":1172},{"type":15,"tag":616,"props":4846,"children":4847},{"style":733},[4848],{"type":21,"value":1177},{"type":15,"tag":616,"props":4850,"children":4851},{"style":645},[4852],{"type":21,"value":4853},",     value: ",{"type":15,"tag":616,"props":4855,"children":4856},{"style":733},[4857],{"type":21,"value":1187},{"type":15,"tag":616,"props":4859,"children":4860},{"style":645},[4861],{"type":21,"value":4511},{"type":15,"tag":616,"props":4863,"children":4864},{"class":618,"line":704},[4865,4869,4873,4878,4882,4886,4891],{"type":15,"tag":616,"props":4866,"children":4867},{"style":645},[4868],{"type":21,"value":4836},{"type":15,"tag":616,"props":4870,"children":4871},{"style":733},[4872],{"type":21,"value":894},{"type":15,"tag":616,"props":4874,"children":4875},{"style":645},[4876],{"type":21,"value":4877},",       op: ",{"type":15,"tag":616,"props":4879,"children":4880},{"style":733},[4881],{"type":21,"value":1177},{"type":15,"tag":616,"props":4883,"children":4884},{"style":645},[4885],{"type":21,"value":4853},{"type":15,"tag":616,"props":4887,"children":4888},{"style":733},[4889],{"type":21,"value":4890},"\"Boston\"",{"type":15,"tag":616,"props":4892,"children":4893},{"style":645},[4894],{"type":21,"value":4511},{"type":15,"tag":616,"props":4896,"children":4897},{"class":618,"line":744},[4898,4902,4906,4911,4916],{"type":15,"tag":616,"props":4899,"children":4900},{"style":645},[4901],{"type":21,"value":4836},{"type":15,"tag":616,"props":4903,"children":4904},{"style":733},[4905],{"type":21,"value":903},{"type":15,"tag":616,"props":4907,"children":4908},{"style":645},[4909],{"type":21,"value":4910},",op: ",{"type":15,"tag":616,"props":4912,"children":4913},{"style":733},[4914],{"type":21,"value":4915},"\"exists\"",{"type":15,"tag":616,"props":4917,"children":4918},{"style":645},[4919],{"type":21,"value":1536},{"type":15,"tag":616,"props":4921,"children":4922},{"class":618,"line":772},[4923],{"type":15,"tag":616,"props":4924,"children":4925},{"style":645},[4926],{"type":21,"value":4927},"    ]\n",{"type":15,"tag":616,"props":4929,"children":4930},{"class":618,"line":791},[4931],{"type":15,"tag":616,"props":4932,"children":4933},{"style":645},[4934],{"type":21,"value":1544},{"type":15,"tag":616,"props":4936,"children":4937},{"class":618,"line":805},[4938],{"type":15,"tag":616,"props":4939,"children":4940},{"emptyLinePlaceholder":689},[4941],{"type":21,"value":692},{"type":15,"tag":616,"props":4943,"children":4944},{"class":618,"line":814},[4945],{"type":15,"tag":616,"props":4946,"children":4947},{"style":623},[4948],{"type":21,"value":4949},"// Companies in any of three industries, headcount 500–5000\n",{"type":15,"tag":616,"props":4951,"children":4952},{"class":618,"line":822},[4953,4957,4961,4965,4969,4973,4977],{"type":15,"tag":616,"props":4954,"children":4955},{"style":645},[4956],{"type":21,"value":2022},{"type":15,"tag":616,"props":4958,"children":4959},{"style":639},[4960],{"type":21,"value":677},{"type":15,"tag":616,"props":4962,"children":4963},{"style":645},[4964],{"type":21,"value":1881},{"type":15,"tag":616,"props":4966,"children":4967},{"style":639},[4968],{"type":21,"value":603},{"type":15,"tag":616,"props":4970,"children":4971},{"style":645},[4972],{"type":21,"value":760},{"type":15,"tag":616,"props":4974,"children":4975},{"style":733},[4976],{"type":21,"value":736},{"type":15,"tag":616,"props":4978,"children":4979},{"style":645},[4980],{"type":21,"value":769},{"type":15,"tag":616,"props":4982,"children":4983},{"class":618,"line":831},[4984,4988,4992],{"type":15,"tag":616,"props":4985,"children":4986},{"style":645},[4987],{"type":21,"value":1501},{"type":15,"tag":616,"props":4989,"children":4990},{"style":733},[4991],{"type":21,"value":867},{"type":15,"tag":616,"props":4993,"children":4994},{"style":645},[4995],{"type":21,"value":788},{"type":15,"tag":616,"props":4997,"children":4998},{"class":618,"line":856},[4999],{"type":15,"tag":616,"props":5000,"children":5001},{"style":645},[5002],{"type":21,"value":4828},{"type":15,"tag":616,"props":5004,"children":5005},{"class":618,"line":874},[5006,5010,5014,5019,5024,5029,5033,5037,5041,5045,5050],{"type":15,"tag":616,"props":5007,"children":5008},{"style":645},[5009],{"type":21,"value":4836},{"type":15,"tag":616,"props":5011,"children":5012},{"style":733},[5013],{"type":21,"value":885},{"type":15,"tag":616,"props":5015,"children":5016},{"style":645},[5017],{"type":21,"value":5018},",  op: ",{"type":15,"tag":616,"props":5020,"children":5021},{"style":733},[5022],{"type":21,"value":5023},"\"in\"",{"type":15,"tag":616,"props":5025,"children":5026},{"style":645},[5027],{"type":21,"value":5028},",    value: [",{"type":15,"tag":616,"props":5030,"children":5031},{"style":733},[5032],{"type":21,"value":1187},{"type":15,"tag":616,"props":5034,"children":5035},{"style":645},[5036],{"type":21,"value":76},{"type":15,"tag":616,"props":5038,"children":5039},{"style":733},[5040],{"type":21,"value":2941},{"type":15,"tag":616,"props":5042,"children":5043},{"style":645},[5044],{"type":21,"value":76},{"type":15,"tag":616,"props":5046,"children":5047},{"style":733},[5048],{"type":21,"value":5049},"\"logistics\"",{"type":15,"tag":616,"props":5051,"children":5052},{"style":645},[5053],{"type":21,"value":5054},"] },\n",{"type":15,"tag":616,"props":5056,"children":5057},{"class":618,"line":911},[5058,5062,5066,5070,5075,5080,5085,5090,5095],{"type":15,"tag":616,"props":5059,"children":5060},{"style":645},[5061],{"type":21,"value":4836},{"type":15,"tag":616,"props":5063,"children":5064},{"style":733},[5065],{"type":21,"value":903},{"type":15,"tag":616,"props":5067,"children":5068},{"style":645},[5069],{"type":21,"value":1172},{"type":15,"tag":616,"props":5071,"children":5072},{"style":733},[5073],{"type":21,"value":5074},"\"range\"",{"type":15,"tag":616,"props":5076,"children":5077},{"style":645},[5078],{"type":21,"value":5079},", min: ",{"type":15,"tag":616,"props":5081,"children":5082},{"style":1204},[5083],{"type":21,"value":5084},"500",{"type":15,"tag":616,"props":5086,"children":5087},{"style":645},[5088],{"type":21,"value":5089},", max: ",{"type":15,"tag":616,"props":5091,"children":5092},{"style":1204},[5093],{"type":21,"value":5094},"5000",{"type":15,"tag":616,"props":5096,"children":5097},{"style":645},[5098],{"type":21,"value":1536},{"type":15,"tag":616,"props":5100,"children":5101},{"class":618,"line":929},[5102],{"type":15,"tag":616,"props":5103,"children":5104},{"style":645},[5105],{"type":21,"value":4927},{"type":15,"tag":616,"props":5107,"children":5108},{"class":618,"line":948},[5109],{"type":15,"tag":616,"props":5110,"children":5111},{"style":645},[5112],{"type":21,"value":1544},{"type":15,"tag":24,"props":5114,"children":5115},{},[5116,5118,5124,5126,5131],{"type":21,"value":5117},"Every ",{"type":15,"tag":143,"props":5119,"children":5121},{"className":5120},[],[5122],{"type":21,"value":5123},"attr",{"type":21,"value":5125}," and the ",{"type":15,"tag":143,"props":5127,"children":5129},{"className":5128},[],[5130],{"type":21,"value":1616},{"type":21,"value":5132}," are validated against the\ndataset config — query a typo and you get a clear error, not a\nsilently empty result.",{"type":15,"tag":1570,"props":5134,"children":5136},{"id":5135},"aggregate-count-group-distinct",[5137,5143],{"type":15,"tag":143,"props":5138,"children":5140},{"className":5139},[],[5141],{"type":21,"value":5142},"aggregate",{"type":21,"value":5144},": Count, Group, Distinct",{"type":15,"tag":24,"props":5146,"children":5147},{},[5148,5150,5155],{"type":21,"value":5149},"Add a terminal ",{"type":15,"tag":143,"props":5151,"children":5153},{"className":5152},[],[5154],{"type":21,"value":5142},{"type":21,"value":5156}," to reduce instead of listing. Without\none, you get the matched entities; with one, you get aggregate\nrows.",{"type":15,"tag":152,"props":5158,"children":5159},{},[5160,5190],{"type":15,"tag":156,"props":5161,"children":5162},{},[5163],{"type":15,"tag":160,"props":5164,"children":5165},{},[5166,5174,5185],{"type":15,"tag":164,"props":5167,"children":5168},{},[5169],{"type":15,"tag":143,"props":5170,"children":5172},{"className":5171},[],[5173],{"type":21,"value":4616},{"type":15,"tag":164,"props":5175,"children":5176},{},[5177,5179,5184],{"type":21,"value":5178},"Needs ",{"type":15,"tag":143,"props":5180,"children":5182},{"className":5181},[],[5183],{"type":21,"value":5123},{"type":21,"value":3347},{"type":15,"tag":164,"props":5186,"children":5187},{},[5188],{"type":21,"value":5189},"Returns",{"type":15,"tag":180,"props":5191,"children":5192},{},[5193,5221,5251],{"type":15,"tag":160,"props":5194,"children":5195},{},[5196,5205,5210],{"type":15,"tag":187,"props":5197,"children":5198},{},[5199],{"type":15,"tag":143,"props":5200,"children":5202},{"className":5201},[],[5203],{"type":21,"value":5204},"count",{"type":15,"tag":187,"props":5206,"children":5207},{},[5208],{"type":21,"value":5209},"no",{"type":15,"tag":187,"props":5211,"children":5212},{},[5213,5215],{"type":21,"value":5214},"a single row ",{"type":15,"tag":143,"props":5216,"children":5218},{"className":5217},[],[5219],{"type":21,"value":5220},"{ total: N }",{"type":15,"tag":160,"props":5222,"children":5223},{},[5224,5233,5238],{"type":15,"tag":187,"props":5225,"children":5226},{},[5227],{"type":15,"tag":143,"props":5228,"children":5230},{"className":5229},[],[5231],{"type":21,"value":5232},"group_by",{"type":15,"tag":187,"props":5234,"children":5235},{},[5236],{"type":21,"value":5237},"yes",{"type":15,"tag":187,"props":5239,"children":5240},{},[5241,5243,5249],{"type":21,"value":5242},"one row per distinct value: ",{"type":15,"tag":143,"props":5244,"children":5246},{"className":5245},[],[5247],{"type":21,"value":5248},"{ _id: value, count: N }",{"type":21,"value":5250},", highest count first",{"type":15,"tag":160,"props":5252,"children":5253},{},[5254,5263,5267],{"type":15,"tag":187,"props":5255,"children":5256},{},[5257],{"type":15,"tag":143,"props":5258,"children":5260},{"className":5259},[],[5261],{"type":21,"value":5262},"distinct",{"type":15,"tag":187,"props":5264,"children":5265},{},[5266],{"type":21,"value":5237},{"type":15,"tag":187,"props":5268,"children":5269},{},[5270,5271,5277],{"type":21,"value":5242},{"type":15,"tag":143,"props":5272,"children":5274},{"className":5273},[],[5275],{"type":21,"value":5276},"{ _id: value }",{"type":21,"value":5278},", sorted",{"type":15,"tag":477,"props":5280,"children":5282},{"code":5281,"language":609,"meta":7,"className":610,"style":7},"// How many fintech companies?\ncontext.getKnowledge().query(\"clients\", {\n    entityType: \"company\",\n    where: [{ attr: \"industry\", op: \"eq\", value: \"fintech\" }],\n    aggregate: { op: \"count\" }\n});\n\n// Company count per industry (the classic \"give me the breakdown\")\ncontext.getKnowledge().query(\"clients\", {\n    entityType: \"company\",\n    aggregate: { op: \"group_by\", attr: \"industry\" }\n});\n\n// What industries do we even have?\ncontext.getKnowledge().query(\"clients\", {\n    entityType: \"company\",\n    aggregate: { op: \"distinct\", attr: \"industry\" }\n});\n",[5283],{"type":15,"tag":143,"props":5284,"children":5285},{"__ignoreMap":7},[5286,5294,5325,5340,5372,5388,5395,5402,5410,5441,5456,5479,5486,5493,5501,5532,5547,5571],{"type":15,"tag":616,"props":5287,"children":5288},{"class":618,"line":619},[5289],{"type":15,"tag":616,"props":5290,"children":5291},{"style":623},[5292],{"type":21,"value":5293},"// How many fintech companies?\n",{"type":15,"tag":616,"props":5295,"children":5296},{"class":618,"line":629},[5297,5301,5305,5309,5313,5317,5321],{"type":15,"tag":616,"props":5298,"children":5299},{"style":645},[5300],{"type":21,"value":2022},{"type":15,"tag":616,"props":5302,"children":5303},{"style":639},[5304],{"type":21,"value":677},{"type":15,"tag":616,"props":5306,"children":5307},{"style":645},[5308],{"type":21,"value":1881},{"type":15,"tag":616,"props":5310,"children":5311},{"style":639},[5312],{"type":21,"value":603},{"type":15,"tag":616,"props":5314,"children":5315},{"style":645},[5316],{"type":21,"value":760},{"type":15,"tag":616,"props":5318,"children":5319},{"style":733},[5320],{"type":21,"value":736},{"type":15,"tag":616,"props":5322,"children":5323},{"style":645},[5324],{"type":21,"value":769},{"type":15,"tag":616,"props":5326,"children":5327},{"class":618,"line":651},[5328,5332,5336],{"type":15,"tag":616,"props":5329,"children":5330},{"style":645},[5331],{"type":21,"value":1501},{"type":15,"tag":616,"props":5333,"children":5334},{"style":733},[5335],{"type":21,"value":867},{"type":15,"tag":616,"props":5337,"children":5338},{"style":645},[5339],{"type":21,"value":788},{"type":15,"tag":616,"props":5341,"children":5342},{"class":618,"line":685},[5343,5348,5352,5356,5360,5364,5368],{"type":15,"tag":616,"props":5344,"children":5345},{"style":645},[5346],{"type":21,"value":5347},"    where: [{ attr: ",{"type":15,"tag":616,"props":5349,"children":5350},{"style":733},[5351],{"type":21,"value":885},{"type":15,"tag":616,"props":5353,"children":5354},{"style":645},[5355],{"type":21,"value":1172},{"type":15,"tag":616,"props":5357,"children":5358},{"style":733},[5359],{"type":21,"value":1177},{"type":15,"tag":616,"props":5361,"children":5362},{"style":645},[5363],{"type":21,"value":1182},{"type":15,"tag":616,"props":5365,"children":5366},{"style":733},[5367],{"type":21,"value":2941},{"type":15,"tag":616,"props":5369,"children":5370},{"style":645},[5371],{"type":21,"value":1192},{"type":15,"tag":616,"props":5373,"children":5374},{"class":618,"line":695},[5375,5379,5384],{"type":15,"tag":616,"props":5376,"children":5377},{"style":645},[5378],{"type":21,"value":1517},{"type":15,"tag":616,"props":5380,"children":5381},{"style":733},[5382],{"type":21,"value":5383},"\"count\"",{"type":15,"tag":616,"props":5385,"children":5386},{"style":645},[5387],{"type":21,"value":1536},{"type":15,"tag":616,"props":5389,"children":5390},{"class":618,"line":704},[5391],{"type":15,"tag":616,"props":5392,"children":5393},{"style":645},[5394],{"type":21,"value":1544},{"type":15,"tag":616,"props":5396,"children":5397},{"class":618,"line":744},[5398],{"type":15,"tag":616,"props":5399,"children":5400},{"emptyLinePlaceholder":689},[5401],{"type":21,"value":692},{"type":15,"tag":616,"props":5403,"children":5404},{"class":618,"line":772},[5405],{"type":15,"tag":616,"props":5406,"children":5407},{"style":623},[5408],{"type":21,"value":5409},"// Company count per industry (the classic \"give me the breakdown\")\n",{"type":15,"tag":616,"props":5411,"children":5412},{"class":618,"line":791},[5413,5417,5421,5425,5429,5433,5437],{"type":15,"tag":616,"props":5414,"children":5415},{"style":645},[5416],{"type":21,"value":2022},{"type":15,"tag":616,"props":5418,"children":5419},{"style":639},[5420],{"type":21,"value":677},{"type":15,"tag":616,"props":5422,"children":5423},{"style":645},[5424],{"type":21,"value":1881},{"type":15,"tag":616,"props":5426,"children":5427},{"style":639},[5428],{"type":21,"value":603},{"type":15,"tag":616,"props":5430,"children":5431},{"style":645},[5432],{"type":21,"value":760},{"type":15,"tag":616,"props":5434,"children":5435},{"style":733},[5436],{"type":21,"value":736},{"type":15,"tag":616,"props":5438,"children":5439},{"style":645},[5440],{"type":21,"value":769},{"type":15,"tag":616,"props":5442,"children":5443},{"class":618,"line":805},[5444,5448,5452],{"type":15,"tag":616,"props":5445,"children":5446},{"style":645},[5447],{"type":21,"value":1501},{"type":15,"tag":616,"props":5449,"children":5450},{"style":733},[5451],{"type":21,"value":867},{"type":15,"tag":616,"props":5453,"children":5454},{"style":645},[5455],{"type":21,"value":788},{"type":15,"tag":616,"props":5457,"children":5458},{"class":618,"line":814},[5459,5463,5467,5471,5475],{"type":15,"tag":616,"props":5460,"children":5461},{"style":645},[5462],{"type":21,"value":1517},{"type":15,"tag":616,"props":5464,"children":5465},{"style":733},[5466],{"type":21,"value":1522},{"type":15,"tag":616,"props":5468,"children":5469},{"style":645},[5470],{"type":21,"value":1527},{"type":15,"tag":616,"props":5472,"children":5473},{"style":733},[5474],{"type":21,"value":885},{"type":15,"tag":616,"props":5476,"children":5477},{"style":645},[5478],{"type":21,"value":1536},{"type":15,"tag":616,"props":5480,"children":5481},{"class":618,"line":822},[5482],{"type":15,"tag":616,"props":5483,"children":5484},{"style":645},[5485],{"type":21,"value":1544},{"type":15,"tag":616,"props":5487,"children":5488},{"class":618,"line":831},[5489],{"type":15,"tag":616,"props":5490,"children":5491},{"emptyLinePlaceholder":689},[5492],{"type":21,"value":692},{"type":15,"tag":616,"props":5494,"children":5495},{"class":618,"line":856},[5496],{"type":15,"tag":616,"props":5497,"children":5498},{"style":623},[5499],{"type":21,"value":5500},"// What industries do we even have?\n",{"type":15,"tag":616,"props":5502,"children":5503},{"class":618,"line":874},[5504,5508,5512,5516,5520,5524,5528],{"type":15,"tag":616,"props":5505,"children":5506},{"style":645},[5507],{"type":21,"value":2022},{"type":15,"tag":616,"props":5509,"children":5510},{"style":639},[5511],{"type":21,"value":677},{"type":15,"tag":616,"props":5513,"children":5514},{"style":645},[5515],{"type":21,"value":1881},{"type":15,"tag":616,"props":5517,"children":5518},{"style":639},[5519],{"type":21,"value":603},{"type":15,"tag":616,"props":5521,"children":5522},{"style":645},[5523],{"type":21,"value":760},{"type":15,"tag":616,"props":5525,"children":5526},{"style":733},[5527],{"type":21,"value":736},{"type":15,"tag":616,"props":5529,"children":5530},{"style":645},[5531],{"type":21,"value":769},{"type":15,"tag":616,"props":5533,"children":5534},{"class":618,"line":911},[5535,5539,5543],{"type":15,"tag":616,"props":5536,"children":5537},{"style":645},[5538],{"type":21,"value":1501},{"type":15,"tag":616,"props":5540,"children":5541},{"style":733},[5542],{"type":21,"value":867},{"type":15,"tag":616,"props":5544,"children":5545},{"style":645},[5546],{"type":21,"value":788},{"type":15,"tag":616,"props":5548,"children":5549},{"class":618,"line":929},[5550,5554,5559,5563,5567],{"type":15,"tag":616,"props":5551,"children":5552},{"style":645},[5553],{"type":21,"value":1517},{"type":15,"tag":616,"props":5555,"children":5556},{"style":733},[5557],{"type":21,"value":5558},"\"distinct\"",{"type":15,"tag":616,"props":5560,"children":5561},{"style":645},[5562],{"type":21,"value":1527},{"type":15,"tag":616,"props":5564,"children":5565},{"style":733},[5566],{"type":21,"value":885},{"type":15,"tag":616,"props":5568,"children":5569},{"style":645},[5570],{"type":21,"value":1536},{"type":15,"tag":616,"props":5572,"children":5573},{"class":618,"line":948},[5574],{"type":15,"tag":616,"props":5575,"children":5576},{"style":645},[5577],{"type":21,"value":1544},{"type":15,"tag":24,"props":5579,"children":5580},{},[5581,5583,5588,5590,5594],{"type":21,"value":5582},"This is the class of question RAG simply cannot answer: a\nsimilarity search returns the ",{"type":15,"tag":30,"props":5584,"children":5585},{},[5586],{"type":21,"value":5587},"most similar",{"type":21,"value":5589}," chunks, never a\n",{"type":15,"tag":30,"props":5591,"children":5592},{},[5593],{"type":21,"value":5204},{"type":21,"value":5595},". Here, \"14 retail clients\" is a fact.",{"type":15,"tag":131,"props":5597,"children":5599},{"id":5598},"vocabulary-query-against-reality-not-guesses",[5600],{"type":21,"value":5601},"Vocabulary: Query Against Reality, Not Guesses",{"type":15,"tag":24,"props":5603,"children":5604},{},[5605,5607,5613,5615,5621,5623,5628],{"type":21,"value":5606},"Before you (or an agent) filter on ",{"type":15,"tag":143,"props":5608,"children":5610},{"className":5609},[],[5611],{"type":21,"value":5612},"industry = \"fintech\"",{"type":21,"value":5614},", you\nneed to know the data actually says \"fintech\" and not \"Financial\nTechnology\" or \"FinTech\". ",{"type":15,"tag":143,"props":5616,"children":5618},{"className":5617},[],[5619],{"type":21,"value":5620},"vocabulary",{"type":21,"value":5622}," returns the ",{"type":15,"tag":48,"props":5624,"children":5625},{},[5626],{"type":21,"value":5627},"distinct\nattribute values and taxonomy facets that actually exist",{"type":21,"value":5629}," for a\ntype — computed over the access-filtered set, so it never leaks a\nvalue the user can't see.",{"type":15,"tag":477,"props":5631,"children":5633},{"code":5632,"language":609,"meta":7,"className":610,"style":7},"var vocab = context.getKnowledge().vocabulary(\"clients\", \"company\");\n// → { industry: [\"retail\",\"fintech\",\"logistics\", …],\n//     hq:       [\"Boston\",\"London\", …],\n//     … plus taxonomy facets … }\n",[5634],{"type":15,"tag":143,"props":5635,"children":5636},{"__ignoreMap":7},[5637,5689,5697,5705],{"type":15,"tag":616,"props":5638,"children":5639},{"class":618,"line":619},[5640,5644,5649,5653,5657,5661,5665,5669,5673,5677,5681,5685],{"type":15,"tag":616,"props":5641,"children":5642},{"style":633},[5643],{"type":21,"value":1464},{"type":15,"tag":616,"props":5645,"children":5646},{"style":645},[5647],{"type":21,"value":5648}," vocab ",{"type":15,"tag":616,"props":5650,"children":5651},{"style":633},[5652],{"type":21,"value":667},{"type":15,"tag":616,"props":5654,"children":5655},{"style":645},[5656],{"type":21,"value":672},{"type":15,"tag":616,"props":5658,"children":5659},{"style":639},[5660],{"type":21,"value":677},{"type":15,"tag":616,"props":5662,"children":5663},{"style":645},[5664],{"type":21,"value":1881},{"type":15,"tag":616,"props":5666,"children":5667},{"style":639},[5668],{"type":21,"value":5620},{"type":15,"tag":616,"props":5670,"children":5671},{"style":645},[5672],{"type":21,"value":760},{"type":15,"tag":616,"props":5674,"children":5675},{"style":733},[5676],{"type":21,"value":736},{"type":15,"tag":616,"props":5678,"children":5679},{"style":645},[5680],{"type":21,"value":76},{"type":15,"tag":616,"props":5682,"children":5683},{"style":733},[5684],{"type":21,"value":867},{"type":15,"tag":616,"props":5686,"children":5687},{"style":645},[5688],{"type":21,"value":1027},{"type":15,"tag":616,"props":5690,"children":5691},{"class":618,"line":629},[5692],{"type":15,"tag":616,"props":5693,"children":5694},{"style":623},[5695],{"type":21,"value":5696},"// → { industry: [\"retail\",\"fintech\",\"logistics\", …],\n",{"type":15,"tag":616,"props":5698,"children":5699},{"class":618,"line":651},[5700],{"type":15,"tag":616,"props":5701,"children":5702},{"style":623},[5703],{"type":21,"value":5704},"//     hq:       [\"Boston\",\"London\", …],\n",{"type":15,"tag":616,"props":5706,"children":5707},{"class":618,"line":685},[5708],{"type":15,"tag":616,"props":5709,"children":5710},{"style":623},[5711],{"type":21,"value":5712},"//     … plus taxonomy facets … }\n",{"type":15,"tag":24,"props":5714,"children":5715},{},[5716,5718,5723,5725,5730],{"type":21,"value":5717},"The pattern is ",{"type":15,"tag":48,"props":5719,"children":5720},{},[5721],{"type":21,"value":5722},"vocabulary first, then query",{"type":21,"value":5724},": read the real\nvalues, pick the right literal, ",{"type":15,"tag":30,"props":5726,"children":5727},{},[5728],{"type":21,"value":5729},"then",{"type":21,"value":5731}," predicate on it. This is\nthe single most effective habit for getting complete answers —\nit's why \"list retail clients\" returns 14 and not 9 (you queried\nthe value that exists, not the one you assumed).",{"type":15,"tag":131,"props":5733,"children":5735},{"id":5734},"relationships-and-traversal",[5736],{"type":21,"value":5737},"Relationships And Traversal",{"type":15,"tag":24,"props":5739,"children":5740},{},[5741,5743,5749,5751,5756,5758,5764,5766,5772,5773,5778,5780,5785,5787,5793],{"type":21,"value":5742},"Relationships unlock the query class RAG never could. A ",{"type":15,"tag":143,"props":5744,"children":5746},{"className":5745},[],[5747],{"type":21,"value":5748},"traverse",{"type":21,"value":5750},"\nlist adds up to ",{"type":15,"tag":48,"props":5752,"children":5753},{},[5754],{"type":21,"value":5755},"two relationship hops",{"type":21,"value":5757}," to a query; each hop is\n",{"type":15,"tag":143,"props":5759,"children":5761},{"className":5760},[],[5762],{"type":21,"value":5763},"{ relType, direction, as }",{"type":21,"value":5765},", where ",{"type":15,"tag":143,"props":5767,"children":5769},{"className":5768},[],[5770],{"type":21,"value":5771},"direction",{"type":21,"value":1970},{"type":15,"tag":143,"props":5774,"children":5776},{"className":5775},[],[5777],{"type":21,"value":115},{"type":21,"value":5779},"\n(follow the edge forwards, the default) or ",{"type":15,"tag":143,"props":5781,"children":5783},{"className":5782},[],[5784],{"type":21,"value":4667},{"type":21,"value":5786}," (follow it\nbackwards), and ",{"type":15,"tag":143,"props":5788,"children":5790},{"className":5789},[],[5791],{"type":21,"value":5792},"as",{"type":21,"value":5794}," names the joined set in the output.",{"type":15,"tag":477,"props":5796,"children":5798},{"code":5797,"language":609,"meta":7,"className":610,"style":7},"// \"Which people worked on a project for a retail client?\"\n// person --worked_on--> project --client_of--> company(retail)\ncontext.getKnowledge().query(\"clients\", {\n    entityType: \"person\",\n    traverse: [\n        { relType: \"worked_on\", direction: \"out\", as: \"projects\" },\n        { relType: \"client_of\", direction: \"out\", as: \"clients\"  }\n    ]\n    // (filter the far end via where on the joined attributes, or\n    //  narrow the start set, depending on your model)\n});\n\n// Reverse direction: \"who is staffed on Project Atlas?\"\n// start from the project, walk worked_on backwards to people\ncontext.getKnowledge().query(\"clients\", {\n    entityType: \"project\",\n    where:    [{ attr: \"name\", op: \"eq\", value: \"Project Atlas\" }],\n    traverse: [{ relType: \"worked_on\", direction: \"in\", as: \"people\" }]\n});\n",[5799],{"type":15,"tag":143,"props":5800,"children":5801},{"__ignoreMap":7},[5802,5810,5818,5849,5864,5872,5908,5940,5947,5955,5963,5970,5977,5985,5993,6024,6039,6073,6107],{"type":15,"tag":616,"props":5803,"children":5804},{"class":618,"line":619},[5805],{"type":15,"tag":616,"props":5806,"children":5807},{"style":623},[5808],{"type":21,"value":5809},"// \"Which people worked on a project for a retail client?\"\n",{"type":15,"tag":616,"props":5811,"children":5812},{"class":618,"line":629},[5813],{"type":15,"tag":616,"props":5814,"children":5815},{"style":623},[5816],{"type":21,"value":5817},"// person --worked_on--> project --client_of--> company(retail)\n",{"type":15,"tag":616,"props":5819,"children":5820},{"class":618,"line":651},[5821,5825,5829,5833,5837,5841,5845],{"type":15,"tag":616,"props":5822,"children":5823},{"style":645},[5824],{"type":21,"value":2022},{"type":15,"tag":616,"props":5826,"children":5827},{"style":639},[5828],{"type":21,"value":677},{"type":15,"tag":616,"props":5830,"children":5831},{"style":645},[5832],{"type":21,"value":1881},{"type":15,"tag":616,"props":5834,"children":5835},{"style":639},[5836],{"type":21,"value":603},{"type":15,"tag":616,"props":5838,"children":5839},{"style":645},[5840],{"type":21,"value":760},{"type":15,"tag":616,"props":5842,"children":5843},{"style":733},[5844],{"type":21,"value":736},{"type":15,"tag":616,"props":5846,"children":5847},{"style":645},[5848],{"type":21,"value":769},{"type":15,"tag":616,"props":5850,"children":5851},{"class":618,"line":685},[5852,5856,5860],{"type":15,"tag":616,"props":5853,"children":5854},{"style":645},[5855],{"type":21,"value":1501},{"type":15,"tag":616,"props":5857,"children":5858},{"style":733},[5859],{"type":21,"value":2277},{"type":15,"tag":616,"props":5861,"children":5862},{"style":645},[5863],{"type":21,"value":788},{"type":15,"tag":616,"props":5865,"children":5866},{"class":618,"line":695},[5867],{"type":15,"tag":616,"props":5868,"children":5869},{"style":645},[5870],{"type":21,"value":5871},"    traverse: [\n",{"type":15,"tag":616,"props":5873,"children":5874},{"class":618,"line":704},[5875,5880,5884,5889,5894,5899,5904],{"type":15,"tag":616,"props":5876,"children":5877},{"style":645},[5878],{"type":21,"value":5879},"        { relType: ",{"type":15,"tag":616,"props":5881,"children":5882},{"style":733},[5883],{"type":21,"value":2645},{"type":15,"tag":616,"props":5885,"children":5886},{"style":645},[5887],{"type":21,"value":5888},", direction: ",{"type":15,"tag":616,"props":5890,"children":5891},{"style":733},[5892],{"type":21,"value":5893},"\"out\"",{"type":15,"tag":616,"props":5895,"children":5896},{"style":645},[5897],{"type":21,"value":5898},", as: ",{"type":15,"tag":616,"props":5900,"children":5901},{"style":733},[5902],{"type":21,"value":5903},"\"projects\"",{"type":15,"tag":616,"props":5905,"children":5906},{"style":645},[5907],{"type":21,"value":4511},{"type":15,"tag":616,"props":5909,"children":5910},{"class":618,"line":744},[5911,5915,5919,5923,5927,5931,5935],{"type":15,"tag":616,"props":5912,"children":5913},{"style":645},[5914],{"type":21,"value":5879},{"type":15,"tag":616,"props":5916,"children":5917},{"style":733},[5918],{"type":21,"value":2722},{"type":15,"tag":616,"props":5920,"children":5921},{"style":645},[5922],{"type":21,"value":5888},{"type":15,"tag":616,"props":5924,"children":5925},{"style":733},[5926],{"type":21,"value":5893},{"type":15,"tag":616,"props":5928,"children":5929},{"style":645},[5930],{"type":21,"value":5898},{"type":15,"tag":616,"props":5932,"children":5933},{"style":733},[5934],{"type":21,"value":736},{"type":15,"tag":616,"props":5936,"children":5937},{"style":645},[5938],{"type":21,"value":5939},"  }\n",{"type":15,"tag":616,"props":5941,"children":5942},{"class":618,"line":772},[5943],{"type":15,"tag":616,"props":5944,"children":5945},{"style":645},[5946],{"type":21,"value":4927},{"type":15,"tag":616,"props":5948,"children":5949},{"class":618,"line":791},[5950],{"type":15,"tag":616,"props":5951,"children":5952},{"style":623},[5953],{"type":21,"value":5954},"    // (filter the far end via where on the joined attributes, or\n",{"type":15,"tag":616,"props":5956,"children":5957},{"class":618,"line":805},[5958],{"type":15,"tag":616,"props":5959,"children":5960},{"style":623},[5961],{"type":21,"value":5962},"    //  narrow the start set, depending on your model)\n",{"type":15,"tag":616,"props":5964,"children":5965},{"class":618,"line":814},[5966],{"type":15,"tag":616,"props":5967,"children":5968},{"style":645},[5969],{"type":21,"value":1544},{"type":15,"tag":616,"props":5971,"children":5972},{"class":618,"line":822},[5973],{"type":15,"tag":616,"props":5974,"children":5975},{"emptyLinePlaceholder":689},[5976],{"type":21,"value":692},{"type":15,"tag":616,"props":5978,"children":5979},{"class":618,"line":831},[5980],{"type":15,"tag":616,"props":5981,"children":5982},{"style":623},[5983],{"type":21,"value":5984},"// Reverse direction: \"who is staffed on Project Atlas?\"\n",{"type":15,"tag":616,"props":5986,"children":5987},{"class":618,"line":856},[5988],{"type":15,"tag":616,"props":5989,"children":5990},{"style":623},[5991],{"type":21,"value":5992},"// start from the project, walk worked_on backwards to people\n",{"type":15,"tag":616,"props":5994,"children":5995},{"class":618,"line":874},[5996,6000,6004,6008,6012,6016,6020],{"type":15,"tag":616,"props":5997,"children":5998},{"style":645},[5999],{"type":21,"value":2022},{"type":15,"tag":616,"props":6001,"children":6002},{"style":639},[6003],{"type":21,"value":677},{"type":15,"tag":616,"props":6005,"children":6006},{"style":645},[6007],{"type":21,"value":1881},{"type":15,"tag":616,"props":6009,"children":6010},{"style":639},[6011],{"type":21,"value":603},{"type":15,"tag":616,"props":6013,"children":6014},{"style":645},[6015],{"type":21,"value":760},{"type":15,"tag":616,"props":6017,"children":6018},{"style":733},[6019],{"type":21,"value":736},{"type":15,"tag":616,"props":6021,"children":6022},{"style":645},[6023],{"type":21,"value":769},{"type":15,"tag":616,"props":6025,"children":6026},{"class":618,"line":911},[6027,6031,6035],{"type":15,"tag":616,"props":6028,"children":6029},{"style":645},[6030],{"type":21,"value":1501},{"type":15,"tag":616,"props":6032,"children":6033},{"style":733},[6034],{"type":21,"value":2664},{"type":15,"tag":616,"props":6036,"children":6037},{"style":645},[6038],{"type":21,"value":788},{"type":15,"tag":616,"props":6040,"children":6041},{"class":618,"line":929},[6042,6047,6052,6056,6060,6064,6069],{"type":15,"tag":616,"props":6043,"children":6044},{"style":645},[6045],{"type":21,"value":6046},"    where:    [{ attr: ",{"type":15,"tag":616,"props":6048,"children":6049},{"style":733},[6050],{"type":21,"value":6051},"\"name\"",{"type":15,"tag":616,"props":6053,"children":6054},{"style":645},[6055],{"type":21,"value":1172},{"type":15,"tag":616,"props":6057,"children":6058},{"style":733},[6059],{"type":21,"value":1177},{"type":15,"tag":616,"props":6061,"children":6062},{"style":645},[6063],{"type":21,"value":1182},{"type":15,"tag":616,"props":6065,"children":6066},{"style":733},[6067],{"type":21,"value":6068},"\"Project Atlas\"",{"type":15,"tag":616,"props":6070,"children":6071},{"style":645},[6072],{"type":21,"value":1192},{"type":15,"tag":616,"props":6074,"children":6075},{"class":618,"line":948},[6076,6081,6085,6089,6093,6097,6102],{"type":15,"tag":616,"props":6077,"children":6078},{"style":645},[6079],{"type":21,"value":6080},"    traverse: [{ relType: ",{"type":15,"tag":616,"props":6082,"children":6083},{"style":733},[6084],{"type":21,"value":2645},{"type":15,"tag":616,"props":6086,"children":6087},{"style":645},[6088],{"type":21,"value":5888},{"type":15,"tag":616,"props":6090,"children":6091},{"style":733},[6092],{"type":21,"value":5023},{"type":15,"tag":616,"props":6094,"children":6095},{"style":645},[6096],{"type":21,"value":5898},{"type":15,"tag":616,"props":6098,"children":6099},{"style":733},[6100],{"type":21,"value":6101},"\"people\"",{"type":15,"tag":616,"props":6103,"children":6104},{"style":645},[6105],{"type":21,"value":6106}," }]\n",{"type":15,"tag":616,"props":6108,"children":6109},{"class":618,"line":956},[6110],{"type":15,"tag":616,"props":6111,"children":6112},{"style":645},[6113],{"type":21,"value":1544},{"type":15,"tag":24,"props":6115,"children":6116},{},[6117],{"type":21,"value":6118},"A traversal is only as good as the resolution underneath it —\nthe whole reason edges are built on canonical ids is so \"IBM\" and\n\"I.B.M.\" don't fragment your graph and make relational queries\nincomplete again. More than two hops is rejected: the design\ndeliberately stays within MongoDB's comfortable reach rather than\nadopting a graph database.",{"type":15,"tag":1570,"props":6120,"children":6122},{"id":6121},"writing-edges-by-hand",[6123],{"type":21,"value":6124},"Writing Edges By Hand",{"type":15,"tag":24,"props":6126,"children":6127},{},[6128,6130,6135,6137,6143],{"type":21,"value":6129},"Extraction creates edges for you, but sometimes you have a\nrelationship your app ",{"type":15,"tag":30,"props":6131,"children":6132},{},[6133],{"type":21,"value":6134},"knows",{"type":21,"value":6136}," (e.g. from its own relational data)\nthat you want to assert into the graph. ",{"type":15,"tag":143,"props":6138,"children":6140},{"className":6139},[],[6141],{"type":21,"value":6142},"addRelationship",{"type":21,"value":6144}," writes\none directed edge between two existing entities:",{"type":15,"tag":477,"props":6146,"children":6148},{"code":6147,"language":609,"meta":7,"className":610,"style":7},"var rel = context.getKnowledge().addRelationship(\"clients\", {\n    fromEntity:  \"entity_jane\",\n    toEntity:    \"entity_atlas\",\n    relType:     \"worked_on\",\n    sourceDocId: \"doc_hr_roster\",      // for lineage / \"where does it say?\"\n    sourceDocName: \"HR Roster 2026\",\n    folderIds:   [\"folder_hr\"],        // for access filtering on this edge\n    confidence:  1.0\n});\ncontext.log(\"Created edge \" + rel.id);\n",[6149],{"type":15,"tag":143,"props":6150,"children":6151},{"__ignoreMap":7},[6152,6196,6213,6230,6246,6269,6286,6309,6322,6329],{"type":15,"tag":616,"props":6153,"children":6154},{"class":618,"line":619},[6155,6159,6164,6168,6172,6176,6180,6184,6188,6192],{"type":15,"tag":616,"props":6156,"children":6157},{"style":633},[6158],{"type":21,"value":1464},{"type":15,"tag":616,"props":6160,"children":6161},{"style":645},[6162],{"type":21,"value":6163}," rel ",{"type":15,"tag":616,"props":6165,"children":6166},{"style":633},[6167],{"type":21,"value":667},{"type":15,"tag":616,"props":6169,"children":6170},{"style":645},[6171],{"type":21,"value":672},{"type":15,"tag":616,"props":6173,"children":6174},{"style":639},[6175],{"type":21,"value":677},{"type":15,"tag":616,"props":6177,"children":6178},{"style":645},[6179],{"type":21,"value":1881},{"type":15,"tag":616,"props":6181,"children":6182},{"style":639},[6183],{"type":21,"value":6142},{"type":15,"tag":616,"props":6185,"children":6186},{"style":645},[6187],{"type":21,"value":760},{"type":15,"tag":616,"props":6189,"children":6190},{"style":733},[6191],{"type":21,"value":736},{"type":15,"tag":616,"props":6193,"children":6194},{"style":645},[6195],{"type":21,"value":769},{"type":15,"tag":616,"props":6197,"children":6198},{"class":618,"line":629},[6199,6204,6209],{"type":15,"tag":616,"props":6200,"children":6201},{"style":645},[6202],{"type":21,"value":6203},"    fromEntity:  ",{"type":15,"tag":616,"props":6205,"children":6206},{"style":733},[6207],{"type":21,"value":6208},"\"entity_jane\"",{"type":15,"tag":616,"props":6210,"children":6211},{"style":645},[6212],{"type":21,"value":788},{"type":15,"tag":616,"props":6214,"children":6215},{"class":618,"line":651},[6216,6221,6226],{"type":15,"tag":616,"props":6217,"children":6218},{"style":645},[6219],{"type":21,"value":6220},"    toEntity:    ",{"type":15,"tag":616,"props":6222,"children":6223},{"style":733},[6224],{"type":21,"value":6225},"\"entity_atlas\"",{"type":15,"tag":616,"props":6227,"children":6228},{"style":645},[6229],{"type":21,"value":788},{"type":15,"tag":616,"props":6231,"children":6232},{"class":618,"line":685},[6233,6238,6242],{"type":15,"tag":616,"props":6234,"children":6235},{"style":645},[6236],{"type":21,"value":6237},"    relType:     ",{"type":15,"tag":616,"props":6239,"children":6240},{"style":733},[6241],{"type":21,"value":2645},{"type":15,"tag":616,"props":6243,"children":6244},{"style":645},[6245],{"type":21,"value":788},{"type":15,"tag":616,"props":6247,"children":6248},{"class":618,"line":695},[6249,6254,6259,6264],{"type":15,"tag":616,"props":6250,"children":6251},{"style":645},[6252],{"type":21,"value":6253},"    sourceDocId: ",{"type":15,"tag":616,"props":6255,"children":6256},{"style":733},[6257],{"type":21,"value":6258},"\"doc_hr_roster\"",{"type":15,"tag":616,"props":6260,"children":6261},{"style":645},[6262],{"type":21,"value":6263},",      ",{"type":15,"tag":616,"props":6265,"children":6266},{"style":623},[6267],{"type":21,"value":6268},"// for lineage / \"where does it say?\"\n",{"type":15,"tag":616,"props":6270,"children":6271},{"class":618,"line":704},[6272,6277,6282],{"type":15,"tag":616,"props":6273,"children":6274},{"style":645},[6275],{"type":21,"value":6276},"    sourceDocName: ",{"type":15,"tag":616,"props":6278,"children":6279},{"style":733},[6280],{"type":21,"value":6281},"\"HR Roster 2026\"",{"type":15,"tag":616,"props":6283,"children":6284},{"style":645},[6285],{"type":21,"value":788},{"type":15,"tag":616,"props":6287,"children":6288},{"class":618,"line":744},[6289,6294,6299,6304],{"type":15,"tag":616,"props":6290,"children":6291},{"style":645},[6292],{"type":21,"value":6293},"    folderIds:   [",{"type":15,"tag":616,"props":6295,"children":6296},{"style":733},[6297],{"type":21,"value":6298},"\"folder_hr\"",{"type":15,"tag":616,"props":6300,"children":6301},{"style":645},[6302],{"type":21,"value":6303},"],        ",{"type":15,"tag":616,"props":6305,"children":6306},{"style":623},[6307],{"type":21,"value":6308},"// for access filtering on this edge\n",{"type":15,"tag":616,"props":6310,"children":6311},{"class":618,"line":772},[6312,6317],{"type":15,"tag":616,"props":6313,"children":6314},{"style":645},[6315],{"type":21,"value":6316},"    confidence:  ",{"type":15,"tag":616,"props":6318,"children":6319},{"style":1204},[6320],{"type":21,"value":6321},"1.0\n",{"type":15,"tag":616,"props":6323,"children":6324},{"class":618,"line":791},[6325],{"type":15,"tag":616,"props":6326,"children":6327},{"style":645},[6328],{"type":21,"value":1544},{"type":15,"tag":616,"props":6330,"children":6331},{"class":618,"line":805},[6332,6336,6340,6344,6349,6353],{"type":15,"tag":616,"props":6333,"children":6334},{"style":645},[6335],{"type":21,"value":2022},{"type":15,"tag":616,"props":6337,"children":6338},{"style":639},[6339],{"type":21,"value":1041},{"type":15,"tag":616,"props":6341,"children":6342},{"style":645},[6343],{"type":21,"value":760},{"type":15,"tag":616,"props":6345,"children":6346},{"style":733},[6347],{"type":21,"value":6348},"\"Created edge \"",{"type":15,"tag":616,"props":6350,"children":6351},{"style":633},[6352],{"type":21,"value":1055},{"type":15,"tag":616,"props":6354,"children":6355},{"style":645},[6356],{"type":21,"value":6357}," rel.id);\n",{"type":15,"tag":24,"props":6359,"children":6360},{},[6361,6363,6369],{"type":21,"value":6362},"Edge writes are idempotent on ",{"type":15,"tag":143,"props":6364,"children":6366},{"className":6365},[],[6367],{"type":21,"value":6368},"(dataset, from, to, relType, sourceDoc)",{"type":21,"value":6370},", so re-asserting the same edge from the same source\nwon't duplicate it.",{"type":15,"tag":131,"props":6372,"children":6374},{"id":6373},"letting-the-agent-query-on-its-own",[6375],{"type":21,"value":6376},"Letting The Agent Query On Its Own",{"type":15,"tag":24,"props":6378,"children":6379},{},[6380,6382,6387],{"type":21,"value":6381},"Everything above assumes ",{"type":15,"tag":30,"props":6383,"children":6384},{},[6385],{"type":21,"value":6386},"you",{"type":21,"value":6388}," write the query. The real power\nmove is handing the query surface to an LLM agent and letting it\ndecide. Two native AITools do this:",{"type":15,"tag":152,"props":6390,"children":6391},{},[6392,6408],{"type":15,"tag":156,"props":6393,"children":6394},{},[6395],{"type":15,"tag":160,"props":6396,"children":6397},{},[6398,6403],{"type":15,"tag":164,"props":6399,"children":6400},{},[6401],{"type":21,"value":6402},"Tool",{"type":15,"tag":164,"props":6404,"children":6405},{},[6406],{"type":21,"value":6407},"What the LLM does with it",{"type":15,"tag":180,"props":6409,"children":6410},{},[6411,6427],{"type":15,"tag":160,"props":6412,"children":6413},{},[6414,6422],{"type":15,"tag":187,"props":6415,"children":6416},{},[6417],{"type":15,"tag":143,"props":6418,"children":6420},{"className":6419},[],[6421],{"type":21,"value":412},{"type":15,"tag":187,"props":6423,"children":6424},{},[6425],{"type":21,"value":6426},"\"What values can I even filter on?\" — discover concrete literals before querying.",{"type":15,"tag":160,"props":6428,"children":6429},{},[6430,6438],{"type":15,"tag":187,"props":6431,"children":6432},{},[6433],{"type":15,"tag":143,"props":6434,"children":6436},{"className":6435},[],[6437],{"type":21,"value":405},{"type":15,"tag":187,"props":6439,"children":6440},{},[6441],{"type":21,"value":6442},"\"Run this structured query\" — exact lookups, aggregates, traversals.",{"type":15,"tag":24,"props":6444,"children":6445},{},[6446],{"type":21,"value":6447},"Add them to your agent's chain JSON:",{"type":15,"tag":477,"props":6449,"children":6453},{"code":6450,"language":6451,"meta":7,"className":6452,"style":7},"{\n  \"tools\": [\n    { \"type\": \"knowledgeVocabulary\", \"name\": \"discoverValues\" },\n    { \"type\": \"knowledgeQuery\",      \"name\": \"queryKnowledge\" }\n  ]\n}\n","json","language-json shiki shiki-themes github-light github-dark",[6454],{"type":15,"tag":143,"props":6455,"children":6456},{"__ignoreMap":7},[6457,6465,6478,6522,6563,6571],{"type":15,"tag":616,"props":6458,"children":6459},{"class":618,"line":619},[6460],{"type":15,"tag":616,"props":6461,"children":6462},{"style":645},[6463],{"type":21,"value":6464},"{\n",{"type":15,"tag":616,"props":6466,"children":6467},{"class":618,"line":629},[6468,6473],{"type":15,"tag":616,"props":6469,"children":6470},{"style":1204},[6471],{"type":21,"value":6472},"  \"tools\"",{"type":15,"tag":616,"props":6474,"children":6475},{"style":645},[6476],{"type":21,"value":6477},": [\n",{"type":15,"tag":616,"props":6479,"children":6480},{"class":618,"line":651},[6481,6486,6491,6496,6501,6505,6509,6513,6518],{"type":15,"tag":616,"props":6482,"children":6483},{"style":645},[6484],{"type":21,"value":6485},"    { ",{"type":15,"tag":616,"props":6487,"children":6488},{"style":1204},[6489],{"type":21,"value":6490},"\"type\"",{"type":15,"tag":616,"props":6492,"children":6493},{"style":645},[6494],{"type":21,"value":6495},": ",{"type":15,"tag":616,"props":6497,"children":6498},{"style":733},[6499],{"type":21,"value":6500},"\"knowledgeVocabulary\"",{"type":15,"tag":616,"props":6502,"children":6503},{"style":645},[6504],{"type":21,"value":76},{"type":15,"tag":616,"props":6506,"children":6507},{"style":1204},[6508],{"type":21,"value":6051},{"type":15,"tag":616,"props":6510,"children":6511},{"style":645},[6512],{"type":21,"value":6495},{"type":15,"tag":616,"props":6514,"children":6515},{"style":733},[6516],{"type":21,"value":6517},"\"discoverValues\"",{"type":15,"tag":616,"props":6519,"children":6520},{"style":645},[6521],{"type":21,"value":4511},{"type":15,"tag":616,"props":6523,"children":6524},{"class":618,"line":685},[6525,6529,6533,6537,6542,6546,6550,6554,6559],{"type":15,"tag":616,"props":6526,"children":6527},{"style":645},[6528],{"type":21,"value":6485},{"type":15,"tag":616,"props":6530,"children":6531},{"style":1204},[6532],{"type":21,"value":6490},{"type":15,"tag":616,"props":6534,"children":6535},{"style":645},[6536],{"type":21,"value":6495},{"type":15,"tag":616,"props":6538,"children":6539},{"style":733},[6540],{"type":21,"value":6541},"\"knowledgeQuery\"",{"type":15,"tag":616,"props":6543,"children":6544},{"style":645},[6545],{"type":21,"value":6263},{"type":15,"tag":616,"props":6547,"children":6548},{"style":1204},[6549],{"type":21,"value":6051},{"type":15,"tag":616,"props":6551,"children":6552},{"style":645},[6553],{"type":21,"value":6495},{"type":15,"tag":616,"props":6555,"children":6556},{"style":733},[6557],{"type":21,"value":6558},"\"queryKnowledge\"",{"type":15,"tag":616,"props":6560,"children":6561},{"style":645},[6562],{"type":21,"value":1536},{"type":15,"tag":616,"props":6564,"children":6565},{"class":618,"line":695},[6566],{"type":15,"tag":616,"props":6567,"children":6568},{"style":645},[6569],{"type":21,"value":6570},"  ]\n",{"type":15,"tag":616,"props":6572,"children":6573},{"class":618,"line":704},[6574],{"type":15,"tag":616,"props":6575,"children":6576},{"style":645},[6577],{"type":21,"value":1319},{"type":15,"tag":24,"props":6579,"children":6580},{},[6581,6583,6589,6591,6597,6599,6605,6607,6613,6615,6620,6622,6627],{"type":21,"value":6582},"(The canonical type names ",{"type":15,"tag":143,"props":6584,"children":6586},{"className":6585},[],[6587],{"type":21,"value":6588},"KNOWLEDGE_VOCABULARY",{"type":21,"value":6590}," and\n",{"type":15,"tag":143,"props":6592,"children":6594},{"className":6593},[],[6595],{"type":21,"value":6596},"KNOWLEDGE_QUERY",{"type":21,"value":6598}," work too; ",{"type":15,"tag":143,"props":6600,"children":6602},{"className":6601},[],[6603],{"type":21,"value":6604},"knowledgeVocabulary",{"type":21,"value":6606}," /\n",{"type":15,"tag":143,"props":6608,"children":6610},{"className":6609},[],[6611],{"type":21,"value":6612},"knowledgeQuery",{"type":21,"value":6614}," are the friendly aliases.) Unlike the recall\ntools, the knowledge tools take their ",{"type":15,"tag":143,"props":6616,"children":6618},{"className":6617},[],[6619],{"type":21,"value":1591},{"type":21,"value":6621}," as a tool\n",{"type":15,"tag":30,"props":6623,"children":6624},{},[6625],{"type":21,"value":6626},"argument",{"type":21,"value":6628},", not as chain config — so one agent definition can\nquery any dataset the prompt names.",{"type":15,"tag":24,"props":6630,"children":6631},{},[6632,6634,6639],{"type":21,"value":6633},"The agent then runs a ",{"type":15,"tag":48,"props":6635,"children":6636},{},[6637],{"type":21,"value":6638},"discover-then-query",{"type":21,"value":6640}," loop on its own:",{"type":15,"tag":477,"props":6642,"children":6644},{"code":6643},"User:   \"How many of our consultants know Kubernetes, and who are they?\"\n\nAgent:  [calls discoverValues: datasetId=\"clients\", entityType=\"person\",\n         attributeKey=\"skill\"]\nTool:   skill: [\"Java\", \"Kubernetes\", \"React\", \"Terraform\", …]\n\nAgent:  [sees \"Kubernetes\" is the real value; calls queryKnowledge with\n         spec={ entityType:\"person\",\n                where:[{attr:\"skill\", op:\"contains\", value:\"Kubernetes\"}],\n                aggregate:{op:\"count\"} }]\nTool:   aggregate: count; entityType: person; 1 row.  { total: 7 }\n\nAgent:  [calls queryKnowledge again, same where, no aggregate, to list them]\nTool:   7 entities. Jane Okafor; Erik Lind; …\n\nAgent:  \"7 consultants list Kubernetes: Jane Okafor, Erik Lind, …\"\n",[6645],{"type":15,"tag":143,"props":6646,"children":6647},{"__ignoreMap":7},[6648],{"type":21,"value":6643},{"type":15,"tag":24,"props":6650,"children":6651},{},[6652,6654,6659],{"type":21,"value":6653},"The agent grounded itself in real vocabulary, ran an exact count,\nthen listed — three tool calls, zero hallucinated skill names.\nBoth tools' results are ",{"type":15,"tag":48,"props":6655,"children":6656},{},[6657],{"type":21,"value":6658},"always access-filtered",{"type":21,"value":6660}," to what the\ncurrent user may read, so you can expose them to an end-user\nagent without leaking protected facts.",{"type":15,"tag":24,"props":6662,"children":6663},{},[6664,6666,6672],{"type":21,"value":6665},"You can also pass an optional ",{"type":15,"tag":143,"props":6667,"children":6669},{"className":6668},[],[6670],{"type":21,"value":6671},"folderIds",{"type":21,"value":6673}," array to either tool to\nscope visibility further; the record-level ACL still applies on\ntop.",{"type":15,"tag":131,"props":6675,"children":6677},{"id":6676},"access-control",[6678],{"type":21,"value":457},{"type":15,"tag":24,"props":6680,"children":6681},{},[6682,6684,6689,6691,6696,6698,6703,6705,6710],{"type":21,"value":6683},"An entity is not in a folder. The same \"Acme\" appears in\ndocuments across many folders with different permissions, so\n\"can this user see Acme?\" has ",{"type":15,"tag":48,"props":6685,"children":6686},{},[6687],{"type":21,"value":6688},"no single answer",{"type":21,"value":6690}," — it depends on\n",{"type":15,"tag":30,"props":6692,"children":6693},{},[6694],{"type":21,"value":6695},"which facts",{"type":21,"value":6697},", from ",{"type":15,"tag":30,"props":6699,"children":6700},{},[6701],{"type":21,"value":6702},"which sources",{"type":21,"value":6704},", the user may read. The\nknowledge layer answers this at the ",{"type":15,"tag":48,"props":6706,"children":6707},{},[6708],{"type":21,"value":6709},"per-fact",{"type":21,"value":6711}," level.",{"type":15,"tag":1570,"props":6713,"children":6715},{"id":6714},"how-it-works",[6716],{"type":21,"value":6717},"How It Works",{"type":15,"tag":24,"props":6719,"children":6720},{},[6721],{"type":21,"value":6722},"Three things are true, and they're worth internalising:",{"type":15,"tag":6724,"props":6725,"children":6726},"ol",{},[6727,6744,6761],{"type":15,"tag":42,"props":6728,"children":6729},{},[6730,6735,6737,6742],{"type":15,"tag":48,"props":6731,"children":6732},{},[6733],{"type":21,"value":6734},"Facts inherit the access of their own source.",{"type":21,"value":6736}," If the only\ndocument asserting \"Acme is in retail\" is one you can't see,\nthat fact does not count for you — even if you can see some\n",{"type":15,"tag":30,"props":6738,"children":6739},{},[6740],{"type":21,"value":6741},"other",{"type":21,"value":6743},", unrelated Acme document. Otherwise \"list retail\nclients\" would leak a fact that lived only in a protected file.",{"type":15,"tag":42,"props":6745,"children":6746},{},[6747,6752,6754,6759],{"type":15,"tag":48,"props":6748,"children":6749},{},[6750],{"type":21,"value":6751},"An entity with no readable fact disappears.",{"type":21,"value":6753}," Filtering drops\nthe whole entity if nothing survives, which closes the\ninference leak (\"Acme showed up in my retail list, therefore\n",{"type":15,"tag":30,"props":6755,"children":6756},{},[6757],{"type":21,"value":6758},"something",{"type":21,"value":6760}," says Acme is retail\").",{"type":15,"tag":42,"props":6762,"children":6763},{},[6764,6769],{"type":15,"tag":48,"props":6765,"children":6766},{},[6767],{"type":21,"value":6768},"The same query yields different answers for different\nusers",{"type":21,"value":6770},", and that is correct. Counts and lists are relative to\npermissions. Frame this for stakeholders: \"we have 14 retail\nclients but you see 9\" is access filtering, not a bug.",{"type":15,"tag":24,"props":6772,"children":6773},{},[6774,6776,6781,6783,6788],{"type":21,"value":6775},"Enforcement is defense-in-depth. There's a fast folder\n",{"type":15,"tag":30,"props":6777,"children":6778},{},[6779],{"type":21,"value":6780},"pre-filter",{"type":21,"value":6782}," (a performance optimization) and an ",{"type":15,"tag":48,"props":6784,"children":6785},{},[6786],{"type":21,"value":6787},"authoritative\nper-source record ACL",{"type":21,"value":6789}," that is always applied. Even if a\ndenormalized folder list drifts, access cannot leak, because the\nrecord ACL is the real gate.",{"type":15,"tag":1570,"props":6791,"children":6793},{"id":6792},"registering-the-resolver-one-time-app-startup",[6794],{"type":21,"value":6795},"Registering The Resolver (One-Time, App Startup)",{"type":15,"tag":24,"props":6797,"children":6798},{},[6799],{"type":21,"value":6800},"The fast pre-filter needs to know \"which folders may this user\nsee?\" — app-specific logic. Register it once, process-wide, in\nJava startup:",{"type":15,"tag":477,"props":6802,"children":6806},{"code":6803,"language":6804,"meta":7,"className":6805,"style":7},"KnowledgeAccess.setPermittedFolderResolver((scope, user) -> {\n    // Return the set of folder/document ids this user may see,\n    // or null to mean \"no pre-filter; rely on the record ACL\".\n    // MUST be a superset of the user's true folders; MUST NOT be\n    // empty to mean \"see nothing\" — return null for that.\n    return myAcl.foldersVisibleTo(user);\n});\n","java","language-java shiki shiki-themes github-light github-dark",[6807],{"type":15,"tag":143,"props":6808,"children":6809},{"__ignoreMap":7},[6810,6838,6846,6854,6862,6870,6893],{"type":15,"tag":616,"props":6811,"children":6812},{"class":618,"line":619},[6813,6818,6823,6828,6833],{"type":15,"tag":616,"props":6814,"children":6815},{"style":645},[6816],{"type":21,"value":6817},"KnowledgeAccess.",{"type":15,"tag":616,"props":6819,"children":6820},{"style":639},[6821],{"type":21,"value":6822},"setPermittedFolderResolver",{"type":15,"tag":616,"props":6824,"children":6825},{"style":645},[6826],{"type":21,"value":6827},"((scope, user) ",{"type":15,"tag":616,"props":6829,"children":6830},{"style":633},[6831],{"type":21,"value":6832},"->",{"type":15,"tag":616,"props":6834,"children":6835},{"style":645},[6836],{"type":21,"value":6837}," {\n",{"type":15,"tag":616,"props":6839,"children":6840},{"class":618,"line":629},[6841],{"type":15,"tag":616,"props":6842,"children":6843},{"style":623},[6844],{"type":21,"value":6845},"    // Return the set of folder/document ids this user may see,\n",{"type":15,"tag":616,"props":6847,"children":6848},{"class":618,"line":651},[6849],{"type":15,"tag":616,"props":6850,"children":6851},{"style":623},[6852],{"type":21,"value":6853},"    // or null to mean \"no pre-filter; rely on the record ACL\".\n",{"type":15,"tag":616,"props":6855,"children":6856},{"class":618,"line":685},[6857],{"type":15,"tag":616,"props":6858,"children":6859},{"style":623},[6860],{"type":21,"value":6861},"    // MUST be a superset of the user's true folders; MUST NOT be\n",{"type":15,"tag":616,"props":6863,"children":6864},{"class":618,"line":695},[6865],{"type":15,"tag":616,"props":6866,"children":6867},{"style":623},[6868],{"type":21,"value":6869},"    // empty to mean \"see nothing\" — return null for that.\n",{"type":15,"tag":616,"props":6871,"children":6872},{"class":618,"line":704},[6873,6878,6883,6888],{"type":15,"tag":616,"props":6874,"children":6875},{"style":633},[6876],{"type":21,"value":6877},"    return",{"type":15,"tag":616,"props":6879,"children":6880},{"style":645},[6881],{"type":21,"value":6882}," myAcl.",{"type":15,"tag":616,"props":6884,"children":6885},{"style":639},[6886],{"type":21,"value":6887},"foldersVisibleTo",{"type":15,"tag":616,"props":6889,"children":6890},{"style":645},[6891],{"type":21,"value":6892},"(user);\n",{"type":15,"tag":616,"props":6894,"children":6895},{"class":618,"line":744},[6896],{"type":15,"tag":616,"props":6897,"children":6898},{"style":645},[6899],{"type":21,"value":1544},{"type":15,"tag":24,"props":6901,"children":6902},{},[6903,6905,6910,6912,6916],{"type":21,"value":6904},"If no resolver is registered, you don't lose access control — you\njust lose the ",{"type":15,"tag":30,"props":6906,"children":6907},{},[6908],{"type":21,"value":6909},"pre-filter optimization",{"type":21,"value":6911},". The authoritative\nper-source check still runs on every query. \"No resolver\" does\n",{"type":15,"tag":48,"props":6913,"children":6914},{},[6915],{"type":21,"value":1715},{"type":21,"value":6917}," mean \"no access control.\"",{"type":15,"tag":1570,"props":6919,"children":6921},{"id":6920},"scoping-per-call-folderids",[6922,6924,6929],{"type":21,"value":6923},"Scoping Per Call (",{"type":15,"tag":143,"props":6925,"children":6927},{"className":6926},[],[6928],{"type":21,"value":6671},{"type":21,"value":3118},{"type":15,"tag":24,"props":6931,"children":6932},{},[6933,6935,6940],{"type":21,"value":6934},"From JS or an agent tool you can narrow visibility further by\npassing ",{"type":15,"tag":143,"props":6936,"children":6938},{"className":6937},[],[6939],{"type":21,"value":6671},{"type":21,"value":6941}," — a performance/scoping hint, with the record\nACL still authoritative:",{"type":15,"tag":477,"props":6943,"children":6945},{"code":6944,"language":609,"meta":7,"className":610,"style":7},"// Only consider facts sourced from these folders (plus the ACL):\ncontext.getKnowledge().query(\"clients\",\n    { entityType: \"company\", where: [{ attr: \"industry\", op: \"eq\", value: \"retail\" }] },\n    [\"folder_active_engagements\"]);\n",[6946],{"type":15,"tag":143,"props":6947,"children":6948},{"__ignoreMap":7},[6949,6957,6988,7030],{"type":15,"tag":616,"props":6950,"children":6951},{"class":618,"line":619},[6952],{"type":15,"tag":616,"props":6953,"children":6954},{"style":623},[6955],{"type":21,"value":6956},"// Only consider facts sourced from these folders (plus the ACL):\n",{"type":15,"tag":616,"props":6958,"children":6959},{"class":618,"line":629},[6960,6964,6968,6972,6976,6980,6984],{"type":15,"tag":616,"props":6961,"children":6962},{"style":645},[6963],{"type":21,"value":2022},{"type":15,"tag":616,"props":6965,"children":6966},{"style":639},[6967],{"type":21,"value":677},{"type":15,"tag":616,"props":6969,"children":6970},{"style":645},[6971],{"type":21,"value":1881},{"type":15,"tag":616,"props":6973,"children":6974},{"style":639},[6975],{"type":21,"value":603},{"type":15,"tag":616,"props":6977,"children":6978},{"style":645},[6979],{"type":21,"value":760},{"type":15,"tag":616,"props":6981,"children":6982},{"style":733},[6983],{"type":21,"value":736},{"type":15,"tag":616,"props":6985,"children":6986},{"style":645},[6987],{"type":21,"value":788},{"type":15,"tag":616,"props":6989,"children":6990},{"class":618,"line":651},[6991,6996,7000,7005,7009,7013,7017,7021,7025],{"type":15,"tag":616,"props":6992,"children":6993},{"style":645},[6994],{"type":21,"value":6995},"    { entityType: ",{"type":15,"tag":616,"props":6997,"children":6998},{"style":733},[6999],{"type":21,"value":867},{"type":15,"tag":616,"props":7001,"children":7002},{"style":645},[7003],{"type":21,"value":7004},", where: [{ attr: ",{"type":15,"tag":616,"props":7006,"children":7007},{"style":733},[7008],{"type":21,"value":885},{"type":15,"tag":616,"props":7010,"children":7011},{"style":645},[7012],{"type":21,"value":1172},{"type":15,"tag":616,"props":7014,"children":7015},{"style":733},[7016],{"type":21,"value":1177},{"type":15,"tag":616,"props":7018,"children":7019},{"style":645},[7020],{"type":21,"value":1182},{"type":15,"tag":616,"props":7022,"children":7023},{"style":733},[7024],{"type":21,"value":1187},{"type":15,"tag":616,"props":7026,"children":7027},{"style":645},[7028],{"type":21,"value":7029}," }] },\n",{"type":15,"tag":616,"props":7031,"children":7032},{"class":618,"line":685},[7033,7038,7043],{"type":15,"tag":616,"props":7034,"children":7035},{"style":645},[7036],{"type":21,"value":7037},"    [",{"type":15,"tag":616,"props":7039,"children":7040},{"style":733},[7041],{"type":21,"value":7042},"\"folder_active_engagements\"",{"type":15,"tag":616,"props":7044,"children":7045},{"style":645},[7046],{"type":21,"value":7047},"]);\n",{"type":15,"tag":131,"props":7049,"children":7051},{"id":7050},"knowledge-vs-rag-when-to-use-which",[7052],{"type":21,"value":7053},"Knowledge vs RAG: When To Use Which",{"type":15,"tag":24,"props":7055,"children":7056},{},[7057],{"type":21,"value":7058},"The two layers coexist by design. Route the question to the right\ntool:",{"type":15,"tag":152,"props":7060,"children":7061},{},[7062,7083],{"type":15,"tag":156,"props":7063,"children":7064},{},[7065],{"type":15,"tag":160,"props":7066,"children":7067},{},[7068,7073,7078],{"type":15,"tag":164,"props":7069,"children":7070},{},[7071],{"type":21,"value":7072},"The question is…",{"type":15,"tag":164,"props":7074,"children":7075},{},[7076],{"type":21,"value":7077},"Use",{"type":15,"tag":164,"props":7079,"children":7080},{},[7081],{"type":21,"value":7082},"Why",{"type":15,"tag":180,"props":7084,"children":7085},{},[7086,7125,7151,7180,7200],{"type":15,"tag":160,"props":7087,"children":7088},{},[7089,7100,7120],{"type":15,"tag":187,"props":7090,"children":7091},{},[7092,7093,7098],{"type":21,"value":46},{"type":15,"tag":48,"props":7094,"children":7095},{},[7096],{"type":21,"value":7097},"all",{"type":21,"value":7099}," X\", \"how many Y\", \"count per Z\"",{"type":15,"tag":187,"props":7101,"children":7102},{},[7103,7107,7108,7113,7115],{"type":15,"tag":48,"props":7104,"children":7105},{},[7106],{"type":21,"value":8},{"type":21,"value":1809},{"type":15,"tag":143,"props":7109,"children":7111},{"className":7110},[],[7112],{"type":21,"value":603},{"type":21,"value":7114}," + ",{"type":15,"tag":143,"props":7116,"children":7118},{"className":7117},[],[7119],{"type":21,"value":5142},{"type":15,"tag":187,"props":7121,"children":7122},{},[7123],{"type":21,"value":7124},"Exhaustive & exact; RAG can't count or guarantee completeness.",{"type":15,"tag":160,"props":7126,"children":7127},{},[7128,7133,7146],{"type":15,"tag":187,"props":7129,"children":7130},{},[7131],{"type":21,"value":7132},"\"Which A relate to B\" (1–2 hops)",{"type":15,"tag":187,"props":7134,"children":7135},{},[7136,7140,7141],{"type":15,"tag":48,"props":7137,"children":7138},{},[7139],{"type":21,"value":8},{"type":21,"value":1809},{"type":15,"tag":143,"props":7142,"children":7144},{"className":7143},[],[7145],{"type":21,"value":5748},{"type":15,"tag":187,"props":7147,"children":7148},{},[7149],{"type":21,"value":7150},"Relational; RAG has no notion of edges.",{"type":15,"tag":160,"props":7152,"children":7153},{},[7154,7166,7175],{"type":15,"tag":187,"props":7155,"children":7156},{},[7157,7159,7164],{"type":21,"value":7158},"\"Find a project ",{"type":15,"tag":30,"props":7160,"children":7161},{},[7162],{"type":21,"value":7163},"like",{"type":21,"value":7165}," this\", \"what did we say about pricing\"",{"type":15,"tag":187,"props":7167,"children":7168},{},[7169,7173],{"type":15,"tag":48,"props":7170,"children":7171},{},[7172],{"type":21,"value":96},{"type":21,"value":7174}," (existing vector search)",{"type":15,"tag":187,"props":7176,"children":7177},{},[7178],{"type":21,"value":7179},"Fuzzy / semantic / discovery; knowledge has no similarity notion.",{"type":15,"tag":160,"props":7181,"children":7182},{},[7183,7188,7195],{"type":15,"tag":187,"props":7184,"children":7185},{},[7186],{"type":21,"value":7187},"\"Give me an example of…\"",{"type":15,"tag":187,"props":7189,"children":7190},{},[7191],{"type":15,"tag":48,"props":7192,"children":7193},{},[7194],{"type":21,"value":96},{"type":15,"tag":187,"props":7196,"children":7197},{},[7198],{"type":21,"value":7199},"Open-ended retrieval.",{"type":15,"tag":160,"props":7201,"children":7202},{},[7203,7208,7216],{"type":15,"tag":187,"props":7204,"children":7205},{},[7206],{"type":21,"value":7207},"\"Narrow to retail clients, then find the most relevant case study\"",{"type":15,"tag":187,"props":7209,"children":7210},{},[7211],{"type":15,"tag":48,"props":7212,"children":7213},{},[7214],{"type":21,"value":7215},"Hybrid",{"type":15,"tag":187,"props":7217,"children":7218},{},[7219],{"type":21,"value":7220},"Knowledge to get the exact candidate set, RAG to rank within it.",{"type":15,"tag":24,"props":7222,"children":7223},{},[7224,7226,7231,7233,7238],{"type":21,"value":7225},"A good agent has ",{"type":15,"tag":30,"props":7227,"children":7228},{},[7229],{"type":21,"value":7230},"both",{"type":21,"value":7232}," a ",{"type":15,"tag":143,"props":7234,"children":7236},{"className":7235},[],[7237],{"type":21,"value":405},{"type":21,"value":7239}," tool and the existing\nRAG/search tool, and a system prompt that tells it which class of\nquestion each serves. Exhaustive and exact → knowledge. Fuzzy and\nillustrative → RAG.",{"type":15,"tag":131,"props":7241,"children":7243},{"id":7242},"worked-examples-trivial-to-advanced",[7244],{"type":21,"value":7245},"Worked Examples, Trivial To Advanced",{"type":15,"tag":1570,"props":7247,"children":7249},{"id":7248},"level-0-hello-world-count-one-thing",[7250],{"type":21,"value":7251},"Level 0 — Hello World: Count One Thing",{"type":15,"tag":477,"props":7253,"children":7255},{"code":7254,"language":609,"meta":7,"className":610,"style":7},"// \"How many companies have we extracted?\"\ncontext.getKnowledge().query(\"clients\", {\n    entityType: \"company\",\n    aggregate: { op: \"count\" }\n});\n",[7256],{"type":15,"tag":143,"props":7257,"children":7258},{"__ignoreMap":7},[7259,7267,7298,7313,7328],{"type":15,"tag":616,"props":7260,"children":7261},{"class":618,"line":619},[7262],{"type":15,"tag":616,"props":7263,"children":7264},{"style":623},[7265],{"type":21,"value":7266},"// \"How many companies have we extracted?\"\n",{"type":15,"tag":616,"props":7268,"children":7269},{"class":618,"line":629},[7270,7274,7278,7282,7286,7290,7294],{"type":15,"tag":616,"props":7271,"children":7272},{"style":645},[7273],{"type":21,"value":2022},{"type":15,"tag":616,"props":7275,"children":7276},{"style":639},[7277],{"type":21,"value":677},{"type":15,"tag":616,"props":7279,"children":7280},{"style":645},[7281],{"type":21,"value":1881},{"type":15,"tag":616,"props":7283,"children":7284},{"style":639},[7285],{"type":21,"value":603},{"type":15,"tag":616,"props":7287,"children":7288},{"style":645},[7289],{"type":21,"value":760},{"type":15,"tag":616,"props":7291,"children":7292},{"style":733},[7293],{"type":21,"value":736},{"type":15,"tag":616,"props":7295,"children":7296},{"style":645},[7297],{"type":21,"value":769},{"type":15,"tag":616,"props":7299,"children":7300},{"class":618,"line":651},[7301,7305,7309],{"type":15,"tag":616,"props":7302,"children":7303},{"style":645},[7304],{"type":21,"value":1501},{"type":15,"tag":616,"props":7306,"children":7307},{"style":733},[7308],{"type":21,"value":867},{"type":15,"tag":616,"props":7310,"children":7311},{"style":645},[7312],{"type":21,"value":788},{"type":15,"tag":616,"props":7314,"children":7315},{"class":618,"line":685},[7316,7320,7324],{"type":15,"tag":616,"props":7317,"children":7318},{"style":645},[7319],{"type":21,"value":1517},{"type":15,"tag":616,"props":7321,"children":7322},{"style":733},[7323],{"type":21,"value":5383},{"type":15,"tag":616,"props":7325,"children":7326},{"style":645},[7327],{"type":21,"value":1536},{"type":15,"tag":616,"props":7329,"children":7330},{"class":618,"line":695},[7331],{"type":15,"tag":616,"props":7332,"children":7333},{"style":645},[7334],{"type":21,"value":1544},{"type":15,"tag":1570,"props":7336,"children":7338},{"id":7337},"level-1-an-exact-filtered-list",[7339],{"type":21,"value":7340},"Level 1 — An Exact, Filtered List",{"type":15,"tag":477,"props":7342,"children":7344},{"code":7343,"language":609,"meta":7,"className":610,"style":7},"// \"List our fintech clients, headquartered anywhere, with a ticker.\"\ncontext.getKnowledge().query(\"clients\", {\n    entityType: \"company\",\n    where: [\n        { attr: \"industry\", op: \"eq\",     value: \"fintech\" },\n        { attr: \"ticker\",   op: \"exists\" }\n    ],\n    limit: 200\n}).map(function (c) { return c.canonicalName + \" (\" + c.attributes.ticker + \")\"; });\n",[7345],{"type":15,"tag":143,"props":7346,"children":7347},{"__ignoreMap":7},[7348,7356,7387,7402,7409,7440,7464,7472,7485],{"type":15,"tag":616,"props":7349,"children":7350},{"class":618,"line":619},[7351],{"type":15,"tag":616,"props":7352,"children":7353},{"style":623},[7354],{"type":21,"value":7355},"// \"List our fintech clients, headquartered anywhere, with a ticker.\"\n",{"type":15,"tag":616,"props":7357,"children":7358},{"class":618,"line":629},[7359,7363,7367,7371,7375,7379,7383],{"type":15,"tag":616,"props":7360,"children":7361},{"style":645},[7362],{"type":21,"value":2022},{"type":15,"tag":616,"props":7364,"children":7365},{"style":639},[7366],{"type":21,"value":677},{"type":15,"tag":616,"props":7368,"children":7369},{"style":645},[7370],{"type":21,"value":1881},{"type":15,"tag":616,"props":7372,"children":7373},{"style":639},[7374],{"type":21,"value":603},{"type":15,"tag":616,"props":7376,"children":7377},{"style":645},[7378],{"type":21,"value":760},{"type":15,"tag":616,"props":7380,"children":7381},{"style":733},[7382],{"type":21,"value":736},{"type":15,"tag":616,"props":7384,"children":7385},{"style":645},[7386],{"type":21,"value":769},{"type":15,"tag":616,"props":7388,"children":7389},{"class":618,"line":651},[7390,7394,7398],{"type":15,"tag":616,"props":7391,"children":7392},{"style":645},[7393],{"type":21,"value":1501},{"type":15,"tag":616,"props":7395,"children":7396},{"style":733},[7397],{"type":21,"value":867},{"type":15,"tag":616,"props":7399,"children":7400},{"style":645},[7401],{"type":21,"value":788},{"type":15,"tag":616,"props":7403,"children":7404},{"class":618,"line":685},[7405],{"type":15,"tag":616,"props":7406,"children":7407},{"style":645},[7408],{"type":21,"value":4828},{"type":15,"tag":616,"props":7410,"children":7411},{"class":618,"line":695},[7412,7416,7420,7424,7428,7432,7436],{"type":15,"tag":616,"props":7413,"children":7414},{"style":645},[7415],{"type":21,"value":4836},{"type":15,"tag":616,"props":7417,"children":7418},{"style":733},[7419],{"type":21,"value":885},{"type":15,"tag":616,"props":7421,"children":7422},{"style":645},[7423],{"type":21,"value":1172},{"type":15,"tag":616,"props":7425,"children":7426},{"style":733},[7427],{"type":21,"value":1177},{"type":15,"tag":616,"props":7429,"children":7430},{"style":645},[7431],{"type":21,"value":4853},{"type":15,"tag":616,"props":7433,"children":7434},{"style":733},[7435],{"type":21,"value":2941},{"type":15,"tag":616,"props":7437,"children":7438},{"style":645},[7439],{"type":21,"value":4511},{"type":15,"tag":616,"props":7441,"children":7442},{"class":618,"line":704},[7443,7447,7451,7456,7460],{"type":15,"tag":616,"props":7444,"children":7445},{"style":645},[7446],{"type":21,"value":4836},{"type":15,"tag":616,"props":7448,"children":7449},{"style":733},[7450],{"type":21,"value":2099},{"type":15,"tag":616,"props":7452,"children":7453},{"style":645},[7454],{"type":21,"value":7455},",   op: ",{"type":15,"tag":616,"props":7457,"children":7458},{"style":733},[7459],{"type":21,"value":4915},{"type":15,"tag":616,"props":7461,"children":7462},{"style":645},[7463],{"type":21,"value":1536},{"type":15,"tag":616,"props":7465,"children":7466},{"class":618,"line":744},[7467],{"type":15,"tag":616,"props":7468,"children":7469},{"style":645},[7470],{"type":21,"value":7471},"    ],\n",{"type":15,"tag":616,"props":7473,"children":7474},{"class":618,"line":772},[7475,7480],{"type":15,"tag":616,"props":7476,"children":7477},{"style":645},[7478],{"type":21,"value":7479},"    limit: ",{"type":15,"tag":616,"props":7481,"children":7482},{"style":1204},[7483],{"type":21,"value":7484},"200\n",{"type":15,"tag":616,"props":7486,"children":7487},{"class":618,"line":791},[7488,7493,7498,7502,7506,7510,7514,7519,7523,7528,7532,7537,7541,7546,7550,7554],{"type":15,"tag":616,"props":7489,"children":7490},{"style":645},[7491],{"type":21,"value":7492},"}).",{"type":15,"tag":616,"props":7494,"children":7495},{"style":639},[7496],{"type":21,"value":7497},"map",{"type":15,"tag":616,"props":7499,"children":7500},{"style":645},[7501],{"type":21,"value":760},{"type":15,"tag":616,"props":7503,"children":7504},{"style":633},[7505],{"type":21,"value":636},{"type":15,"tag":616,"props":7507,"children":7508},{"style":645},[7509],{"type":21,"value":715},{"type":15,"tag":616,"props":7511,"children":7512},{"style":1245},[7513],{"type":21,"value":1248},{"type":15,"tag":616,"props":7515,"children":7516},{"style":645},[7517],{"type":21,"value":7518},") { ",{"type":15,"tag":616,"props":7520,"children":7521},{"style":633},[7522],{"type":21,"value":1391},{"type":15,"tag":616,"props":7524,"children":7525},{"style":645},[7526],{"type":21,"value":7527}," c.canonicalName ",{"type":15,"tag":616,"props":7529,"children":7530},{"style":633},[7531],{"type":21,"value":1065},{"type":15,"tag":616,"props":7533,"children":7534},{"style":733},[7535],{"type":21,"value":7536}," \" (\"",{"type":15,"tag":616,"props":7538,"children":7539},{"style":633},[7540],{"type":21,"value":1055},{"type":15,"tag":616,"props":7542,"children":7543},{"style":645},[7544],{"type":21,"value":7545}," c.attributes.ticker ",{"type":15,"tag":616,"props":7547,"children":7548},{"style":633},[7549],{"type":21,"value":1065},{"type":15,"tag":616,"props":7551,"children":7552},{"style":733},[7553],{"type":21,"value":1298},{"type":15,"tag":616,"props":7555,"children":7556},{"style":645},[7557],{"type":21,"value":7558},"; });\n",{"type":15,"tag":1570,"props":7560,"children":7562},{"id":7561},"level-2-a-breakdown-for-a-dashboard-widget",[7563],{"type":21,"value":7564},"Level 2 — A Breakdown For A Dashboard Widget",{"type":15,"tag":477,"props":7566,"children":7568},{"code":7567,"language":609,"meta":7,"className":610,"style":7},"// Feed a chart: clients per industry.\nfunction clientsByIndustry() {\n    return context.getKnowledge().query(\"clients\", {\n        entityType: \"company\",\n        aggregate: { op: \"group_by\", attr: \"industry\" }\n    }); // → [{ _id:\"retail\", count:14 }, { _id:\"fintech\", count:9 }, …]\n}\n",[7569],{"type":15,"tag":143,"props":7570,"children":7571},{"__ignoreMap":7},[7572,7580,7596,7631,7646,7670,7683],{"type":15,"tag":616,"props":7573,"children":7574},{"class":618,"line":619},[7575],{"type":15,"tag":616,"props":7576,"children":7577},{"style":623},[7578],{"type":21,"value":7579},"// Feed a chart: clients per industry.\n",{"type":15,"tag":616,"props":7581,"children":7582},{"class":618,"line":629},[7583,7587,7592],{"type":15,"tag":616,"props":7584,"children":7585},{"style":633},[7586],{"type":21,"value":636},{"type":15,"tag":616,"props":7588,"children":7589},{"style":639},[7590],{"type":21,"value":7591}," clientsByIndustry",{"type":15,"tag":616,"props":7593,"children":7594},{"style":645},[7595],{"type":21,"value":648},{"type":15,"tag":616,"props":7597,"children":7598},{"class":618,"line":651},[7599,7603,7607,7611,7615,7619,7623,7627],{"type":15,"tag":616,"props":7600,"children":7601},{"style":633},[7602],{"type":21,"value":6877},{"type":15,"tag":616,"props":7604,"children":7605},{"style":645},[7606],{"type":21,"value":672},{"type":15,"tag":616,"props":7608,"children":7609},{"style":639},[7610],{"type":21,"value":677},{"type":15,"tag":616,"props":7612,"children":7613},{"style":645},[7614],{"type":21,"value":1881},{"type":15,"tag":616,"props":7616,"children":7617},{"style":639},[7618],{"type":21,"value":603},{"type":15,"tag":616,"props":7620,"children":7621},{"style":645},[7622],{"type":21,"value":760},{"type":15,"tag":616,"props":7624,"children":7625},{"style":733},[7626],{"type":21,"value":736},{"type":15,"tag":616,"props":7628,"children":7629},{"style":645},[7630],{"type":21,"value":769},{"type":15,"tag":616,"props":7632,"children":7633},{"class":618,"line":685},[7634,7638,7642],{"type":15,"tag":616,"props":7635,"children":7636},{"style":645},[7637],{"type":21,"value":1146},{"type":15,"tag":616,"props":7639,"children":7640},{"style":733},[7641],{"type":21,"value":867},{"type":15,"tag":616,"props":7643,"children":7644},{"style":645},[7645],{"type":21,"value":788},{"type":15,"tag":616,"props":7647,"children":7648},{"class":618,"line":695},[7649,7654,7658,7662,7666],{"type":15,"tag":616,"props":7650,"children":7651},{"style":645},[7652],{"type":21,"value":7653},"        aggregate: { op: ",{"type":15,"tag":616,"props":7655,"children":7656},{"style":733},[7657],{"type":21,"value":1522},{"type":15,"tag":616,"props":7659,"children":7660},{"style":645},[7661],{"type":21,"value":1527},{"type":15,"tag":616,"props":7663,"children":7664},{"style":733},[7665],{"type":21,"value":885},{"type":15,"tag":616,"props":7667,"children":7668},{"style":645},[7669],{"type":21,"value":1536},{"type":15,"tag":616,"props":7671,"children":7672},{"class":618,"line":704},[7673,7678],{"type":15,"tag":616,"props":7674,"children":7675},{"style":645},[7676],{"type":21,"value":7677},"    }); ",{"type":15,"tag":616,"props":7679,"children":7680},{"style":623},[7681],{"type":21,"value":7682},"// → [{ _id:\"retail\", count:14 }, { _id:\"fintech\", count:9 }, …]\n",{"type":15,"tag":616,"props":7684,"children":7685},{"class":618,"line":744},[7686],{"type":15,"tag":616,"props":7687,"children":7688},{"style":645},[7689],{"type":21,"value":1319},{"type":15,"tag":1570,"props":7691,"children":7693},{"id":7692},"level-3-vocabulary-grounded-query-no-guessing",[7694],{"type":21,"value":7695},"Level 3 — Vocabulary-Grounded Query (No Guessing)",{"type":15,"tag":477,"props":7697,"children":7699},{"code":7698,"language":609,"meta":7,"className":610,"style":7},"// Build a filter dropdown from the values that actually exist,\n// then query the chosen one — always the real literal.\nfunction companiesForIndustryPicker(chosen) {\n    var k = context.getKnowledge();\n    var industries = k.vocabulary(\"clients\", \"company\").industry; // real values\n    if (industries.indexOf(chosen) \u003C 0) return [];                // not in data\n    return k.query(\"clients\", {\n        entityType: \"company\",\n        where: [{ attr: \"industry\", op: \"eq\", value: chosen }]\n    });\n}\n",[7700],{"type":15,"tag":143,"props":7701,"children":7702},{"__ignoreMap":7},[7703,7711,7719,7744,7771,7821,7871,7898,7913,7937,7944],{"type":15,"tag":616,"props":7704,"children":7705},{"class":618,"line":619},[7706],{"type":15,"tag":616,"props":7707,"children":7708},{"style":623},[7709],{"type":21,"value":7710},"// Build a filter dropdown from the values that actually exist,\n",{"type":15,"tag":616,"props":7712,"children":7713},{"class":618,"line":629},[7714],{"type":15,"tag":616,"props":7715,"children":7716},{"style":623},[7717],{"type":21,"value":7718},"// then query the chosen one — always the real literal.\n",{"type":15,"tag":616,"props":7720,"children":7721},{"class":618,"line":651},[7722,7726,7731,7735,7740],{"type":15,"tag":616,"props":7723,"children":7724},{"style":633},[7725],{"type":21,"value":636},{"type":15,"tag":616,"props":7727,"children":7728},{"style":639},[7729],{"type":21,"value":7730}," companiesForIndustryPicker",{"type":15,"tag":616,"props":7732,"children":7733},{"style":645},[7734],{"type":21,"value":760},{"type":15,"tag":616,"props":7736,"children":7737},{"style":1245},[7738],{"type":21,"value":7739},"chosen",{"type":15,"tag":616,"props":7741,"children":7742},{"style":645},[7743],{"type":21,"value":1253},{"type":15,"tag":616,"props":7745,"children":7746},{"class":618,"line":685},[7747,7751,7755,7759,7763,7767],{"type":15,"tag":616,"props":7748,"children":7749},{"style":633},[7750],{"type":21,"value":657},{"type":15,"tag":616,"props":7752,"children":7753},{"style":645},[7754],{"type":21,"value":662},{"type":15,"tag":616,"props":7756,"children":7757},{"style":633},[7758],{"type":21,"value":667},{"type":15,"tag":616,"props":7760,"children":7761},{"style":645},[7762],{"type":21,"value":672},{"type":15,"tag":616,"props":7764,"children":7765},{"style":639},[7766],{"type":21,"value":677},{"type":15,"tag":616,"props":7768,"children":7769},{"style":645},[7770],{"type":21,"value":682},{"type":15,"tag":616,"props":7772,"children":7773},{"class":618,"line":695},[7774,7778,7783,7787,7791,7795,7799,7803,7807,7811,7816],{"type":15,"tag":616,"props":7775,"children":7776},{"style":633},[7777],{"type":21,"value":657},{"type":15,"tag":616,"props":7779,"children":7780},{"style":645},[7781],{"type":21,"value":7782}," industries ",{"type":15,"tag":616,"props":7784,"children":7785},{"style":633},[7786],{"type":21,"value":667},{"type":15,"tag":616,"props":7788,"children":7789},{"style":645},[7790],{"type":21,"value":1010},{"type":15,"tag":616,"props":7792,"children":7793},{"style":639},[7794],{"type":21,"value":5620},{"type":15,"tag":616,"props":7796,"children":7797},{"style":645},[7798],{"type":21,"value":760},{"type":15,"tag":616,"props":7800,"children":7801},{"style":733},[7802],{"type":21,"value":736},{"type":15,"tag":616,"props":7804,"children":7805},{"style":645},[7806],{"type":21,"value":76},{"type":15,"tag":616,"props":7808,"children":7809},{"style":733},[7810],{"type":21,"value":867},{"type":15,"tag":616,"props":7812,"children":7813},{"style":645},[7814],{"type":21,"value":7815},").industry; ",{"type":15,"tag":616,"props":7817,"children":7818},{"style":623},[7819],{"type":21,"value":7820},"// real values\n",{"type":15,"tag":616,"props":7822,"children":7823},{"class":618,"line":704},[7824,7828,7833,7838,7843,7848,7853,7857,7861,7866],{"type":15,"tag":616,"props":7825,"children":7826},{"style":633},[7827],{"type":21,"value":710},{"type":15,"tag":616,"props":7829,"children":7830},{"style":645},[7831],{"type":21,"value":7832}," (industries.",{"type":15,"tag":616,"props":7834,"children":7835},{"style":639},[7836],{"type":21,"value":7837},"indexOf",{"type":15,"tag":616,"props":7839,"children":7840},{"style":645},[7841],{"type":21,"value":7842},"(chosen) ",{"type":15,"tag":616,"props":7844,"children":7845},{"style":633},[7846],{"type":21,"value":7847},"\u003C",{"type":15,"tag":616,"props":7849,"children":7850},{"style":1204},[7851],{"type":21,"value":7852}," 0",{"type":15,"tag":616,"props":7854,"children":7855},{"style":645},[7856],{"type":21,"value":3375},{"type":15,"tag":616,"props":7858,"children":7859},{"style":633},[7860],{"type":21,"value":1391},{"type":15,"tag":616,"props":7862,"children":7863},{"style":645},[7864],{"type":21,"value":7865}," [];                ",{"type":15,"tag":616,"props":7867,"children":7868},{"style":623},[7869],{"type":21,"value":7870},"// not in data\n",{"type":15,"tag":616,"props":7872,"children":7873},{"class":618,"line":744},[7874,7878,7882,7886,7890,7894],{"type":15,"tag":616,"props":7875,"children":7876},{"style":633},[7877],{"type":21,"value":6877},{"type":15,"tag":616,"props":7879,"children":7880},{"style":645},[7881],{"type":21,"value":1010},{"type":15,"tag":616,"props":7883,"children":7884},{"style":639},[7885],{"type":21,"value":603},{"type":15,"tag":616,"props":7887,"children":7888},{"style":645},[7889],{"type":21,"value":760},{"type":15,"tag":616,"props":7891,"children":7892},{"style":733},[7893],{"type":21,"value":736},{"type":15,"tag":616,"props":7895,"children":7896},{"style":645},[7897],{"type":21,"value":769},{"type":15,"tag":616,"props":7899,"children":7900},{"class":618,"line":772},[7901,7905,7909],{"type":15,"tag":616,"props":7902,"children":7903},{"style":645},[7904],{"type":21,"value":1146},{"type":15,"tag":616,"props":7906,"children":7907},{"style":733},[7908],{"type":21,"value":867},{"type":15,"tag":616,"props":7910,"children":7911},{"style":645},[7912],{"type":21,"value":788},{"type":15,"tag":616,"props":7914,"children":7915},{"class":618,"line":791},[7916,7920,7924,7928,7932],{"type":15,"tag":616,"props":7917,"children":7918},{"style":645},[7919],{"type":21,"value":1163},{"type":15,"tag":616,"props":7921,"children":7922},{"style":733},[7923],{"type":21,"value":885},{"type":15,"tag":616,"props":7925,"children":7926},{"style":645},[7927],{"type":21,"value":1172},{"type":15,"tag":616,"props":7929,"children":7930},{"style":733},[7931],{"type":21,"value":1177},{"type":15,"tag":616,"props":7933,"children":7934},{"style":645},[7935],{"type":21,"value":7936},", value: chosen }]\n",{"type":15,"tag":616,"props":7938,"children":7939},{"class":618,"line":805},[7940],{"type":15,"tag":616,"props":7941,"children":7942},{"style":645},[7943],{"type":21,"value":1216},{"type":15,"tag":616,"props":7945,"children":7946},{"class":618,"line":814},[7947],{"type":15,"tag":616,"props":7948,"children":7949},{"style":645},[7950],{"type":21,"value":1319},{"type":15,"tag":1570,"props":7952,"children":7954},{"id":7953},"level-4-a-relational-two-hop-question",[7955],{"type":21,"value":7956},"Level 4 — A Relational, Two-Hop Question",{"type":15,"tag":477,"props":7958,"children":7960},{"code":7959,"language":609,"meta":7,"className":610,"style":7},"// \"Who has worked on a project for a retail client?\"\n// person --worked_on--> project --client_of--> retail company\nfunction peopleOnRetailEngagements() {\n    return context.getKnowledge().query(\"clients\", {\n        entityType: \"person\",\n        traverse: [\n            { relType: \"worked_on\", direction: \"out\", as: \"projects\" },\n            { relType: \"client_of\", direction: \"out\", as: \"clients\"  }\n        ],\n        limit: 100\n    });\n}\n",[7961],{"type":15,"tag":143,"props":7962,"children":7963},{"__ignoreMap":7},[7964,7972,7980,7996,8031,8046,8054,8086,8117,8125,8136,8143],{"type":15,"tag":616,"props":7965,"children":7966},{"class":618,"line":619},[7967],{"type":15,"tag":616,"props":7968,"children":7969},{"style":623},[7970],{"type":21,"value":7971},"// \"Who has worked on a project for a retail client?\"\n",{"type":15,"tag":616,"props":7973,"children":7974},{"class":618,"line":629},[7975],{"type":15,"tag":616,"props":7976,"children":7977},{"style":623},[7978],{"type":21,"value":7979},"// person --worked_on--> project --client_of--> retail company\n",{"type":15,"tag":616,"props":7981,"children":7982},{"class":618,"line":651},[7983,7987,7992],{"type":15,"tag":616,"props":7984,"children":7985},{"style":633},[7986],{"type":21,"value":636},{"type":15,"tag":616,"props":7988,"children":7989},{"style":639},[7990],{"type":21,"value":7991}," peopleOnRetailEngagements",{"type":15,"tag":616,"props":7993,"children":7994},{"style":645},[7995],{"type":21,"value":648},{"type":15,"tag":616,"props":7997,"children":7998},{"class":618,"line":685},[7999,8003,8007,8011,8015,8019,8023,8027],{"type":15,"tag":616,"props":8000,"children":8001},{"style":633},[8002],{"type":21,"value":6877},{"type":15,"tag":616,"props":8004,"children":8005},{"style":645},[8006],{"type":21,"value":672},{"type":15,"tag":616,"props":8008,"children":8009},{"style":639},[8010],{"type":21,"value":677},{"type":15,"tag":616,"props":8012,"children":8013},{"style":645},[8014],{"type":21,"value":1881},{"type":15,"tag":616,"props":8016,"children":8017},{"style":639},[8018],{"type":21,"value":603},{"type":15,"tag":616,"props":8020,"children":8021},{"style":645},[8022],{"type":21,"value":760},{"type":15,"tag":616,"props":8024,"children":8025},{"style":733},[8026],{"type":21,"value":736},{"type":15,"tag":616,"props":8028,"children":8029},{"style":645},[8030],{"type":21,"value":769},{"type":15,"tag":616,"props":8032,"children":8033},{"class":618,"line":695},[8034,8038,8042],{"type":15,"tag":616,"props":8035,"children":8036},{"style":645},[8037],{"type":21,"value":1146},{"type":15,"tag":616,"props":8039,"children":8040},{"style":733},[8041],{"type":21,"value":2277},{"type":15,"tag":616,"props":8043,"children":8044},{"style":645},[8045],{"type":21,"value":788},{"type":15,"tag":616,"props":8047,"children":8048},{"class":618,"line":704},[8049],{"type":15,"tag":616,"props":8050,"children":8051},{"style":645},[8052],{"type":21,"value":8053},"        traverse: [\n",{"type":15,"tag":616,"props":8055,"children":8056},{"class":618,"line":744},[8057,8062,8066,8070,8074,8078,8082],{"type":15,"tag":616,"props":8058,"children":8059},{"style":645},[8060],{"type":21,"value":8061},"            { relType: ",{"type":15,"tag":616,"props":8063,"children":8064},{"style":733},[8065],{"type":21,"value":2645},{"type":15,"tag":616,"props":8067,"children":8068},{"style":645},[8069],{"type":21,"value":5888},{"type":15,"tag":616,"props":8071,"children":8072},{"style":733},[8073],{"type":21,"value":5893},{"type":15,"tag":616,"props":8075,"children":8076},{"style":645},[8077],{"type":21,"value":5898},{"type":15,"tag":616,"props":8079,"children":8080},{"style":733},[8081],{"type":21,"value":5903},{"type":15,"tag":616,"props":8083,"children":8084},{"style":645},[8085],{"type":21,"value":4511},{"type":15,"tag":616,"props":8087,"children":8088},{"class":618,"line":772},[8089,8093,8097,8101,8105,8109,8113],{"type":15,"tag":616,"props":8090,"children":8091},{"style":645},[8092],{"type":21,"value":8061},{"type":15,"tag":616,"props":8094,"children":8095},{"style":733},[8096],{"type":21,"value":2722},{"type":15,"tag":616,"props":8098,"children":8099},{"style":645},[8100],{"type":21,"value":5888},{"type":15,"tag":616,"props":8102,"children":8103},{"style":733},[8104],{"type":21,"value":5893},{"type":15,"tag":616,"props":8106,"children":8107},{"style":645},[8108],{"type":21,"value":5898},{"type":15,"tag":616,"props":8110,"children":8111},{"style":733},[8112],{"type":21,"value":736},{"type":15,"tag":616,"props":8114,"children":8115},{"style":645},[8116],{"type":21,"value":5939},{"type":15,"tag":616,"props":8118,"children":8119},{"class":618,"line":791},[8120],{"type":15,"tag":616,"props":8121,"children":8122},{"style":645},[8123],{"type":21,"value":8124},"        ],\n",{"type":15,"tag":616,"props":8126,"children":8127},{"class":618,"line":805},[8128,8132],{"type":15,"tag":616,"props":8129,"children":8130},{"style":645},[8131],{"type":21,"value":1201},{"type":15,"tag":616,"props":8133,"children":8134},{"style":1204},[8135],{"type":21,"value":1207},{"type":15,"tag":616,"props":8137,"children":8138},{"class":618,"line":814},[8139],{"type":15,"tag":616,"props":8140,"children":8141},{"style":645},[8142],{"type":21,"value":1216},{"type":15,"tag":616,"props":8144,"children":8145},{"class":618,"line":822},[8146],{"type":15,"tag":616,"props":8147,"children":8148},{"style":645},[8149],{"type":21,"value":1319},{"type":15,"tag":1570,"props":8151,"children":8153},{"id":8152},"level-5-a-self-driving-knowledge-agent",[8154],{"type":21,"value":8155},"Level 5 — A Self-Driving Knowledge Agent",{"type":15,"tag":24,"props":8157,"children":8158},{},[8159],{"type":21,"value":8160},"Wire both tools into an agent and let it handle arbitrary\nexact/relational questions over the corpus. The agent definition:",{"type":15,"tag":477,"props":8162,"children":8164},{"code":8163,"language":6451,"meta":7,"className":6452,"style":7},"{\n  \"name\": \"corpusAnalyst\",\n  \"system\": \"You answer questions about the firm's client corpus. \" +\n            \"For EXACT or RELATIONAL questions (list all, count, who \" +\n            \"worked with whom) use the knowledge tools: first call \" +\n            \"discoverValues to learn the real attribute values, then \" +\n            \"queryKnowledge. For OPEN-ENDED or EXAMPLE questions use \" +\n            \"the search tool. Never invent attribute values; discover \" +\n            \"them. Always pass datasetId 'clients'.\",\n  \"tools\": [\n    { \"type\": \"knowledgeVocabulary\", \"name\": \"discoverValues\"  },\n    { \"type\": \"knowledgeQuery\",      \"name\": \"queryKnowledge\"  },\n    { \"type\": \"search\",              \"name\": \"searchDocuments\" }\n  ]\n}\n",[8165],{"type":15,"tag":143,"props":8166,"children":8167},{"__ignoreMap":7},[8168,8175,8196,8218,8230,8242,8254,8266,8278,8290,8301,8341,8380,8422,8429],{"type":15,"tag":616,"props":8169,"children":8170},{"class":618,"line":619},[8171],{"type":15,"tag":616,"props":8172,"children":8173},{"style":645},[8174],{"type":21,"value":6464},{"type":15,"tag":616,"props":8176,"children":8177},{"class":618,"line":629},[8178,8183,8187,8192],{"type":15,"tag":616,"props":8179,"children":8180},{"style":1204},[8181],{"type":21,"value":8182},"  \"name\"",{"type":15,"tag":616,"props":8184,"children":8185},{"style":645},[8186],{"type":21,"value":6495},{"type":15,"tag":616,"props":8188,"children":8189},{"style":733},[8190],{"type":21,"value":8191},"\"corpusAnalyst\"",{"type":15,"tag":616,"props":8193,"children":8194},{"style":645},[8195],{"type":21,"value":788},{"type":15,"tag":616,"props":8197,"children":8198},{"class":618,"line":651},[8199,8204,8208,8213],{"type":15,"tag":616,"props":8200,"children":8201},{"style":1204},[8202],{"type":21,"value":8203},"  \"system\"",{"type":15,"tag":616,"props":8205,"children":8206},{"style":645},[8207],{"type":21,"value":6495},{"type":15,"tag":616,"props":8209,"children":8210},{"style":733},[8211],{"type":21,"value":8212},"\"You answer questions about the firm's client corpus. \"",{"type":15,"tag":616,"props":8214,"children":8216},{"style":8215},"--shiki-default:#B31D28;--shiki-default-font-style:italic;--shiki-dark:#FDAEB7;--shiki-dark-font-style:italic",[8217],{"type":21,"value":2121},{"type":15,"tag":616,"props":8219,"children":8220},{"class":618,"line":685},[8221,8226],{"type":15,"tag":616,"props":8222,"children":8223},{"style":733},[8224],{"type":21,"value":8225},"            \"For EXACT or RELATIONAL questions (list all, count, who \"",{"type":15,"tag":616,"props":8227,"children":8228},{"style":8215},[8229],{"type":21,"value":2121},{"type":15,"tag":616,"props":8231,"children":8232},{"class":618,"line":695},[8233,8238],{"type":15,"tag":616,"props":8234,"children":8235},{"style":733},[8236],{"type":21,"value":8237},"            \"worked with whom) use the knowledge tools: first call \"",{"type":15,"tag":616,"props":8239,"children":8240},{"style":8215},[8241],{"type":21,"value":2121},{"type":15,"tag":616,"props":8243,"children":8244},{"class":618,"line":704},[8245,8250],{"type":15,"tag":616,"props":8246,"children":8247},{"style":733},[8248],{"type":21,"value":8249},"            \"discoverValues to learn the real attribute values, then \"",{"type":15,"tag":616,"props":8251,"children":8252},{"style":8215},[8253],{"type":21,"value":2121},{"type":15,"tag":616,"props":8255,"children":8256},{"class":618,"line":744},[8257,8262],{"type":15,"tag":616,"props":8258,"children":8259},{"style":733},[8260],{"type":21,"value":8261},"            \"queryKnowledge. For OPEN-ENDED or EXAMPLE questions use \"",{"type":15,"tag":616,"props":8263,"children":8264},{"style":8215},[8265],{"type":21,"value":2121},{"type":15,"tag":616,"props":8267,"children":8268},{"class":618,"line":772},[8269,8274],{"type":15,"tag":616,"props":8270,"children":8271},{"style":733},[8272],{"type":21,"value":8273},"            \"the search tool. Never invent attribute values; discover \"",{"type":15,"tag":616,"props":8275,"children":8276},{"style":8215},[8277],{"type":21,"value":2121},{"type":15,"tag":616,"props":8279,"children":8280},{"class":618,"line":791},[8281,8286],{"type":15,"tag":616,"props":8282,"children":8283},{"style":733},[8284],{"type":21,"value":8285},"            \"them. Always pass datasetId 'clients'.\"",{"type":15,"tag":616,"props":8287,"children":8288},{"style":645},[8289],{"type":21,"value":788},{"type":15,"tag":616,"props":8291,"children":8292},{"class":618,"line":805},[8293,8297],{"type":15,"tag":616,"props":8294,"children":8295},{"style":1204},[8296],{"type":21,"value":6472},{"type":15,"tag":616,"props":8298,"children":8299},{"style":645},[8300],{"type":21,"value":6477},{"type":15,"tag":616,"props":8302,"children":8303},{"class":618,"line":814},[8304,8308,8312,8316,8320,8324,8328,8332,8336],{"type":15,"tag":616,"props":8305,"children":8306},{"style":645},[8307],{"type":21,"value":6485},{"type":15,"tag":616,"props":8309,"children":8310},{"style":1204},[8311],{"type":21,"value":6490},{"type":15,"tag":616,"props":8313,"children":8314},{"style":645},[8315],{"type":21,"value":6495},{"type":15,"tag":616,"props":8317,"children":8318},{"style":733},[8319],{"type":21,"value":6500},{"type":15,"tag":616,"props":8321,"children":8322},{"style":645},[8323],{"type":21,"value":76},{"type":15,"tag":616,"props":8325,"children":8326},{"style":1204},[8327],{"type":21,"value":6051},{"type":15,"tag":616,"props":8329,"children":8330},{"style":645},[8331],{"type":21,"value":6495},{"type":15,"tag":616,"props":8333,"children":8334},{"style":733},[8335],{"type":21,"value":6517},{"type":15,"tag":616,"props":8337,"children":8338},{"style":645},[8339],{"type":21,"value":8340},"  },\n",{"type":15,"tag":616,"props":8342,"children":8343},{"class":618,"line":822},[8344,8348,8352,8356,8360,8364,8368,8372,8376],{"type":15,"tag":616,"props":8345,"children":8346},{"style":645},[8347],{"type":21,"value":6485},{"type":15,"tag":616,"props":8349,"children":8350},{"style":1204},[8351],{"type":21,"value":6490},{"type":15,"tag":616,"props":8353,"children":8354},{"style":645},[8355],{"type":21,"value":6495},{"type":15,"tag":616,"props":8357,"children":8358},{"style":733},[8359],{"type":21,"value":6541},{"type":15,"tag":616,"props":8361,"children":8362},{"style":645},[8363],{"type":21,"value":6263},{"type":15,"tag":616,"props":8365,"children":8366},{"style":1204},[8367],{"type":21,"value":6051},{"type":15,"tag":616,"props":8369,"children":8370},{"style":645},[8371],{"type":21,"value":6495},{"type":15,"tag":616,"props":8373,"children":8374},{"style":733},[8375],{"type":21,"value":6558},{"type":15,"tag":616,"props":8377,"children":8378},{"style":645},[8379],{"type":21,"value":8340},{"type":15,"tag":616,"props":8381,"children":8382},{"class":618,"line":831},[8383,8387,8391,8395,8400,8405,8409,8413,8418],{"type":15,"tag":616,"props":8384,"children":8385},{"style":645},[8386],{"type":21,"value":6485},{"type":15,"tag":616,"props":8388,"children":8389},{"style":1204},[8390],{"type":21,"value":6490},{"type":15,"tag":616,"props":8392,"children":8393},{"style":645},[8394],{"type":21,"value":6495},{"type":15,"tag":616,"props":8396,"children":8397},{"style":733},[8398],{"type":21,"value":8399},"\"search\"",{"type":15,"tag":616,"props":8401,"children":8402},{"style":645},[8403],{"type":21,"value":8404},",              ",{"type":15,"tag":616,"props":8406,"children":8407},{"style":1204},[8408],{"type":21,"value":6051},{"type":15,"tag":616,"props":8410,"children":8411},{"style":645},[8412],{"type":21,"value":6495},{"type":15,"tag":616,"props":8414,"children":8415},{"style":733},[8416],{"type":21,"value":8417},"\"searchDocuments\"",{"type":15,"tag":616,"props":8419,"children":8420},{"style":645},[8421],{"type":21,"value":1536},{"type":15,"tag":616,"props":8423,"children":8424},{"class":618,"line":856},[8425],{"type":15,"tag":616,"props":8426,"children":8427},{"style":645},[8428],{"type":21,"value":6570},{"type":15,"tag":616,"props":8430,"children":8431},{"class":618,"line":874},[8432],{"type":15,"tag":616,"props":8433,"children":8434},{"style":645},[8435],{"type":21,"value":1319},{"type":15,"tag":24,"props":8437,"children":8438},{},[8439],{"type":21,"value":8440},"Invoke it from an Action and the agent does discover → query →\nanswer on its own, access-filtered to the calling user:",{"type":15,"tag":477,"props":8442,"children":8444},{"code":8443,"language":609,"meta":7,"className":610,"style":7},"function askAnalyst(arguments) {\n    return context.getAIFunctions().invokeAgent(\"corpusAnalyst\", {\n        arguments: { userMessage: arguments.question }\n    });\n}\n",[8445],{"type":15,"tag":143,"props":8446,"children":8447},{"__ignoreMap":7},[8448,8473,8510,8527,8534],{"type":15,"tag":616,"props":8449,"children":8450},{"class":618,"line":619},[8451,8455,8460,8464,8469],{"type":15,"tag":616,"props":8452,"children":8453},{"style":633},[8454],{"type":21,"value":636},{"type":15,"tag":616,"props":8456,"children":8457},{"style":639},[8458],{"type":21,"value":8459}," askAnalyst",{"type":15,"tag":616,"props":8461,"children":8462},{"style":645},[8463],{"type":21,"value":760},{"type":15,"tag":616,"props":8465,"children":8466},{"style":1245},[8467],{"type":21,"value":8468},"arguments",{"type":15,"tag":616,"props":8470,"children":8471},{"style":645},[8472],{"type":21,"value":1253},{"type":15,"tag":616,"props":8474,"children":8475},{"class":618,"line":629},[8476,8480,8484,8489,8493,8498,8502,8506],{"type":15,"tag":616,"props":8477,"children":8478},{"style":633},[8479],{"type":21,"value":6877},{"type":15,"tag":616,"props":8481,"children":8482},{"style":645},[8483],{"type":21,"value":672},{"type":15,"tag":616,"props":8485,"children":8486},{"style":639},[8487],{"type":21,"value":8488},"getAIFunctions",{"type":15,"tag":616,"props":8490,"children":8491},{"style":645},[8492],{"type":21,"value":1881},{"type":15,"tag":616,"props":8494,"children":8495},{"style":639},[8496],{"type":21,"value":8497},"invokeAgent",{"type":15,"tag":616,"props":8499,"children":8500},{"style":645},[8501],{"type":21,"value":760},{"type":15,"tag":616,"props":8503,"children":8504},{"style":733},[8505],{"type":21,"value":8191},{"type":15,"tag":616,"props":8507,"children":8508},{"style":645},[8509],{"type":21,"value":769},{"type":15,"tag":616,"props":8511,"children":8512},{"class":618,"line":651},[8513,8518,8522],{"type":15,"tag":616,"props":8514,"children":8515},{"style":645},[8516],{"type":21,"value":8517},"        arguments: { userMessage: ",{"type":15,"tag":616,"props":8519,"children":8520},{"style":1204},[8521],{"type":21,"value":8468},{"type":15,"tag":616,"props":8523,"children":8524},{"style":645},[8525],{"type":21,"value":8526},".question }\n",{"type":15,"tag":616,"props":8528,"children":8529},{"class":618,"line":685},[8530],{"type":15,"tag":616,"props":8531,"children":8532},{"style":645},[8533],{"type":21,"value":1216},{"type":15,"tag":616,"props":8535,"children":8536},{"class":618,"line":695},[8537],{"type":15,"tag":616,"props":8538,"children":8539},{"style":645},[8540],{"type":21,"value":1319},{"type":15,"tag":1570,"props":8542,"children":8544},{"id":8543},"level-6-a-governed-ingestion-pipeline",[8545],{"type":21,"value":8546},"Level 6 — A Governed Ingestion Pipeline",{"type":15,"tag":24,"props":8548,"children":8549},{},[8550],{"type":21,"value":8551},"Preview-driven tuning, controlled rollout, and monitoring,\ncombined into an admin Action:",{"type":15,"tag":477,"props":8553,"children":8555},{"code":8554,"language":609,"meta":7,"className":610,"style":7},"function ingestClients(arguments) {\n    var k = context.getKnowledge();\n\n    // 1. Tune against a sample before committing the corpus.\n    if (arguments.sampleDocId) {\n        var p = k.preview(\"clients\", arguments.sampleDocId);\n        var merges = p.entities.filter(function (e) { return e.action === \"MERGE\"; });\n        var reviews = p.entities.filter(function (e) { return e.action === \"REVIEW\"; });\n        context.log(\"preview: \" + p.entities.length + \" entities, \" +\n                    merges.length + \" merges, \" + reviews.length + \" to review\");\n        if (arguments.previewOnly) return p; // human checks before go-live\n    }\n\n    // 2. Backfill in bounded passes (loop until jobSummary stabilises).\n    var enq = k.backfill(\"clients\");\n\n    // 3. Report health.\n    var s = k.jobSummary(\"clients\");\n    var failures = k.listJobs(\"clients\", \"FAILED\", 10);\n    return { enqueued: enq.enqueued, summary: s, recentFailures: failures };\n}\n",[8556],{"type":15,"tag":143,"props":8557,"children":8558},{"__ignoreMap":7},[8559,8583,8610,8617,8625,8645,8690,8758,8823,8869,8916,8951,8958,8965,8973,9008,9015,9023,9058,9111,9123],{"type":15,"tag":616,"props":8560,"children":8561},{"class":618,"line":619},[8562,8566,8571,8575,8579],{"type":15,"tag":616,"props":8563,"children":8564},{"style":633},[8565],{"type":21,"value":636},{"type":15,"tag":616,"props":8567,"children":8568},{"style":639},[8569],{"type":21,"value":8570}," ingestClients",{"type":15,"tag":616,"props":8572,"children":8573},{"style":645},[8574],{"type":21,"value":760},{"type":15,"tag":616,"props":8576,"children":8577},{"style":1245},[8578],{"type":21,"value":8468},{"type":15,"tag":616,"props":8580,"children":8581},{"style":645},[8582],{"type":21,"value":1253},{"type":15,"tag":616,"props":8584,"children":8585},{"class":618,"line":629},[8586,8590,8594,8598,8602,8606],{"type":15,"tag":616,"props":8587,"children":8588},{"style":633},[8589],{"type":21,"value":657},{"type":15,"tag":616,"props":8591,"children":8592},{"style":645},[8593],{"type":21,"value":662},{"type":15,"tag":616,"props":8595,"children":8596},{"style":633},[8597],{"type":21,"value":667},{"type":15,"tag":616,"props":8599,"children":8600},{"style":645},[8601],{"type":21,"value":672},{"type":15,"tag":616,"props":8603,"children":8604},{"style":639},[8605],{"type":21,"value":677},{"type":15,"tag":616,"props":8607,"children":8608},{"style":645},[8609],{"type":21,"value":682},{"type":15,"tag":616,"props":8611,"children":8612},{"class":618,"line":651},[8613],{"type":15,"tag":616,"props":8614,"children":8615},{"emptyLinePlaceholder":689},[8616],{"type":21,"value":692},{"type":15,"tag":616,"props":8618,"children":8619},{"class":618,"line":685},[8620],{"type":15,"tag":616,"props":8621,"children":8622},{"style":623},[8623],{"type":21,"value":8624},"    // 1. Tune against a sample before committing the corpus.\n",{"type":15,"tag":616,"props":8626,"children":8627},{"class":618,"line":695},[8628,8632,8636,8640],{"type":15,"tag":616,"props":8629,"children":8630},{"style":633},[8631],{"type":21,"value":710},{"type":15,"tag":616,"props":8633,"children":8634},{"style":645},[8635],{"type":21,"value":715},{"type":15,"tag":616,"props":8637,"children":8638},{"style":1204},[8639],{"type":21,"value":8468},{"type":15,"tag":616,"props":8641,"children":8642},{"style":645},[8643],{"type":21,"value":8644},".sampleDocId) {\n",{"type":15,"tag":616,"props":8646,"children":8647},{"class":618,"line":704},[8648,8653,8657,8661,8665,8669,8673,8677,8681,8685],{"type":15,"tag":616,"props":8649,"children":8650},{"style":633},[8651],{"type":21,"value":8652},"        var",{"type":15,"tag":616,"props":8654,"children":8655},{"style":645},[8656],{"type":21,"value":3177},{"type":15,"tag":616,"props":8658,"children":8659},{"style":633},[8660],{"type":21,"value":667},{"type":15,"tag":616,"props":8662,"children":8663},{"style":645},[8664],{"type":21,"value":1010},{"type":15,"tag":616,"props":8666,"children":8667},{"style":639},[8668],{"type":21,"value":3116},{"type":15,"tag":616,"props":8670,"children":8671},{"style":645},[8672],{"type":21,"value":760},{"type":15,"tag":616,"props":8674,"children":8675},{"style":733},[8676],{"type":21,"value":736},{"type":15,"tag":616,"props":8678,"children":8679},{"style":645},[8680],{"type":21,"value":76},{"type":15,"tag":616,"props":8682,"children":8683},{"style":1204},[8684],{"type":21,"value":8468},{"type":15,"tag":616,"props":8686,"children":8687},{"style":645},[8688],{"type":21,"value":8689},".sampleDocId);\n",{"type":15,"tag":616,"props":8691,"children":8692},{"class":618,"line":744},[8693,8697,8702,8706,8711,8716,8720,8724,8728,8732,8736,8740,8744,8749,8754],{"type":15,"tag":616,"props":8694,"children":8695},{"style":633},[8696],{"type":21,"value":8652},{"type":15,"tag":616,"props":8698,"children":8699},{"style":645},[8700],{"type":21,"value":8701}," merges ",{"type":15,"tag":616,"props":8703,"children":8704},{"style":633},[8705],{"type":21,"value":667},{"type":15,"tag":616,"props":8707,"children":8708},{"style":645},[8709],{"type":21,"value":8710}," p.entities.",{"type":15,"tag":616,"props":8712,"children":8713},{"style":639},[8714],{"type":21,"value":8715},"filter",{"type":15,"tag":616,"props":8717,"children":8718},{"style":645},[8719],{"type":21,"value":760},{"type":15,"tag":616,"props":8721,"children":8722},{"style":633},[8723],{"type":21,"value":636},{"type":15,"tag":616,"props":8725,"children":8726},{"style":645},[8727],{"type":21,"value":715},{"type":15,"tag":616,"props":8729,"children":8730},{"style":1245},[8731],{"type":21,"value":3254},{"type":15,"tag":616,"props":8733,"children":8734},{"style":645},[8735],{"type":21,"value":7518},{"type":15,"tag":616,"props":8737,"children":8738},{"style":633},[8739],{"type":21,"value":1391},{"type":15,"tag":616,"props":8741,"children":8742},{"style":645},[8743],{"type":21,"value":3330},{"type":15,"tag":616,"props":8745,"children":8746},{"style":633},[8747],{"type":21,"value":8748},"===",{"type":15,"tag":616,"props":8750,"children":8751},{"style":733},[8752],{"type":21,"value":8753}," \"MERGE\"",{"type":15,"tag":616,"props":8755,"children":8756},{"style":645},[8757],{"type":21,"value":7558},{"type":15,"tag":616,"props":8759,"children":8760},{"class":618,"line":772},[8761,8765,8770,8774,8778,8782,8786,8790,8794,8798,8802,8806,8810,8814,8819],{"type":15,"tag":616,"props":8762,"children":8763},{"style":633},[8764],{"type":21,"value":8652},{"type":15,"tag":616,"props":8766,"children":8767},{"style":645},[8768],{"type":21,"value":8769}," reviews ",{"type":15,"tag":616,"props":8771,"children":8772},{"style":633},[8773],{"type":21,"value":667},{"type":15,"tag":616,"props":8775,"children":8776},{"style":645},[8777],{"type":21,"value":8710},{"type":15,"tag":616,"props":8779,"children":8780},{"style":639},[8781],{"type":21,"value":8715},{"type":15,"tag":616,"props":8783,"children":8784},{"style":645},[8785],{"type":21,"value":760},{"type":15,"tag":616,"props":8787,"children":8788},{"style":633},[8789],{"type":21,"value":636},{"type":15,"tag":616,"props":8791,"children":8792},{"style":645},[8793],{"type":21,"value":715},{"type":15,"tag":616,"props":8795,"children":8796},{"style":1245},[8797],{"type":21,"value":3254},{"type":15,"tag":616,"props":8799,"children":8800},{"style":645},[8801],{"type":21,"value":7518},{"type":15,"tag":616,"props":8803,"children":8804},{"style":633},[8805],{"type":21,"value":1391},{"type":15,"tag":616,"props":8807,"children":8808},{"style":645},[8809],{"type":21,"value":3330},{"type":15,"tag":616,"props":8811,"children":8812},{"style":633},[8813],{"type":21,"value":8748},{"type":15,"tag":616,"props":8815,"children":8816},{"style":733},[8817],{"type":21,"value":8818}," \"REVIEW\"",{"type":15,"tag":616,"props":8820,"children":8821},{"style":645},[8822],{"type":21,"value":7558},{"type":15,"tag":616,"props":8824,"children":8825},{"class":618,"line":791},[8826,8830,8834,8838,8843,8847,8851,8856,8860,8865],{"type":15,"tag":616,"props":8827,"children":8828},{"style":645},[8829],{"type":21,"value":1262},{"type":15,"tag":616,"props":8831,"children":8832},{"style":639},[8833],{"type":21,"value":1041},{"type":15,"tag":616,"props":8835,"children":8836},{"style":645},[8837],{"type":21,"value":760},{"type":15,"tag":616,"props":8839,"children":8840},{"style":733},[8841],{"type":21,"value":8842},"\"preview: \"",{"type":15,"tag":616,"props":8844,"children":8845},{"style":633},[8846],{"type":21,"value":1055},{"type":15,"tag":616,"props":8848,"children":8849},{"style":645},[8850],{"type":21,"value":8710},{"type":15,"tag":616,"props":8852,"children":8853},{"style":1204},[8854],{"type":21,"value":8855},"length",{"type":15,"tag":616,"props":8857,"children":8858},{"style":633},[8859],{"type":21,"value":1055},{"type":15,"tag":616,"props":8861,"children":8862},{"style":733},[8863],{"type":21,"value":8864}," \" entities, \"",{"type":15,"tag":616,"props":8866,"children":8867},{"style":633},[8868],{"type":21,"value":2121},{"type":15,"tag":616,"props":8870,"children":8871},{"class":618,"line":805},[8872,8877,8881,8885,8890,8894,8899,8903,8907,8912],{"type":15,"tag":616,"props":8873,"children":8874},{"style":645},[8875],{"type":21,"value":8876},"                    merges.",{"type":15,"tag":616,"props":8878,"children":8879},{"style":1204},[8880],{"type":21,"value":8855},{"type":15,"tag":616,"props":8882,"children":8883},{"style":633},[8884],{"type":21,"value":1055},{"type":15,"tag":616,"props":8886,"children":8887},{"style":733},[8888],{"type":21,"value":8889}," \" merges, \"",{"type":15,"tag":616,"props":8891,"children":8892},{"style":633},[8893],{"type":21,"value":1055},{"type":15,"tag":616,"props":8895,"children":8896},{"style":645},[8897],{"type":21,"value":8898}," reviews.",{"type":15,"tag":616,"props":8900,"children":8901},{"style":1204},[8902],{"type":21,"value":8855},{"type":15,"tag":616,"props":8904,"children":8905},{"style":633},[8906],{"type":21,"value":1055},{"type":15,"tag":616,"props":8908,"children":8909},{"style":733},[8910],{"type":21,"value":8911}," \" to review\"",{"type":15,"tag":616,"props":8913,"children":8914},{"style":645},[8915],{"type":21,"value":1027},{"type":15,"tag":616,"props":8917,"children":8918},{"class":618,"line":814},[8919,8924,8928,8932,8937,8941,8946],{"type":15,"tag":616,"props":8920,"children":8921},{"style":633},[8922],{"type":21,"value":8923},"        if",{"type":15,"tag":616,"props":8925,"children":8926},{"style":645},[8927],{"type":21,"value":715},{"type":15,"tag":616,"props":8929,"children":8930},{"style":1204},[8931],{"type":21,"value":8468},{"type":15,"tag":616,"props":8933,"children":8934},{"style":645},[8935],{"type":21,"value":8936},".previewOnly) ",{"type":15,"tag":616,"props":8938,"children":8939},{"style":633},[8940],{"type":21,"value":1391},{"type":15,"tag":616,"props":8942,"children":8943},{"style":645},[8944],{"type":21,"value":8945}," p; ",{"type":15,"tag":616,"props":8947,"children":8948},{"style":623},[8949],{"type":21,"value":8950},"// human checks before go-live\n",{"type":15,"tag":616,"props":8952,"children":8953},{"class":618,"line":822},[8954],{"type":15,"tag":616,"props":8955,"children":8956},{"style":645},[8957],{"type":21,"value":962},{"type":15,"tag":616,"props":8959,"children":8960},{"class":618,"line":831},[8961],{"type":15,"tag":616,"props":8962,"children":8963},{"emptyLinePlaceholder":689},[8964],{"type":21,"value":692},{"type":15,"tag":616,"props":8966,"children":8967},{"class":618,"line":856},[8968],{"type":15,"tag":616,"props":8969,"children":8970},{"style":623},[8971],{"type":21,"value":8972},"    // 2. Backfill in bounded passes (loop until jobSummary stabilises).\n",{"type":15,"tag":616,"props":8974,"children":8975},{"class":618,"line":874},[8976,8980,8984,8988,8992,8996,9000,9004],{"type":15,"tag":616,"props":8977,"children":8978},{"style":633},[8979],{"type":21,"value":657},{"type":15,"tag":616,"props":8981,"children":8982},{"style":645},[8983],{"type":21,"value":1001},{"type":15,"tag":616,"props":8985,"children":8986},{"style":633},[8987],{"type":21,"value":667},{"type":15,"tag":616,"props":8989,"children":8990},{"style":645},[8991],{"type":21,"value":1010},{"type":15,"tag":616,"props":8993,"children":8994},{"style":639},[8995],{"type":21,"value":596},{"type":15,"tag":616,"props":8997,"children":8998},{"style":645},[8999],{"type":21,"value":760},{"type":15,"tag":616,"props":9001,"children":9002},{"style":733},[9003],{"type":21,"value":736},{"type":15,"tag":616,"props":9005,"children":9006},{"style":645},[9007],{"type":21,"value":1027},{"type":15,"tag":616,"props":9009,"children":9010},{"class":618,"line":911},[9011],{"type":15,"tag":616,"props":9012,"children":9013},{"emptyLinePlaceholder":689},[9014],{"type":21,"value":692},{"type":15,"tag":616,"props":9016,"children":9017},{"class":618,"line":929},[9018],{"type":15,"tag":616,"props":9019,"children":9020},{"style":623},[9021],{"type":21,"value":9022},"    // 3. Report health.\n",{"type":15,"tag":616,"props":9024,"children":9025},{"class":618,"line":948},[9026,9030,9034,9038,9042,9046,9050,9054],{"type":15,"tag":616,"props":9027,"children":9028},{"style":633},[9029],{"type":21,"value":657},{"type":15,"tag":616,"props":9031,"children":9032},{"style":645},[9033],{"type":21,"value":3963},{"type":15,"tag":616,"props":9035,"children":9036},{"style":633},[9037],{"type":21,"value":667},{"type":15,"tag":616,"props":9039,"children":9040},{"style":645},[9041],{"type":21,"value":1010},{"type":15,"tag":616,"props":9043,"children":9044},{"style":639},[9045],{"type":21,"value":3854},{"type":15,"tag":616,"props":9047,"children":9048},{"style":645},[9049],{"type":21,"value":760},{"type":15,"tag":616,"props":9051,"children":9052},{"style":733},[9053],{"type":21,"value":736},{"type":15,"tag":616,"props":9055,"children":9056},{"style":645},[9057],{"type":21,"value":1027},{"type":15,"tag":616,"props":9059,"children":9060},{"class":618,"line":956},[9061,9065,9070,9074,9078,9082,9086,9090,9094,9098,9102,9107],{"type":15,"tag":616,"props":9062,"children":9063},{"style":633},[9064],{"type":21,"value":657},{"type":15,"tag":616,"props":9066,"children":9067},{"style":645},[9068],{"type":21,"value":9069}," failures ",{"type":15,"tag":616,"props":9071,"children":9072},{"style":633},[9073],{"type":21,"value":667},{"type":15,"tag":616,"props":9075,"children":9076},{"style":645},[9077],{"type":21,"value":1010},{"type":15,"tag":616,"props":9079,"children":9080},{"style":639},[9081],{"type":21,"value":3861},{"type":15,"tag":616,"props":9083,"children":9084},{"style":645},[9085],{"type":21,"value":760},{"type":15,"tag":616,"props":9087,"children":9088},{"style":733},[9089],{"type":21,"value":736},{"type":15,"tag":616,"props":9091,"children":9092},{"style":645},[9093],{"type":21,"value":76},{"type":15,"tag":616,"props":9095,"children":9096},{"style":733},[9097],{"type":21,"value":4131},{"type":15,"tag":616,"props":9099,"children":9100},{"style":645},[9101],{"type":21,"value":76},{"type":15,"tag":616,"props":9103,"children":9104},{"style":1204},[9105],{"type":21,"value":9106},"10",{"type":15,"tag":616,"props":9108,"children":9109},{"style":645},[9110],{"type":21,"value":1027},{"type":15,"tag":616,"props":9112,"children":9113},{"class":618,"line":965},[9114,9118],{"type":15,"tag":616,"props":9115,"children":9116},{"style":633},[9117],{"type":21,"value":6877},{"type":15,"tag":616,"props":9119,"children":9120},{"style":645},[9121],{"type":21,"value":9122}," { enqueued: enq.enqueued, summary: s, recentFailures: failures };\n",{"type":15,"tag":616,"props":9124,"children":9125},{"class":618,"line":973},[9126],{"type":15,"tag":616,"props":9127,"children":9128},{"style":645},[9129],{"type":21,"value":1319},{"type":15,"tag":131,"props":9131,"children":9133},{"id":9132},"common-patterns",[9134],{"type":21,"value":9135},"Common Patterns",{"type":15,"tag":24,"props":9137,"children":9138},{},[9139,9144,9145,9150,9152,9157],{"type":15,"tag":48,"props":9140,"children":9141},{},[9142],{"type":21,"value":9143},"Declare-once, guard the create.",{"type":21,"value":1809},{"type":15,"tag":143,"props":9146,"children":9148},{"className":9147},[],[9149],{"type":21,"value":755},{"type":21,"value":9151}," rejects a\nduplicate. Wrap setup so it's safe to run on every deploy: probe\nwith ",{"type":15,"tag":143,"props":9153,"children":9155},{"className":9154},[],[9156],{"type":21,"value":1381},{"type":21,"value":9158}," (or your own marker) and only create when\nabsent.",{"type":15,"tag":24,"props":9160,"children":9161},{},[9162,9167,9169,9174,9176,9181,9183,9188],{"type":15,"tag":48,"props":9163,"children":9164},{},[9165],{"type":21,"value":9166},"Preview before backfill, always.",{"type":21,"value":9168}," One ",{"type":15,"tag":143,"props":9170,"children":9172},{"className":9171},[],[9173],{"type":21,"value":3116},{"type":21,"value":9175}," on a\nrepresentative document catches a bad ",{"type":15,"tag":143,"props":9177,"children":9179},{"className":9178},[],[9180],{"type":21,"value":3148},{"type":21,"value":9182}," or an\nover-eager ",{"type":15,"tag":143,"props":9184,"children":9186},{"className":9185},[],[9187],{"type":21,"value":3156},{"type":21,"value":9189}," before you've extracted ten thousand\ndocuments wrong. It's free — nothing is written.",{"type":15,"tag":24,"props":9191,"children":9192},{},[9193,9198,9200,9205],{"type":15,"tag":48,"props":9194,"children":9195},{},[9196],{"type":21,"value":9197},"Vocabulary before query.",{"type":21,"value":9199}," Whether it's your code or an agent,\nread ",{"type":15,"tag":143,"props":9201,"children":9203},{"className":9202},[],[9204],{"type":21,"value":5620},{"type":21,"value":9206}," to get the real literals, then predicate on\nthem. This is the difference between a complete answer and a\nplausible-looking partial one.",{"type":15,"tag":24,"props":9208,"children":9209},{},[9210,9215,9217,9223,9225,9230],{"type":15,"tag":48,"props":9211,"children":9212},{},[9213],{"type":21,"value":9214},"Reprocess, don't re-backfill, after a config change.",{"type":21,"value":9216}," Added a\ntype? ",{"type":15,"tag":143,"props":9218,"children":9220},{"className":9219},[],[9221],{"type":21,"value":9222},"reprocess(dataset, type)",{"type":21,"value":9224}," touches only stale documents.\n",{"type":15,"tag":143,"props":9226,"children":9228},{"className":9227},[],[9229],{"type":21,"value":596},{"type":21,"value":9231}," re-runs everything — use it for the initial load, not\nfor incremental config changes.",{"type":15,"tag":24,"props":9233,"children":9234},{},[9235,9240],{"type":15,"tag":48,"props":9236,"children":9237},{},[9238],{"type":21,"value":9239},"Let the agent count; let RAG illustrate.",{"type":21,"value":9241}," Give a customer\nagent both surfaces and a prompt that routes by question class.\n\"How many / list all / who worked with\" → knowledge. \"Show me an\nexample / what did we say about\" → RAG.",{"type":15,"tag":24,"props":9243,"children":9244},{},[9245,9250,9252,9257,9259,9265,9267,9272],{"type":15,"tag":48,"props":9246,"children":9247},{},[9248],{"type":21,"value":9249},"Source every hand-written edge.",{"type":21,"value":9251}," When you ",{"type":15,"tag":143,"props":9253,"children":9255},{"className":9254},[],[9256],{"type":21,"value":6142},{"type":21,"value":9258},",\npass ",{"type":15,"tag":143,"props":9260,"children":9262},{"className":9261},[],[9263],{"type":21,"value":9264},"sourceDocId",{"type":21,"value":9266},"/",{"type":15,"tag":143,"props":9268,"children":9270},{"className":9269},[],[9271],{"type":21,"value":6671},{"type":21,"value":9273},". It costs nothing and buys you\ntraceability (\"where does it say?\") and correct access filtering\non that edge.",{"type":15,"tag":131,"props":9275,"children":9277},{"id":9276},"what-to-watch-out-for",[9278],{"type":21,"value":9279},"What To Watch Out For",{"type":15,"tag":24,"props":9281,"children":9282},{},[9283,9288,9289,9294,9296,9301,9303,9308,9310,9315,9317,9322,9323,9328],{"type":15,"tag":48,"props":9284,"children":9285},{},[9286],{"type":21,"value":9287},"Extraction is asynchronous — don't query immediately after\nbackfill.",{"type":21,"value":1809},{"type":15,"tag":143,"props":9290,"children":9292},{"className":9291},[],[9293],{"type":21,"value":596},{"type":21,"value":9295}," returns an ",{"type":15,"tag":30,"props":9297,"children":9298},{},[9299],{"type":21,"value":9300},"enqueued",{"type":21,"value":9302}," count, not a\n",{"type":15,"tag":30,"props":9304,"children":9305},{},[9306],{"type":21,"value":9307},"done",{"type":21,"value":9309}," count. Poll ",{"type":15,"tag":143,"props":9311,"children":9313},{"className":9312},[],[9314],{"type":21,"value":3854},{"type":21,"value":9316}," until ",{"type":15,"tag":143,"props":9318,"children":9320},{"className":9319},[],[9321],{"type":21,"value":3880},{"type":21,"value":429},{"type":15,"tag":143,"props":9324,"children":9326},{"className":9325},[],[9327],{"type":21,"value":3887},{"type":21,"value":9329},"\ndrain before treating the store as complete. A query against a\nhalf-extracted corpus is correct but partial.",{"type":15,"tag":24,"props":9331,"children":9332},{},[9333,9338],{"type":15,"tag":48,"props":9334,"children":9335},{},[9336],{"type":21,"value":9337},"Counts are access-relative, and that's by design.",{"type":21,"value":9339}," Two users\nrunning the identical query can get different numbers. Surface\nthis to stakeholders up front so \"the count looks low\" is\nunderstood as filtering, not a defect.",{"type":15,"tag":24,"props":9341,"children":9342},{},[9343,9348,9350,9355,9357,9363,9365,9371],{"type":15,"tag":48,"props":9344,"children":9345},{},[9346],{"type":21,"value":9347},"A false merge is worse than a duplicate.",{"type":21,"value":9349}," If two distinct\ncompanies collapse into one, your \"list all clients\" is silently\nwrong and you may never notice. Stay conservative on\n",{"type":15,"tag":143,"props":9351,"children":9353},{"className":9352},[],[9354],{"type":21,"value":3572},{"type":21,"value":9356},", lean on ",{"type":15,"tag":143,"props":9358,"children":9360},{"className":9359},[],[9361],{"type":21,"value":9362},"reviewThreshold",{"type":21,"value":9364},"/\n",{"type":15,"tag":143,"props":9366,"children":9368},{"className":9367},[],[9369],{"type":21,"value":9370},"escalateAmbiguous",{"type":21,"value":9372}," for the hard cases, and remember that a\nvisible duplicate is fixable while a hidden false-merge is not.",{"type":15,"tag":24,"props":9374,"children":9375},{},[9376,9381,9383,9388,9390,9395,9397,9403,9405,9411,9413,9418],{"type":15,"tag":48,"props":9377,"children":9378},{},[9379],{"type":21,"value":9380},"Validate against config, and trust the errors.",{"type":21,"value":9382}," An unknown\n",{"type":15,"tag":143,"props":9384,"children":9386},{"className":9385},[],[9387],{"type":21,"value":5123},{"type":21,"value":9389},", a bad operator, a missing ",{"type":15,"tag":143,"props":9391,"children":9393},{"className":9392},[],[9394],{"type":21,"value":1616},{"type":21,"value":9396},", or a third\ntraversal hop all throw a clear ",{"type":15,"tag":143,"props":9398,"children":9400},{"className":9399},[],[9401],{"type":21,"value":9402},"IllegalArgumentException",{"type":21,"value":9404}," — they\ndo not silently return ",{"type":15,"tag":143,"props":9406,"children":9408},{"className":9407},[],[9409],{"type":21,"value":9410},"[]",{"type":21,"value":9412},". If a query comes back empty, check\nthat the value exists (via ",{"type":15,"tag":143,"props":9414,"children":9416},{"className":9415},[],[9417],{"type":21,"value":5620},{"type":21,"value":9419},") before assuming the\nquery is wrong.",{"type":15,"tag":24,"props":9421,"children":9422},{},[9423,9433],{"type":15,"tag":48,"props":9424,"children":9425},{},[9426,9431],{"type":15,"tag":143,"props":9427,"children":9429},{"className":9428},[],[9430],{"type":21,"value":596},{"type":21,"value":9432}," is bounded per call.",{"type":21,"value":9434}," For a large corpus it\nprocesses a slice and returns; call it again (or loop) until the\nenqueued count settles. It's idempotent, so repeated calls are\nsafe.",{"type":15,"tag":24,"props":9436,"children":9437},{},[9438,9443,9445,9450,9452,9457,9459,9464,9466,9472],{"type":15,"tag":48,"props":9439,"children":9440},{},[9441],{"type":21,"value":9442},"No resolver ≠ no access control.",{"type":21,"value":9444}," Skipping\n",{"type":15,"tag":143,"props":9446,"children":9448},{"className":9447},[],[9449],{"type":21,"value":6822},{"type":21,"value":9451}," only drops the pre-filter\n",{"type":15,"tag":30,"props":9453,"children":9454},{},[9455],{"type":21,"value":9456},"optimization",{"type":21,"value":9458},"; the authoritative per-source record ACL still\nruns on every query. But a resolver that wrongly returns an\n",{"type":15,"tag":30,"props":9460,"children":9461},{},[9462],{"type":21,"value":9463},"empty",{"type":21,"value":9465}," set means \"see nothing\" — return ",{"type":15,"tag":143,"props":9467,"children":9469},{"className":9468},[],[9470],{"type":21,"value":9471},"null",{"type":21,"value":9473},", never empty, for\n\"no derivation available.\"",{"type":15,"tag":131,"props":9475,"children":9477},{"id":9476},"reference-cheat-sheet",[9478],{"type":21,"value":9479},"Reference Cheat Sheet",{"type":15,"tag":1570,"props":9481,"children":9483},{"id":9482},"facade-contextgetknowledge",[9484,9486],{"type":21,"value":9485},"Facade — ",{"type":15,"tag":143,"props":9487,"children":9489},{"className":9488},[],[9490],{"type":21,"value":148},{"type":15,"tag":24,"props":9492,"children":9493},{},[9494],{"type":15,"tag":48,"props":9495,"children":9496},{},[9497],{"type":21,"value":194},{"type":15,"tag":477,"props":9499,"children":9501},{"code":9500,"language":609,"meta":7,"className":610,"style":7},"createDataset(datasetId, { name, extractionModel?, resolutionModel? })  // → dataset config\naddEntityType(datasetId, { type, attributes?, extractionHint?, dedupKeys?,\n                           autoMergeThreshold?, reviewThreshold?, escalateAmbiguous? })\naddRelationshipType(datasetId, { relType, fromType, toType, extractionHint? })\naddTaxonomyTerm(datasetId, { term, categoryPath?, aliases?, entityType? })\nlistEntityTypes(datasetId)            // → [{ type, version, attributes, dedupKeys, … }]\nlistRelationshipTypes(datasetId)      // → [{ relType, fromType, toType, version, … }]\n",[9502],{"type":15,"tag":143,"props":9503,"children":9504},{"__ignoreMap":7},[9505,9522,9534,9542,9554,9566,9583],{"type":15,"tag":616,"props":9506,"children":9507},{"class":618,"line":619},[9508,9512,9517],{"type":15,"tag":616,"props":9509,"children":9510},{"style":639},[9511],{"type":21,"value":755},{"type":15,"tag":616,"props":9513,"children":9514},{"style":645},[9515],{"type":21,"value":9516},"(datasetId, { name, extractionModel?, resolutionModel? })  ",{"type":15,"tag":616,"props":9518,"children":9519},{"style":623},[9520],{"type":21,"value":9521},"// → dataset config\n",{"type":15,"tag":616,"props":9523,"children":9524},{"class":618,"line":629},[9525,9529],{"type":15,"tag":616,"props":9526,"children":9527},{"style":639},[9528],{"type":21,"value":841},{"type":15,"tag":616,"props":9530,"children":9531},{"style":645},[9532],{"type":21,"value":9533},"(datasetId, { type, attributes?, extractionHint?, dedupKeys?,\n",{"type":15,"tag":616,"props":9535,"children":9536},{"class":618,"line":651},[9537],{"type":15,"tag":616,"props":9538,"children":9539},{"style":645},[9540],{"type":21,"value":9541},"                           autoMergeThreshold?, reviewThreshold?, escalateAmbiguous? })\n",{"type":15,"tag":616,"props":9543,"children":9544},{"class":618,"line":685},[9545,9549],{"type":15,"tag":616,"props":9546,"children":9547},{"style":639},[9548],{"type":21,"value":2620},{"type":15,"tag":616,"props":9550,"children":9551},{"style":645},[9552],{"type":21,"value":9553},"(datasetId, { relType, fromType, toType, extractionHint? })\n",{"type":15,"tag":616,"props":9555,"children":9556},{"class":618,"line":695},[9557,9561],{"type":15,"tag":616,"props":9558,"children":9559},{"style":639},[9560],{"type":21,"value":2899},{"type":15,"tag":616,"props":9562,"children":9563},{"style":645},[9564],{"type":21,"value":9565},"(datasetId, { term, categoryPath?, aliases?, entityType? })\n",{"type":15,"tag":616,"props":9567,"children":9568},{"class":618,"line":704},[9569,9573,9578],{"type":15,"tag":616,"props":9570,"children":9571},{"style":639},[9572],{"type":21,"value":1381},{"type":15,"tag":616,"props":9574,"children":9575},{"style":645},[9576],{"type":21,"value":9577},"(datasetId)            ",{"type":15,"tag":616,"props":9579,"children":9580},{"style":623},[9581],{"type":21,"value":9582},"// → [{ type, version, attributes, dedupKeys, … }]\n",{"type":15,"tag":616,"props":9584,"children":9585},{"class":618,"line":744},[9586,9591,9596],{"type":15,"tag":616,"props":9587,"children":9588},{"style":639},[9589],{"type":21,"value":9590},"listRelationshipTypes",{"type":15,"tag":616,"props":9592,"children":9593},{"style":645},[9594],{"type":21,"value":9595},"(datasetId)      ",{"type":15,"tag":616,"props":9597,"children":9598},{"style":623},[9599],{"type":21,"value":9600},"// → [{ relType, fromType, toType, version, … }]\n",{"type":15,"tag":24,"props":9602,"children":9603},{},[9604],{"type":15,"tag":48,"props":9605,"children":9606},{},[9607],{"type":21,"value":9608},"Ingestion & jobs",{"type":15,"tag":477,"props":9610,"children":9612},{"code":9611,"language":609,"meta":7,"className":610,"style":7},"preview(datasetId, documentId)        // dry run → { entities[], relationships[] }, nothing written\nbackfill(datasetId)                   // → { datasetId, enqueued }  (idempotent, bounded)\nreprocess(datasetId, entityType)      // → { datasetId, entityType, enqueued }  (only stale docs)\njobStatus(datasetId, documentId)      // → job map | null\nlistJobs(datasetId, status, limit)    // status ∈ QUEUED|RUNNING|DONE|FAILED ; limit ≤ 200\njobSummary(datasetId)                  // → { QUEUED, RUNNING, DONE, FAILED }\n",[9613],{"type":15,"tag":143,"props":9614,"children":9615},{"__ignoreMap":7},[9616,9633,9650,9667,9684,9701],{"type":15,"tag":616,"props":9617,"children":9618},{"class":618,"line":619},[9619,9623,9628],{"type":15,"tag":616,"props":9620,"children":9621},{"style":639},[9622],{"type":21,"value":3116},{"type":15,"tag":616,"props":9624,"children":9625},{"style":645},[9626],{"type":21,"value":9627},"(datasetId, documentId)        ",{"type":15,"tag":616,"props":9629,"children":9630},{"style":623},[9631],{"type":21,"value":9632},"// dry run → { entities[], relationships[] }, nothing written\n",{"type":15,"tag":616,"props":9634,"children":9635},{"class":618,"line":629},[9636,9640,9645],{"type":15,"tag":616,"props":9637,"children":9638},{"style":639},[9639],{"type":21,"value":596},{"type":15,"tag":616,"props":9641,"children":9642},{"style":645},[9643],{"type":21,"value":9644},"(datasetId)                   ",{"type":15,"tag":616,"props":9646,"children":9647},{"style":623},[9648],{"type":21,"value":9649},"// → { datasetId, enqueued }  (idempotent, bounded)\n",{"type":15,"tag":616,"props":9651,"children":9652},{"class":618,"line":651},[9653,9657,9662],{"type":15,"tag":616,"props":9654,"children":9655},{"style":639},[9656],{"type":21,"value":3714},{"type":15,"tag":616,"props":9658,"children":9659},{"style":645},[9660],{"type":21,"value":9661},"(datasetId, entityType)      ",{"type":15,"tag":616,"props":9663,"children":9664},{"style":623},[9665],{"type":21,"value":9666},"// → { datasetId, entityType, enqueued }  (only stale docs)\n",{"type":15,"tag":616,"props":9668,"children":9669},{"class":618,"line":685},[9670,9674,9679],{"type":15,"tag":616,"props":9671,"children":9672},{"style":639},[9673],{"type":21,"value":3868},{"type":15,"tag":616,"props":9675,"children":9676},{"style":645},[9677],{"type":21,"value":9678},"(datasetId, documentId)      ",{"type":15,"tag":616,"props":9680,"children":9681},{"style":623},[9682],{"type":21,"value":9683},"// → job map | null\n",{"type":15,"tag":616,"props":9685,"children":9686},{"class":618,"line":695},[9687,9691,9696],{"type":15,"tag":616,"props":9688,"children":9689},{"style":639},[9690],{"type":21,"value":3861},{"type":15,"tag":616,"props":9692,"children":9693},{"style":645},[9694],{"type":21,"value":9695},"(datasetId, status, limit)    ",{"type":15,"tag":616,"props":9697,"children":9698},{"style":623},[9699],{"type":21,"value":9700},"// status ∈ QUEUED|RUNNING|DONE|FAILED ; limit ≤ 200\n",{"type":15,"tag":616,"props":9702,"children":9703},{"class":618,"line":704},[9704,9708,9713],{"type":15,"tag":616,"props":9705,"children":9706},{"style":639},[9707],{"type":21,"value":3854},{"type":15,"tag":616,"props":9709,"children":9710},{"style":645},[9711],{"type":21,"value":9712},"(datasetId)                  ",{"type":15,"tag":616,"props":9714,"children":9715},{"style":623},[9716],{"type":21,"value":9717},"// → { QUEUED, RUNNING, DONE, FAILED }\n",{"type":15,"tag":24,"props":9719,"children":9720},{},[9721],{"type":15,"tag":48,"props":9722,"children":9723},{},[9724],{"type":21,"value":332},{"type":15,"tag":477,"props":9726,"children":9728},{"code":9727,"language":609,"meta":7,"className":610,"style":7},"query(datasetId, spec)                 // entities, or aggregate rows\nquery(datasetId, spec, folderIds)      // …scoped to folderIds (ACL still applies)\nvocabulary(datasetId, entityType)      // → { attrKey: [distinct values…], …taxonomy facets }\nvocabulary(datasetId, entityType, folderIds)\naddRelationship(datasetId, { fromEntity, toEntity, relType,\n                             sourceDocId?, sourceDocName?, folderIds?, confidence? })\n",[9729],{"type":15,"tag":143,"props":9730,"children":9731},{"__ignoreMap":7},[9732,9749,9766,9782,9794,9806],{"type":15,"tag":616,"props":9733,"children":9734},{"class":618,"line":619},[9735,9739,9744],{"type":15,"tag":616,"props":9736,"children":9737},{"style":639},[9738],{"type":21,"value":603},{"type":15,"tag":616,"props":9740,"children":9741},{"style":645},[9742],{"type":21,"value":9743},"(datasetId, spec)                 ",{"type":15,"tag":616,"props":9745,"children":9746},{"style":623},[9747],{"type":21,"value":9748},"// entities, or aggregate rows\n",{"type":15,"tag":616,"props":9750,"children":9751},{"class":618,"line":629},[9752,9756,9761],{"type":15,"tag":616,"props":9753,"children":9754},{"style":639},[9755],{"type":21,"value":603},{"type":15,"tag":616,"props":9757,"children":9758},{"style":645},[9759],{"type":21,"value":9760},"(datasetId, spec, folderIds)      ",{"type":15,"tag":616,"props":9762,"children":9763},{"style":623},[9764],{"type":21,"value":9765},"// …scoped to folderIds (ACL still applies)\n",{"type":15,"tag":616,"props":9767,"children":9768},{"class":618,"line":651},[9769,9773,9777],{"type":15,"tag":616,"props":9770,"children":9771},{"style":639},[9772],{"type":21,"value":5620},{"type":15,"tag":616,"props":9774,"children":9775},{"style":645},[9776],{"type":21,"value":9661},{"type":15,"tag":616,"props":9778,"children":9779},{"style":623},[9780],{"type":21,"value":9781},"// → { attrKey: [distinct values…], …taxonomy facets }\n",{"type":15,"tag":616,"props":9783,"children":9784},{"class":618,"line":685},[9785,9789],{"type":15,"tag":616,"props":9786,"children":9787},{"style":639},[9788],{"type":21,"value":5620},{"type":15,"tag":616,"props":9790,"children":9791},{"style":645},[9792],{"type":21,"value":9793},"(datasetId, entityType, folderIds)\n",{"type":15,"tag":616,"props":9795,"children":9796},{"class":618,"line":695},[9797,9801],{"type":15,"tag":616,"props":9798,"children":9799},{"style":639},[9800],{"type":21,"value":6142},{"type":15,"tag":616,"props":9802,"children":9803},{"style":645},[9804],{"type":21,"value":9805},"(datasetId, { fromEntity, toEntity, relType,\n",{"type":15,"tag":616,"props":9807,"children":9808},{"class":618,"line":704},[9809],{"type":15,"tag":616,"props":9810,"children":9811},{"style":645},[9812],{"type":21,"value":9813},"                             sourceDocId?, sourceDocName?, folderIds?, confidence? })\n",{"type":15,"tag":1570,"props":9815,"children":9817},{"id":9816},"query-spec-dsl",[9818],{"type":21,"value":9819},"Query Spec DSL",{"type":15,"tag":477,"props":9821,"children":9823},{"code":9822,"language":609,"meta":7,"className":610,"style":7},"{\n  entityType: \"company\",                       // REQUIRED\n  where: [                                     // AND-ed predicates\n    { attr, op: \"eq\",       value },\n    { attr, op: \"in\",       value: [ … ] },\n    { attr, op: \"contains\", value },\n    { attr, op: \"range\",    min, max },\n    { attr, op: \"exists\" }\n  ],\n  traverse: [                                  // up to 2 hops\n    { relType, direction: \"out\"|\"in\", as }\n  ],\n  aggregate: { op: \"count\" },                  // or\n  aggregate: { op: \"group_by\", attr },         // or\n  aggregate: { op: \"distinct\", attr },\n  limit: 50,                                   // default 50\n  offset: 0\n}\n// Any other top-level field → rejected.\n",[9824],{"type":15,"tag":143,"props":9825,"children":9826},{"__ignoreMap":7},[9827,9834,9860,9878,9895,9911,9928,9944,9959,9967,9985,10011,10018,10053,10085,10113,10138,10154,10161],{"type":15,"tag":616,"props":9828,"children":9829},{"class":618,"line":619},[9830],{"type":15,"tag":616,"props":9831,"children":9832},{"style":645},[9833],{"type":21,"value":6464},{"type":15,"tag":616,"props":9835,"children":9836},{"class":618,"line":629},[9837,9842,9846,9850,9855],{"type":15,"tag":616,"props":9838,"children":9839},{"style":639},[9840],{"type":21,"value":9841},"  entityType",{"type":15,"tag":616,"props":9843,"children":9844},{"style":645},[9845],{"type":21,"value":6495},{"type":15,"tag":616,"props":9847,"children":9848},{"style":733},[9849],{"type":21,"value":867},{"type":15,"tag":616,"props":9851,"children":9852},{"style":645},[9853],{"type":21,"value":9854},",                       ",{"type":15,"tag":616,"props":9856,"children":9857},{"style":623},[9858],{"type":21,"value":9859},"// REQUIRED\n",{"type":15,"tag":616,"props":9861,"children":9862},{"class":618,"line":651},[9863,9868,9873],{"type":15,"tag":616,"props":9864,"children":9865},{"style":639},[9866],{"type":21,"value":9867},"  where",{"type":15,"tag":616,"props":9869,"children":9870},{"style":645},[9871],{"type":21,"value":9872},": [                                     ",{"type":15,"tag":616,"props":9874,"children":9875},{"style":623},[9876],{"type":21,"value":9877},"// AND-ed predicates\n",{"type":15,"tag":616,"props":9879,"children":9880},{"class":618,"line":685},[9881,9886,9890],{"type":15,"tag":616,"props":9882,"children":9883},{"style":645},[9884],{"type":21,"value":9885},"    { attr, op: ",{"type":15,"tag":616,"props":9887,"children":9888},{"style":733},[9889],{"type":21,"value":1177},{"type":15,"tag":616,"props":9891,"children":9892},{"style":645},[9893],{"type":21,"value":9894},",       value },\n",{"type":15,"tag":616,"props":9896,"children":9897},{"class":618,"line":695},[9898,9902,9906],{"type":15,"tag":616,"props":9899,"children":9900},{"style":645},[9901],{"type":21,"value":9885},{"type":15,"tag":616,"props":9903,"children":9904},{"style":733},[9905],{"type":21,"value":5023},{"type":15,"tag":616,"props":9907,"children":9908},{"style":645},[9909],{"type":21,"value":9910},",       value: [ … ] },\n",{"type":15,"tag":616,"props":9912,"children":9913},{"class":618,"line":704},[9914,9918,9923],{"type":15,"tag":616,"props":9915,"children":9916},{"style":645},[9917],{"type":21,"value":9885},{"type":15,"tag":616,"props":9919,"children":9920},{"style":733},[9921],{"type":21,"value":9922},"\"contains\"",{"type":15,"tag":616,"props":9924,"children":9925},{"style":645},[9926],{"type":21,"value":9927},", value },\n",{"type":15,"tag":616,"props":9929,"children":9930},{"class":618,"line":744},[9931,9935,9939],{"type":15,"tag":616,"props":9932,"children":9933},{"style":645},[9934],{"type":21,"value":9885},{"type":15,"tag":616,"props":9936,"children":9937},{"style":733},[9938],{"type":21,"value":5074},{"type":15,"tag":616,"props":9940,"children":9941},{"style":645},[9942],{"type":21,"value":9943},",    min, max },\n",{"type":15,"tag":616,"props":9945,"children":9946},{"class":618,"line":772},[9947,9951,9955],{"type":15,"tag":616,"props":9948,"children":9949},{"style":645},[9950],{"type":21,"value":9885},{"type":15,"tag":616,"props":9952,"children":9953},{"style":733},[9954],{"type":21,"value":4915},{"type":15,"tag":616,"props":9956,"children":9957},{"style":645},[9958],{"type":21,"value":1536},{"type":15,"tag":616,"props":9960,"children":9961},{"class":618,"line":791},[9962],{"type":15,"tag":616,"props":9963,"children":9964},{"style":645},[9965],{"type":21,"value":9966},"  ],\n",{"type":15,"tag":616,"props":9968,"children":9969},{"class":618,"line":805},[9970,9975,9980],{"type":15,"tag":616,"props":9971,"children":9972},{"style":639},[9973],{"type":21,"value":9974},"  traverse",{"type":15,"tag":616,"props":9976,"children":9977},{"style":645},[9978],{"type":21,"value":9979},": [                                  ",{"type":15,"tag":616,"props":9981,"children":9982},{"style":623},[9983],{"type":21,"value":9984},"// up to 2 hops\n",{"type":15,"tag":616,"props":9986,"children":9987},{"class":618,"line":814},[9988,9993,9997,10002,10006],{"type":15,"tag":616,"props":9989,"children":9990},{"style":645},[9991],{"type":21,"value":9992},"    { relType, direction: ",{"type":15,"tag":616,"props":9994,"children":9995},{"style":733},[9996],{"type":21,"value":5893},{"type":15,"tag":616,"props":9998,"children":9999},{"style":633},[10000],{"type":21,"value":10001},"|",{"type":15,"tag":616,"props":10003,"children":10004},{"style":733},[10005],{"type":21,"value":5023},{"type":15,"tag":616,"props":10007,"children":10008},{"style":645},[10009],{"type":21,"value":10010},", as }\n",{"type":15,"tag":616,"props":10012,"children":10013},{"class":618,"line":822},[10014],{"type":15,"tag":616,"props":10015,"children":10016},{"style":645},[10017],{"type":21,"value":9966},{"type":15,"tag":616,"props":10019,"children":10020},{"class":618,"line":831},[10021,10026,10031,10035,10039,10043,10048],{"type":15,"tag":616,"props":10022,"children":10023},{"style":639},[10024],{"type":21,"value":10025},"  aggregate",{"type":15,"tag":616,"props":10027,"children":10028},{"style":645},[10029],{"type":21,"value":10030},": { ",{"type":15,"tag":616,"props":10032,"children":10033},{"style":639},[10034],{"type":21,"value":4616},{"type":15,"tag":616,"props":10036,"children":10037},{"style":645},[10038],{"type":21,"value":6495},{"type":15,"tag":616,"props":10040,"children":10041},{"style":733},[10042],{"type":21,"value":5383},{"type":15,"tag":616,"props":10044,"children":10045},{"style":645},[10046],{"type":21,"value":10047}," },                  ",{"type":15,"tag":616,"props":10049,"children":10050},{"style":623},[10051],{"type":21,"value":10052},"// or\n",{"type":15,"tag":616,"props":10054,"children":10055},{"class":618,"line":856},[10056,10060,10064,10068,10072,10076,10081],{"type":15,"tag":616,"props":10057,"children":10058},{"style":639},[10059],{"type":21,"value":10025},{"type":15,"tag":616,"props":10061,"children":10062},{"style":645},[10063],{"type":21,"value":10030},{"type":15,"tag":616,"props":10065,"children":10066},{"style":639},[10067],{"type":21,"value":4616},{"type":15,"tag":616,"props":10069,"children":10070},{"style":645},[10071],{"type":21,"value":6495},{"type":15,"tag":616,"props":10073,"children":10074},{"style":733},[10075],{"type":21,"value":1522},{"type":15,"tag":616,"props":10077,"children":10078},{"style":645},[10079],{"type":21,"value":10080},", attr },         ",{"type":15,"tag":616,"props":10082,"children":10083},{"style":623},[10084],{"type":21,"value":10052},{"type":15,"tag":616,"props":10086,"children":10087},{"class":618,"line":874},[10088,10092,10096,10100,10104,10108],{"type":15,"tag":616,"props":10089,"children":10090},{"style":639},[10091],{"type":21,"value":10025},{"type":15,"tag":616,"props":10093,"children":10094},{"style":645},[10095],{"type":21,"value":10030},{"type":15,"tag":616,"props":10097,"children":10098},{"style":639},[10099],{"type":21,"value":4616},{"type":15,"tag":616,"props":10101,"children":10102},{"style":645},[10103],{"type":21,"value":6495},{"type":15,"tag":616,"props":10105,"children":10106},{"style":733},[10107],{"type":21,"value":5558},{"type":15,"tag":616,"props":10109,"children":10110},{"style":645},[10111],{"type":21,"value":10112},", attr },\n",{"type":15,"tag":616,"props":10114,"children":10115},{"class":618,"line":911},[10116,10121,10125,10129,10134],{"type":15,"tag":616,"props":10117,"children":10118},{"style":639},[10119],{"type":21,"value":10120},"  limit",{"type":15,"tag":616,"props":10122,"children":10123},{"style":645},[10124],{"type":21,"value":6495},{"type":15,"tag":616,"props":10126,"children":10127},{"style":1204},[10128],{"type":21,"value":4524},{"type":15,"tag":616,"props":10130,"children":10131},{"style":645},[10132],{"type":21,"value":10133},",                                   ",{"type":15,"tag":616,"props":10135,"children":10136},{"style":623},[10137],{"type":21,"value":4534},{"type":15,"tag":616,"props":10139,"children":10140},{"class":618,"line":929},[10141,10146,10150],{"type":15,"tag":616,"props":10142,"children":10143},{"style":639},[10144],{"type":21,"value":10145},"  offset",{"type":15,"tag":616,"props":10147,"children":10148},{"style":645},[10149],{"type":21,"value":6495},{"type":15,"tag":616,"props":10151,"children":10152},{"style":1204},[10153],{"type":21,"value":4547},{"type":15,"tag":616,"props":10155,"children":10156},{"class":618,"line":948},[10157],{"type":15,"tag":616,"props":10158,"children":10159},{"style":645},[10160],{"type":21,"value":1319},{"type":15,"tag":616,"props":10162,"children":10163},{"class":618,"line":956},[10164],{"type":15,"tag":616,"props":10165,"children":10166},{"style":623},[10167],{"type":21,"value":10168},"// Any other top-level field → rejected.\n",{"type":15,"tag":1570,"props":10170,"children":10172},{"id":10171},"entity-result-shape-no-aggregate",[10173],{"type":21,"value":10174},"Entity Result Shape (No Aggregate)",{"type":15,"tag":477,"props":10176,"children":10178},{"code":10177,"language":609,"meta":7,"className":610,"style":7},"{\n  id, entityType, canonicalName, normalizedName,\n  attributes: { key: value, … },   // flattened, first-wins\n  sourceDocs: [ … ], folderIds: [ … ]\n}\n",[10179],{"type":15,"tag":143,"props":10180,"children":10181},{"__ignoreMap":7},[10182,10189,10197,10224,10246],{"type":15,"tag":616,"props":10183,"children":10184},{"class":618,"line":619},[10185],{"type":15,"tag":616,"props":10186,"children":10187},{"style":645},[10188],{"type":21,"value":6464},{"type":15,"tag":616,"props":10190,"children":10191},{"class":618,"line":629},[10192],{"type":15,"tag":616,"props":10193,"children":10194},{"style":645},[10195],{"type":21,"value":10196},"  id, entityType, canonicalName, normalizedName,\n",{"type":15,"tag":616,"props":10198,"children":10199},{"class":618,"line":651},[10200,10205,10209,10214,10219],{"type":15,"tag":616,"props":10201,"children":10202},{"style":639},[10203],{"type":21,"value":10204},"  attributes",{"type":15,"tag":616,"props":10206,"children":10207},{"style":645},[10208],{"type":21,"value":10030},{"type":15,"tag":616,"props":10210,"children":10211},{"style":639},[10212],{"type":21,"value":10213},"key",{"type":15,"tag":616,"props":10215,"children":10216},{"style":645},[10217],{"type":21,"value":10218},": value, … },   ",{"type":15,"tag":616,"props":10220,"children":10221},{"style":623},[10222],{"type":21,"value":10223},"// flattened, first-wins\n",{"type":15,"tag":616,"props":10225,"children":10226},{"class":618,"line":685},[10227,10232,10237,10241],{"type":15,"tag":616,"props":10228,"children":10229},{"style":639},[10230],{"type":21,"value":10231},"  sourceDocs",{"type":15,"tag":616,"props":10233,"children":10234},{"style":645},[10235],{"type":21,"value":10236},": [ … ], ",{"type":15,"tag":616,"props":10238,"children":10239},{"style":639},[10240],{"type":21,"value":6671},{"type":15,"tag":616,"props":10242,"children":10243},{"style":645},[10244],{"type":21,"value":10245},": [ … ]\n",{"type":15,"tag":616,"props":10247,"children":10248},{"class":618,"line":695},[10249],{"type":15,"tag":616,"props":10250,"children":10251},{"style":645},[10252],{"type":21,"value":1319},{"type":15,"tag":1570,"props":10254,"children":10256},{"id":10255},"agent-tools-chain-json",[10257],{"type":21,"value":10258},"Agent Tools (Chain JSON)",{"type":15,"tag":477,"props":10260,"children":10262},{"code":10261,"language":6451,"meta":7,"className":6452,"style":7},"{ \"type\": \"knowledgeVocabulary\", \"name\": \"discoverValues\" }\n{ \"type\": \"knowledgeQuery\",      \"name\": \"queryKnowledge\" }\n",[10263],{"type":15,"tag":143,"props":10264,"children":10265},{"__ignoreMap":7},[10266,10306],{"type":15,"tag":616,"props":10267,"children":10268},{"class":618,"line":619},[10269,10274,10278,10282,10286,10290,10294,10298,10302],{"type":15,"tag":616,"props":10270,"children":10271},{"style":645},[10272],{"type":21,"value":10273},"{ ",{"type":15,"tag":616,"props":10275,"children":10276},{"style":1204},[10277],{"type":21,"value":6490},{"type":15,"tag":616,"props":10279,"children":10280},{"style":645},[10281],{"type":21,"value":6495},{"type":15,"tag":616,"props":10283,"children":10284},{"style":733},[10285],{"type":21,"value":6500},{"type":15,"tag":616,"props":10287,"children":10288},{"style":645},[10289],{"type":21,"value":76},{"type":15,"tag":616,"props":10291,"children":10292},{"style":1204},[10293],{"type":21,"value":6051},{"type":15,"tag":616,"props":10295,"children":10296},{"style":645},[10297],{"type":21,"value":6495},{"type":15,"tag":616,"props":10299,"children":10300},{"style":733},[10301],{"type":21,"value":6517},{"type":15,"tag":616,"props":10303,"children":10304},{"style":645},[10305],{"type":21,"value":1536},{"type":15,"tag":616,"props":10307,"children":10308},{"class":618,"line":629},[10309,10313,10317,10321,10325,10329,10333,10337,10341],{"type":15,"tag":616,"props":10310,"children":10311},{"style":645},[10312],{"type":21,"value":10273},{"type":15,"tag":616,"props":10314,"children":10315},{"style":1204},[10316],{"type":21,"value":6490},{"type":15,"tag":616,"props":10318,"children":10319},{"style":645},[10320],{"type":21,"value":6495},{"type":15,"tag":616,"props":10322,"children":10323},{"style":733},[10324],{"type":21,"value":6541},{"type":15,"tag":616,"props":10326,"children":10327},{"style":645},[10328],{"type":21,"value":6263},{"type":15,"tag":616,"props":10330,"children":10331},{"style":1204},[10332],{"type":21,"value":6051},{"type":15,"tag":616,"props":10334,"children":10335},{"style":645},[10336],{"type":21,"value":6495},{"type":15,"tag":616,"props":10338,"children":10339},{"style":733},[10340],{"type":21,"value":6558},{"type":15,"tag":616,"props":10342,"children":10343},{"style":645},[10344],{"type":21,"value":1536},{"type":15,"tag":24,"props":10346,"children":10347},{},[10348],{"type":15,"tag":30,"props":10349,"children":10350},{},[10351,10353,10358,10360,10366,10368,10373,10375,10380],{"type":21,"value":10352},"Both take ",{"type":15,"tag":143,"props":10354,"children":10356},{"className":10355},[],[10357],{"type":21,"value":1591},{"type":21,"value":10359}," + (",{"type":15,"tag":143,"props":10361,"children":10363},{"className":10362},[],[10364],{"type":21,"value":10365},"spec",{"type":21,"value":10367}," | ",{"type":15,"tag":143,"props":10369,"children":10371},{"className":10370},[],[10372],{"type":21,"value":1616},{"type":21,"value":10374},") as tool\narguments; both accept an optional ",{"type":15,"tag":143,"props":10376,"children":10378},{"className":10377},[],[10379],{"type":21,"value":6671},{"type":21,"value":10381},"; both are always\naccess-filtered to the current user.",{"type":15,"tag":1570,"props":10383,"children":10385},{"id":10384},"access-control-java-startup",[10386],{"type":21,"value":10387},"Access Control (Java Startup)",{"type":15,"tag":477,"props":10389,"children":10391},{"code":10390,"language":6804,"meta":7,"className":6805,"style":7},"KnowledgeAccess.setPermittedFolderResolver(\n    (scope, user) -> aclFoldersFor(user) /* superset, or null — never empty */ );\n",[10392],{"type":15,"tag":143,"props":10393,"children":10394},{"__ignoreMap":7},[10395,10411],{"type":15,"tag":616,"props":10396,"children":10397},{"class":618,"line":619},[10398,10402,10406],{"type":15,"tag":616,"props":10399,"children":10400},{"style":645},[10401],{"type":21,"value":6817},{"type":15,"tag":616,"props":10403,"children":10404},{"style":639},[10405],{"type":21,"value":6822},{"type":15,"tag":616,"props":10407,"children":10408},{"style":645},[10409],{"type":21,"value":10410},"(\n",{"type":15,"tag":616,"props":10412,"children":10413},{"class":618,"line":629},[10414,10419,10423,10428,10433,10438],{"type":15,"tag":616,"props":10415,"children":10416},{"style":645},[10417],{"type":21,"value":10418},"    (scope, user) ",{"type":15,"tag":616,"props":10420,"children":10421},{"style":633},[10422],{"type":21,"value":6832},{"type":15,"tag":616,"props":10424,"children":10425},{"style":639},[10426],{"type":21,"value":10427}," aclFoldersFor",{"type":15,"tag":616,"props":10429,"children":10430},{"style":645},[10431],{"type":21,"value":10432},"(user) ",{"type":15,"tag":616,"props":10434,"children":10435},{"style":623},[10436],{"type":21,"value":10437},"/* superset, or null — never empty */",{"type":15,"tag":616,"props":10439,"children":10440},{"style":645},[10441],{"type":21,"value":10442}," );\n",{"type":15,"tag":131,"props":10444,"children":10446},{"id":10445},"next-steps",[10447],{"type":21,"value":10448},"Next Steps",{"type":15,"tag":38,"props":10450,"children":10451},{},[10452,10462,10473],{"type":15,"tag":42,"props":10453,"children":10454},{},[10455,10460],{"type":15,"tag":91,"props":10456,"children":10457},{"href":93},[10458],{"type":21,"value":10459},"AI Agents",{"type":21,"value":10461}," — build the agents that query this knowledge, and the RAG layer it complements",{"type":15,"tag":42,"props":10463,"children":10464},{},[10465,10471],{"type":15,"tag":91,"props":10466,"children":10468},{"href":10467},"/guides/ai-memory",[10469],{"type":21,"value":10470},"AI Memory",{"type":21,"value":10472}," — give those agents per-user memory to pair with corpus-wide knowledge",{"type":15,"tag":42,"props":10474,"children":10475},{},[10476,10482],{"type":15,"tag":91,"props":10477,"children":10479},{"href":10478},"/guides/security",[10480],{"type":21,"value":10481},"Security",{"type":21,"value":10483}," — the tenant, app, and per-fact access model behind every query",{"type":15,"tag":10485,"props":10486,"children":10487},"style",{},[10488],{"type":21,"value":10489},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":7,"searchDepth":629,"depth":629,"links":10491},[10492,10493,10494,10495,10501,10507,10517,10523,10524,10527,10528,10534,10535,10544,10545,10546,10554],{"id":133,"depth":629,"text":136},{"id":467,"depth":629,"text":470},{"id":565,"depth":629,"text":568},{"id":1560,"depth":629,"text":1563,"children":10496},[10497,10498,10499,10500],{"id":1572,"depth":651,"text":1575},{"id":1596,"depth":651,"text":1599},{"id":1702,"depth":651,"text":1705},{"id":1754,"depth":651,"text":1757},{"id":1819,"depth":629,"text":1822,"children":10502},[10503,10504,10505,10506],{"id":1842,"depth":651,"text":1845},{"id":1992,"depth":651,"text":1995},{"id":2557,"depth":651,"text":2560},{"id":2845,"depth":651,"text":2848},{"id":3089,"depth":629,"text":3092,"children":10508},[10509,10511,10513,10515],{"id":3107,"depth":651,"text":10510},"Preview Before You Commit (preview)",{"id":3577,"depth":651,"text":10512},"Backfill The Corpus (backfill)",{"id":3705,"depth":651,"text":10514},"Reprocess After A Config Change (reprocess)",{"id":3845,"depth":651,"text":10516},"Watch The Jobs (jobSummary, listJobs, jobStatus)",{"id":4378,"depth":629,"text":4381,"children":10518},[10519,10521],{"id":4570,"depth":651,"text":10520},"where: Attribute Predicates",{"id":5135,"depth":651,"text":10522},"aggregate: Count, Group, Distinct",{"id":5598,"depth":629,"text":5601},{"id":5734,"depth":629,"text":5737,"children":10525},[10526],{"id":6121,"depth":651,"text":6124},{"id":6373,"depth":629,"text":6376},{"id":6676,"depth":629,"text":457,"children":10529},[10530,10531,10532],{"id":6714,"depth":651,"text":6717},{"id":6792,"depth":651,"text":6795},{"id":6920,"depth":651,"text":10533},"Scoping Per Call (folderIds)",{"id":7050,"depth":629,"text":7053},{"id":7242,"depth":629,"text":7245,"children":10536},[10537,10538,10539,10540,10541,10542,10543],{"id":7248,"depth":651,"text":7251},{"id":7337,"depth":651,"text":7340},{"id":7561,"depth":651,"text":7564},{"id":7692,"depth":651,"text":7695},{"id":7953,"depth":651,"text":7956},{"id":8152,"depth":651,"text":8155},{"id":8543,"depth":651,"text":8546},{"id":9132,"depth":629,"text":9135},{"id":9276,"depth":629,"text":9279},{"id":9476,"depth":629,"text":9479,"children":10547},[10548,10550,10551,10552,10553],{"id":9482,"depth":651,"text":10549},"Facade — context.getKnowledge()",{"id":9816,"depth":651,"text":9819},{"id":10171,"depth":651,"text":10174},{"id":10255,"depth":651,"text":10258},{"id":10384,"depth":651,"text":10387},{"id":10445,"depth":629,"text":10448},"markdown","content:guides:knowledge.md","content","guides/knowledge.md","guides/knowledge","md",1781263283217]