Your decisions often depend on your own rules: a claims policy, house rules for moderation, a mission's special instructions. Without knowledge you paste them into state on every request. With knowledge you store them once in a knowledge base, and a request that names it with the knowledge booster gets the passages that apply to that request, read by the model as facts and rules to apply.
- 1
Create a knowledge base#
A knowledge base is a collection of type
textathttps://api.decisionnode.com/v1/collectionshttps://api.decisionnode.com/, or a folder in the console's Knowledge section. One knowledge base per policy set is the usual shape.v1/ collections curl -X POST https://api.decisionnode.com/v1/collections \ -H "Authorization: Bearer $DECISIONNODE_API_KEY" \ -H "Content-Type: application/json" \ -d '{"type":"text","name":"Claims policy","scope_key":"mission"}' - 2
Add your documents#
Write a document as Markdown or plain text, or add a file through the API or the console: PDF, Word, PowerPoint, Excel, HTML and images are turned into text for you. Each document is cut into passages and indexed in the background; a short document is
readywithin seconds.curl -X POST https://api.decisionnode.com/v1/collections/col_3f6c1a9e0b2d4c7f8a1e5d9b2c4f6a80/items?wait=true \ -H "Authorization: Bearer $DECISIONNODE_API_KEY" \ -H "Content-Type: application/json" \ -d '{"title":"Claims policy 2026","text":"# Claims policy 2026\n\n## Receipts\n\nReject any claim over 500 SEK without a receipt.\n\n## Photos\n\nPhotos of damage must show the date they were taken.","format":"markdown","reference":"policy-2026","pinned":true}' - 3
Name it in a decision#
Add the
knowledgebooster with the knowledge base's id. The passages that apply are given to the model with the request, andevidence.knowledgelists each one by document, heading and position.curl https://api.decisionnode.com/v1/decide \ -H "Authorization: Bearer $DECISIONNODE_API_KEY" \ -H "Content-Type: application/json" \ -d '{"model":"decisionnode-moe","state":{"claim":{"amount":"740.00","currency":"SEK","receipt":false},"mission":"M-42"},"boosters":[{"name":"knowledge","require":true,"options":{"collection":"col_3f6c1a9e0b2d4c7f8a1e5d9b2c4f6a80","scope":"M-42"}}],"questions":{"approve":{"type":"truth","instructions":"Should the claim be approved under our policy?"}}}'
What a knowledge base can hold#
Knowledge can be any text the decision should follow: policies, rules, manuals, instructions, checklists or briefs. Ten examples, one per industry, with a rule each document might contain and a question it steers. Pinned marks a rule given to every request; a scope keeps a mission's, a model's or a site's documents to the requests that name it.
| Industry | Document | A rule it holds | A decision it steers |
|---|---|---|---|
| Insurance claims | Claims policy | Pinned: reject a claim over 500 EUR without a receipt. Water damage is covered only when the leak was sudden. | "Should this claim be approved under our policy?" |
| Trust and safety | Community moderation policy | Pinned: threats against a named person are removed whatever the context. Satire of public figures is allowed when labelled. | "Does this comment break our rules, and which one?" |
| Defence and security | Rules of engagement and mission briefs, scope key mission | Pinned: no action without positive identification. Mission M-42 brief: vehicles inside the marked corridor are friendly until 18:00. | "Is this contact inside the rules for mission M-42?" ("scope": "M-42") |
| Autonomous vehicles and drones | Handling instructions for each vehicle model: how to steer it, scope key model | Rover R2: at most 8 km/h on gravel and 3 km/h on slopes over 15%; keep 2 m from people; stop and hand over to an operator when the camera is blocked. Drone X4: never above 120 m or in wind over 12 m/s. | "Can the rover take this route at its current speed?" ("scope": "R2") |
| Banking | KYC and AML procedures | Pinned: a customer with a sanctions match is never onboarded automatically. Cash deposits over 10,000 EUR in a week need a source of funds. | "Does this account opening need manual review?" |
| E-commerce | Company policy on how to treat each customer action | Approve a refund under 50 EUR within 30 days. Escalate a refund over 500 EUR to a person. Refuse a return of opened software. Flag a fourth return within 60 days for fraud review. | "Approve, escalate, refuse or flag this refund request?" |
| Healthcare administration | Front-desk routing protocol | Pinned: a caller reporting chest pain is told to call emergency services. Prescription renewals go to the pharmacy queue. | "Which queue should this patient message go to?" |
| HR and recruiting | Screening rules for a role | A work permit for the country is required. Age, gender and nationality are never screening criteria. | "Does this application meet the role's must-haves?" |
| Warehouses and manufacturing | Equipment manual: how a robot arm or warehouse robot works, scope key site | Arm A7: its safe zone is 1.5 m around the base, its payload at most 12 kg. On fault E31 (gripper slip), stop, hold the load and call maintenance. Line B: a weld seam with visible porosity fails inspection. | "Is it safe for the arm to start this pick?" ("scope": "site-3") |
| Legal and compliance | Marketing compliance checklist | Pinned: no claim of guaranteed returns. A price claim must show the regular price for the last 30 days. | "Can this ad copy be published?" |
The model applies these rules as facts and rules for the decision, and the response cites which passages it read. The decision stays yours to act on, under your own threshold. See Pinned documents and Scope.
How a request finds its passages#
- Pinned documents first. A document marked pinned is given to every request that names its knowledge base: the rules that must always apply. See Pinned documents.
- Then the passages that match. The request's questions and state are compared with every passage of the knowledge base, both by meaning and by the words they share, and the best ones are kept: 4 by default, up to 20, at most 3 from one document.
- Within the room the request has. Passages are kept whole and fitted to a token budget, so the passages that matched never push a request past the size the model answers fastest unless you ask them to. See Budget.
- Read as facts and rules. The model applies a passage's facts and rules to the case. Your request's
instructionsstill decide what to answer and in which format: a passage that tries to change the task or the questions is read as text, never followed. - Cited in the response.
evidence.knowledgenames every passage the model read: its document, heading and byte offsets in the stored text, so you can show your users which rule a decision rested on.
| Term | What it is |
|---|---|
| Knowledge base | A collection of type text: your documents on one subject. The console shows each one as a folder. A request names one |
| Document | An item of a knowledge base: a title and its text, written as text or made from a file, through the API or the console |
| Passage | A piece of a document of about 200 tokens, cut at its headings and paragraphs. What a request is given and what the response cites (chunk) |
| Pinned | A document every request of its knowledge base gets, whatever it asks |
| Scope | One metadata key, such as mission, that keeps a mission's documents to the requests for that mission |
What it costs: $0.001 per knowledge call, $0.10 per million embedded tokens to index your documents, and $0.00002 per passage (chunk) a month to store them, billed on the monthly storage bill. The free tier includes 200 stored passages and 250,000 indexing tokens a day. An unpaid monthly storage bill ends with your stored items deleted, documents included, as for face collections. See Pricing and your data.
- DocumentsFormats, limits, statuses, pinned documents and scope.Read
- Knowledge in a decisionThe booster's options, filters, citations and budget.Read
- Pricing, deleting and exportingWhat knowledge costs and how to take your data back.Read
- When a rule does not appearWhy a passage was left out, and what to change.Read