bkper 5.8.0 → 5.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/agent/bundle/agent-entry.js +3 -3
- package/lib/agent/extensions/bkper-ai-provider.d.ts.map +1 -1
- package/lib/agent/extensions/bkper-ai-provider.js +14 -4
- package/lib/agent/extensions/bkper-ai-provider.js.map +1 -1
- package/lib/agent/interactive/interactive-mode.d.ts +2 -1
- package/lib/agent/interactive/interactive-mode.d.ts.map +1 -1
- package/lib/agent/interactive/interactive-mode.js +5 -0
- package/lib/agent/interactive/interactive-mode.js.map +1 -1
- package/lib/agent/interactive/terminal.d.ts +8 -0
- package/lib/agent/interactive/terminal.d.ts.map +1 -0
- package/lib/agent/interactive/terminal.js +11 -0
- package/lib/agent/interactive/terminal.js.map +1 -0
- package/lib/agent/pi-shared-modules.d.ts +1 -1
- package/lib/agent/pi-shared-modules.d.ts.map +1 -1
- package/lib/agent/pi-shared-modules.js +1 -1
- package/lib/agent/pi-shared-modules.js.map +1 -1
- package/lib/agent/system-prompt.js +1 -1
- package/lib/agent/system-prompt.js.map +1 -1
- package/lib/commands/context/book-context.d.ts +1 -1
- package/lib/commands/context/book-context.js +1 -1
- package/lib/commands/context/domain-context.d.ts +1 -1
- package/lib/commands/context/domain-context.js +1 -1
- package/lib/commands/context/user-context.d.ts +1 -1
- package/lib/commands/context/user-context.js +1 -1
- package/lib/docs/ai/system-one-models.md +329 -0
- package/lib/docs/api/ai-gateway.md +122 -46
- package/lib/docs/api/managed-agent.md +95 -1
- package/lib/docs/apps/ai.md +71 -15
- package/lib/docs/apps/configuration.md +2 -1
- package/lib/docs/apps/context-menu.md +141 -1
- package/lib/docs/apps/development.md +27 -0
- package/lib/docs/apps/overview.md +1 -1
- package/lib/docs/apps/quality.md +1 -1
- package/lib/docs/core/core-concepts.md +1 -1
- package/lib/docs/index.md +4 -4
- package/package.json +1 -1
- package/lib/docs/ai/decision-models.md +0 -158
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pi-shared-modules.js","sourceRoot":"","sources":["../../src/agent/pi-shared-modules.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EACH,cAAc,EACd,GAAG,EACH,UAAU,EACV,4BAA4B,EAC5B,MAAM,EACN,cAAc,EACd,cAAc,EACd,YAAY,EACZ,UAAU,EACV,QAAQ,EACR,eAAe,EACf,YAAY,EACZ,YAAY,GACf,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAC,oBAAoB,EAAC,MAAM,oDAAoD,CAAC"}
|
|
1
|
+
{"version":3,"file":"pi-shared-modules.js","sourceRoot":"","sources":["../../src/agent/pi-shared-modules.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EACH,cAAc,EACd,GAAG,EACH,UAAU,EACV,4BAA4B,EAC5B,MAAM,EACN,cAAc,EACd,cAAc,EACd,YAAY,EACZ,UAAU,EACV,eAAe,EACf,QAAQ,EACR,eAAe,EACf,YAAY,EACZ,YAAY,GACf,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAC,oBAAoB,EAAC,MAAM,oDAAoD,CAAC"}
|
|
@@ -69,7 +69,7 @@ function getCodemodePromptContribution() {
|
|
|
69
69
|
function getBkperCodemodeGuidelines(codemodeDocsPath) {
|
|
70
70
|
return [
|
|
71
71
|
'Use codemode, not shell loops or jq pipelines, to repeat commands across items.',
|
|
72
|
-
`For judgments across many items — rank, score, classify, or filter by sentiment, urgency, relevance, or quality — do not read the items yourself: in one codemode script, load them, run a classifier with models.classify() per item, and return only counts and the selected items. Read ${codemodeDocsPath} first; find classifiers with models.getAvailableOfType("classifier").`,
|
|
72
|
+
`For judgments across many items — rank, score, classify, or filter by sentiment, urgency, relevance, or quality — do not read the items yourself: in one codemode script, load them, run a classifier with models.classify() per item, and return only counts and the selected items. Ask one judgment per question; the script computes amounts, dates, and lookups and combines the answers. Read ${codemodeDocsPath} first; find classifiers with models.getAvailableOfType("classifier").`,
|
|
73
73
|
];
|
|
74
74
|
}
|
|
75
75
|
function buildToolPromptSection(selectedTools) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"system-prompt.js","sourceRoot":"","sources":["../../src/agent/system-prompt.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,wBAAwB,EACxB,uBAAuB,EACvB,wBAAwB,EACxB,8BAA8B,EAC9B,wBAAwB,EACxB,yBAAyB,GAE5B,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE7E,SAAS,wBAAwB,CAAC,UAAoB;IAClD,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;QACjC,IAAI,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;YACxB,OAAO,SAAS,CAAC;QACrB,CAAC;IACL,CAAC;IACD,OAAO,UAAU,CAAC,CAAC,CAAC,CAAC;AACzB,CAAC;AAED,MAAM,mBAAmB,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AAE5D,+FAA+F;AAC/F,SAAS,oBAAoB,CAAC,QAAgB;IAC1C,MAAM,cAAc,GAAG,IAAI,CAAC,IAAI,CAAC,iBAAiB,EAAE,OAAO,EAAE,YAAY,EAAE,QAAQ,CAAC,CAAC;IACrF,MAAM,aAAa,GAAG,IAAI,CAAC,IAAI,CAAC,iBAAiB,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;IAC5E,OAAO,wBAAwB,CAC3B,mBAAmB,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,aAAa,EAAE,cAAc,CAAC,CAC3E,CAAC;AACN,CAAC;AAED,SAAS,sBAAsB,CAAC,IAAwB;IACpD,IAAI,C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AAa,CAAC;;;;;;;;;;;;;;;CAetC,CAAC;AACF,CAAC;AAED,MAAM,CAAC,MAAM,yBAAyB,GAAG,0BAA0B,CAAC;IAChE,MAAM;IACN,MAAM;IACN,MAAM;IACN,OAAO;CACV,CAAC,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type ContextScope } from './platform-context.js';
|
|
2
2
|
import { type PullOptions, type PullOutcome } from './user-context.js';
|
|
3
3
|
/**
|
|
4
|
-
* A Book's agent context clone
|
|
4
|
+
* A Book's agent context clone: its AGENTS.md and
|
|
5
5
|
* `.agents/skills`, shared with everyone who can view the Book; editors publish with a push. Kept beside the user's, in
|
|
6
6
|
* `~/.bkper/books/<bookId>`: the folder names the Book, so nothing else records which Book a clone is.
|
|
7
7
|
*/
|
|
@@ -12,7 +12,7 @@ import path from 'node:path';
|
|
|
12
12
|
import { BOOK_ID, ContextForbiddenError } from './platform-context.js';
|
|
13
13
|
import { getContextRoot, syncContextClone } from './user-context.js';
|
|
14
14
|
/**
|
|
15
|
-
* A Book's agent context clone
|
|
15
|
+
* A Book's agent context clone: its AGENTS.md and
|
|
16
16
|
* `.agents/skills`, shared with everyone who can view the Book; editors publish with a push. Kept beside the user's, in
|
|
17
17
|
* `~/.bkper/books/<bookId>`: the folder names the Book, so nothing else records which Book a clone is.
|
|
18
18
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type ContextScope } from './platform-context.js';
|
|
2
2
|
import { type PullOptions, type PullOutcome } from './user-context.js';
|
|
3
3
|
/**
|
|
4
|
-
* The person's company's agent context clone
|
|
4
|
+
* The person's company's agent context clone: the AGENTS.md and
|
|
5
5
|
* `.agents/skills` of their verified domain, read by everyone in it; only the domain's admin publishes, with a push. Platform
|
|
6
6
|
* takes the domain from Bkper for the signed-in person, so nothing here names it. Kept beside the user's, in
|
|
7
7
|
* `~/.bkper/domain`.
|
|
@@ -12,7 +12,7 @@ import path from 'node:path';
|
|
|
12
12
|
import { ContextForbiddenError } from './platform-context.js';
|
|
13
13
|
import { getContextRoot, syncContextClone } from './user-context.js';
|
|
14
14
|
/**
|
|
15
|
-
* The person's company's agent context clone
|
|
15
|
+
* The person's company's agent context clone: the AGENTS.md and
|
|
16
16
|
* `.agents/skills` of their verified domain, read by everyone in it; only the domain's admin publishes, with a push. Platform
|
|
17
17
|
* takes the domain from Bkper for the signed-in person, so nothing here names it. Kept beside the user's, in
|
|
18
18
|
* `~/.bkper/domain`.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type GitRunner } from '../apps/git/run-git.js';
|
|
2
2
|
import { type ContextScope, type PlatformContextApi } from './platform-context.js';
|
|
3
3
|
/**
|
|
4
|
-
* The user's agent context clone
|
|
4
|
+
* The user's agent context clone: AGENTS.md and `.agents/skills`, shared
|
|
5
5
|
* with all of the user's agents. A push publishes; a pull brings what others published.
|
|
6
6
|
*/
|
|
7
7
|
export declare const USER_CONTEXT_SCOPE: ContextScope;
|
|
@@ -13,7 +13,7 @@ import path from 'node:path';
|
|
|
13
13
|
import { runGit } from '../apps/git/run-git.js';
|
|
14
14
|
import { createPlatformContextApi } from './platform-context.js';
|
|
15
15
|
/**
|
|
16
|
-
* The user's agent context clone
|
|
16
|
+
* The user's agent context clone: AGENTS.md and `.agents/skills`, shared
|
|
17
17
|
* with all of the user's agents. A push publishes; a pull brings what others published.
|
|
18
18
|
*/
|
|
19
19
|
export const USER_CONTEXT_SCOPE = 'user';
|
|
@@ -0,0 +1,329 @@
|
|
|
1
|
+
# System One Models
|
|
2
|
+
|
|
3
|
+
A System One model answers typed questions about one input, called the state, such as a bank line or a supplier email. It writes no text. Each answer comes back in a shape you set in advance, with a probability or confidence your code can compare.
|
|
4
|
+
|
|
5
|
+
Every question has a type, and the types come in two families:
|
|
6
|
+
|
|
7
|
+
- **Decision questions judge.** Is this bank line already recorded? Which Account fits it?
|
|
8
|
+
- **Extraction questions read values.** What are the invoice number, the total, and the issue date? They also estimate uncertain numbers, such as days until an invoice is paid.
|
|
9
|
+
|
|
10
|
+
Each model answers the question types it lists: Jev and Clef answer decision questions, and Clairic answers extraction questions. See [Models](#models).
|
|
11
|
+
|
|
12
|
+
All of them use one endpoint, `POST /v1/systemone`, which follows Open System One, an open specification for System One model APIs. Why this shape suits accounting is covered in [AI Fundamentals](https://bkper.com/docs/ai/fundamentals.md#system-one-models).
|
|
13
|
+
|
|
14
|
+
## When to use one
|
|
15
|
+
|
|
16
|
+
| Your software needs | Ask |
|
|
17
|
+
| ----------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- |
|
|
18
|
+
| A yes or no, one of known options, or a level on a scale | A [decision question](#decision-questions) |
|
|
19
|
+
| A value read from a document, such as an invoice number, a total, or a date | An [extraction question](#extraction-questions) |
|
|
20
|
+
| A likely range for an uncertain number, such as days until an invoice is paid | An [extraction question](#extraction-questions) |
|
|
21
|
+
| Text, explanations, code, tool calls, or a custom JSON object | A [language model](https://bkper.com/docs/ai/models.md) |
|
|
22
|
+
| A conversation that works on Books, computes, and delivers files | An agent: [Bkper Agent](https://bkper.com/docs/ai/bkper-agent.md), or the [Managed Agent API](https://bkper.com/docs/api/managed-agent.md) in your app |
|
|
23
|
+
|
|
24
|
+
## Where you use them
|
|
25
|
+
|
|
26
|
+
- **In [Bkper CLI Agent](https://bkper.com/docs/ai/bkper-cli-agent.md#what-it-can-do)**, with no setup. Describe the outcome, such as "suggest Accounts for these bank lines and show me only the unsure ones", and the agent asks a System One model for you.
|
|
27
|
+
- **In apps and scripts**, with `POST /v1/systemone`, or with TypeSafe's SDK for decision questions. See [Add Bkper AI to an App](https://bkper.com/docs/platform/apps/ai.md#ask-a-system-one-model).
|
|
28
|
+
- **In open-source apps you can read.** The [Report app](https://github.com/bkper/bkper-apps/tree/main/report) breaks a report request into small judgments, such as which group and which period, and combines them in code. The [Merge Duplicates app](https://github.com/bkper/bkper-apps/tree/main/merge-duplicates) uses Jev to suggest duplicate pairs for a person to review.
|
|
29
|
+
|
|
30
|
+
## Models read and judge; code calculates
|
|
31
|
+
|
|
32
|
+
A System One model reads and judges. Your code does everything that must be exact:
|
|
33
|
+
|
|
34
|
+
- **The model** judges, such as which Account fits; reads values, such as an invoice total; and estimates uncertain numbers.
|
|
35
|
+
- **Your code** does arithmetic, totals, balances, amount matching, date windows, and thresholds; combines answers and facts into the decision; and makes every write to a Book.
|
|
36
|
+
|
|
37
|
+
The model never decides: it judges or reads, and your code decides.
|
|
38
|
+
|
|
39
|
+
An extraction question can also ask for a simple computed value, such as a due date from an issue date and payment terms. When a value feeds a Book, ask for its inputs and compute it in code: code gives the same answer every time, and a person can audit it.
|
|
40
|
+
|
|
41
|
+
An answer is a judgment or a reading, not permission to change a Book. When code posts, it records a normal Transaction, so the Book stays zero-sum whatever the model answered. Store the model revision, the rule that decided, and the answers it used as Transaction properties for the audit trail.
|
|
42
|
+
|
|
43
|
+
## Design a workflow
|
|
44
|
+
|
|
45
|
+
Design the decision in code first, then ask only the questions it needs.
|
|
46
|
+
|
|
47
|
+
1. **Start from what code will do.**
|
|
48
|
+
|
|
49
|
+
List the actions, such as post, review, or skip, and write when each one happens, in priority order. These rules are the decision, and they live in code.
|
|
50
|
+
|
|
51
|
+
2. **Sort each condition into facts and judgments.**
|
|
52
|
+
|
|
53
|
+
- **A fact** is anything code can look up or compute exactly: amounts, dates, matches, balances, and Book and Account properties. A value read by an extraction question becomes a fact once code checks it.
|
|
54
|
+
- **A judgment** is what a knowledgeable person tells at a glance: what an item is, which Account fits, whether two entries record the same purchase.
|
|
55
|
+
|
|
56
|
+
Code gathers the item and the context a person would need, such as nearby Transactions or how an Account is usually described, and passes them as named fields, such as `bank_line` and `existing_transaction`. Facts can also be images, such as a receipt photo. Convert PDFs and other files to text or images first.
|
|
57
|
+
|
|
58
|
+
3. **Ask one question per judgment.**
|
|
59
|
+
|
|
60
|
+
Ask what an item is, never what to do with it. "Which Account fits?" is one judgment; "Post, review, or skip?" is the whole decision. Criteria only describe the options: amounts, dates, Book data, and which option wins belong in code. Write each question in full: the model sees your instructions and the state, never the name your code gives the question.
|
|
61
|
+
|
|
62
|
+
4. **Set thresholds by risk.**
|
|
63
|
+
|
|
64
|
+
Decide how sure the model must be before code acts. A missed suggestion costs a person a few seconds; a duplicate posting misstates a Book. Keep thresholds in one reviewable place.
|
|
65
|
+
|
|
66
|
+
5. **Combine in code, and record why.**
|
|
67
|
+
|
|
68
|
+
Code applies the rules in order to the answers and facts, acts when confident, and routes the rest to a person. This is TypeSafe's [confidence-gated routing](https://docs.typesafe.ai/patterns/confidence-routing) pattern. Log the rule that fired with the answers and facts it used: when an item goes the wrong way, you can tell whether a judgment or a rule was wrong.
|
|
69
|
+
|
|
70
|
+
6. **Measure and adjust.**
|
|
71
|
+
|
|
72
|
+
Start with conservative thresholds and test them against your own records. Re-check them when the model's revision changes. To handle a new case, add a rule and, only if it needs one, a question: each question is answered independently, so existing answers and thresholds still hold.
|
|
73
|
+
|
|
74
|
+
### Example: a bank line
|
|
75
|
+
|
|
76
|
+
A bank line arrives: `AMAZON MKTPL*2K4LM`, 89.90 out of Checking. Code matches amounts and dates and finds a manual entry from the day before, "Printer toner, Amazon order 114-2K4LM". Those are facts. Then it asks for three judgments at once:
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
curl --fail-with-body https://ai.bkper.app/v1/systemone \
|
|
80
|
+
-H "Authorization: Bearer ${BKPER_TOKEN}" \
|
|
81
|
+
-H "Content-Type: application/json" \
|
|
82
|
+
-H "bkper-ai-source: my-app" \
|
|
83
|
+
--data '{
|
|
84
|
+
"model": "jev",
|
|
85
|
+
"state": {
|
|
86
|
+
"bank_line": {
|
|
87
|
+
"date": "2025-03-11",
|
|
88
|
+
"description": "AMAZON MKTPL*2K4LM",
|
|
89
|
+
"amount": 89.90,
|
|
90
|
+
"direction": "money out of Checking"
|
|
91
|
+
},
|
|
92
|
+
"existing_transaction": {
|
|
93
|
+
"date": "2025-03-10",
|
|
94
|
+
"amount": 89.90,
|
|
95
|
+
"from": "Checking",
|
|
96
|
+
"to": "Office Supplies",
|
|
97
|
+
"description": "Printer toner, Amazon order 114-2K4LM",
|
|
98
|
+
"origin": "manual entry"
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
"questions": {
|
|
102
|
+
"account": {
|
|
103
|
+
"type": "choice",
|
|
104
|
+
"instructions": "Which Account should receive the money that left Checking in `bank_line`?",
|
|
105
|
+
"criteria": {
|
|
106
|
+
"Cloud Hosting": "Servers, cloud infrastructure, storage, and hosting providers",
|
|
107
|
+
"Software Subscriptions": "SaaS tools and per-seat software licenses",
|
|
108
|
+
"Office Supplies": "Physical supplies and equipment for the office",
|
|
109
|
+
"Travel": "Flights, hotels, ground transport, and meals while traveling"
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
"already_recorded": {
|
|
113
|
+
"type": "noul",
|
|
114
|
+
"instructions": "Does `existing_transaction` already record the movement in `bank_line`?"
|
|
115
|
+
},
|
|
116
|
+
"unusual": {
|
|
117
|
+
"type": "score",
|
|
118
|
+
"instructions": "How unusual is `bank_line` as a business expense?",
|
|
119
|
+
"criteria": [
|
|
120
|
+
"Routine: a common business expense",
|
|
121
|
+
"Unusual: plausible, but uncommon for a business",
|
|
122
|
+
"Suspicious: looks like fraud, an error, or a personal expense"
|
|
123
|
+
]
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}'
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
Jev and Clef answered:
|
|
130
|
+
|
|
131
|
+
| Question | Jev | Clef |
|
|
132
|
+
| ------------------ | ------------------------------ | -------------------------------- |
|
|
133
|
+
| `account` | Office Supplies, confidence 1 | Office Supplies, confidence 0.95 |
|
|
134
|
+
| `already_recorded` | Yes, with probability 0.91 | Yes, with probability 0.94 |
|
|
135
|
+
| `unusual` | 0.17, Routine; confidence 0.74 | 0.29, Routine; confidence 0.45 |
|
|
136
|
+
|
|
137
|
+
Code then decides, with the rules in priority order:
|
|
138
|
+
|
|
139
|
+
```ts
|
|
140
|
+
// Keep thresholds in one reviewable place.
|
|
141
|
+
const DUPLICATE_THRESHOLD = 0.8;
|
|
142
|
+
const LARGE_AMOUNT = 1000;
|
|
143
|
+
const UNUSUAL_SCORE_THRESHOLD = 0.5;
|
|
144
|
+
const AUTO_POST_CONFIDENCE = 0.9;
|
|
145
|
+
|
|
146
|
+
interface BankLineAnswers {
|
|
147
|
+
account: { type: 'choice'; choice: string; confidence: number };
|
|
148
|
+
already_recorded: { type: 'noul'; noul: number };
|
|
149
|
+
unusual: { type: 'score'; score: number; confidence: number };
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
interface BankLineFacts {
|
|
153
|
+
amount: number;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
type BankLineDecision =
|
|
157
|
+
| { action: 'check-duplicate'; rule: 'already-recorded' }
|
|
158
|
+
| {
|
|
159
|
+
action: 'review';
|
|
160
|
+
rule: 'large-amount' | 'unusual' | 'unsure-account';
|
|
161
|
+
suggestedAccount: string;
|
|
162
|
+
}
|
|
163
|
+
| { action: 'post'; rule: 'confident-account'; toAccount: string };
|
|
164
|
+
|
|
165
|
+
// The first rule that matches decides.
|
|
166
|
+
export function decideBankLine(
|
|
167
|
+
answers: BankLineAnswers,
|
|
168
|
+
facts: BankLineFacts,
|
|
169
|
+
): BankLineDecision {
|
|
170
|
+
const account = answers.account.choice;
|
|
171
|
+
if (answers.already_recorded.noul >= DUPLICATE_THRESHOLD) {
|
|
172
|
+
return { action: 'check-duplicate', rule: 'already-recorded' };
|
|
173
|
+
}
|
|
174
|
+
if (facts.amount >= LARGE_AMOUNT) {
|
|
175
|
+
return { action: 'review', rule: 'large-amount', suggestedAccount: account };
|
|
176
|
+
}
|
|
177
|
+
if (answers.unusual.score >= UNUSUAL_SCORE_THRESHOLD) {
|
|
178
|
+
return { action: 'review', rule: 'unusual', suggestedAccount: account };
|
|
179
|
+
}
|
|
180
|
+
if (answers.account.confidence < AUTO_POST_CONFIDENCE) {
|
|
181
|
+
return { action: 'review', rule: 'unsure-account', suggestedAccount: account };
|
|
182
|
+
}
|
|
183
|
+
return { action: 'post', rule: 'confident-account', toAccount: account };
|
|
184
|
+
}
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
Both answers return `check-duplicate` by the `already-recorded` rule: the movement is probably already recorded, so code posts nothing. When code does post, it records a Transaction from Checking to the chosen Account. The risks to control are a duplicate movement and a wrong Account: the duplicate rule runs first, and code posts only when no other rule matches.
|
|
188
|
+
|
|
189
|
+
Whether an amount is large is a fact, so code checks it against `LARGE_AMOUNT` and no question mentions amounts. Asked whether 89.90 is large, the model could only guess what large means for this Book.
|
|
190
|
+
|
|
191
|
+
Context changes confidence. Asked about the bank line alone, without the manual entry, Jev still chose Office Supplies, but with confidence 0.77 and 0.12 on Software Subscriptions, so `decideBankLine` sends the line to review. Give the model the context a person would need.
|
|
192
|
+
|
|
193
|
+
For more designs, see TypeSafe's [Patterns](https://docs.typesafe.ai/patterns) and [Cookbooks](https://docs.typesafe.ai/cookbooks).
|
|
194
|
+
|
|
195
|
+
## Decision questions
|
|
196
|
+
|
|
197
|
+
Each decision question gets one typed answer:
|
|
198
|
+
|
|
199
|
+
| Ask | Example | You get |
|
|
200
|
+
| ---------------------------------- | ------------------------------------------ | -------------------------------------------------- |
|
|
201
|
+
| **Is this true?** (`noul`) | Is this bank line already recorded? | The probability of yes, from 0 to 1 |
|
|
202
|
+
| **Which one of these?** (`choice`) | Which Account should receive this payment? | One of your options, with a confidence from 0 to 1 |
|
|
203
|
+
| **Where on this scale?** (`score`) | How unusual is this expense? | A position on your levels, with a confidence |
|
|
204
|
+
|
|
205
|
+
Confidence is high when the model's probability concentrates on one answer. For _Is this true?_, the probability itself is the signal. Ask several questions about the same state in one request; the model answers each one independently.
|
|
206
|
+
|
|
207
|
+
Open System One also defines `box`, which locates something in an image. Bkper AI does not support it.
|
|
208
|
+
|
|
209
|
+
## Extraction questions
|
|
210
|
+
|
|
211
|
+
Each extraction question names the value to read and its type:
|
|
212
|
+
|
|
213
|
+
| Type | Example | You get |
|
|
214
|
+
| ---------- | -------------------------------------- | -------------------------------------------------------- |
|
|
215
|
+
| `text` | Invoice number | Text copied from the state |
|
|
216
|
+
| `number` | Invoice total | A number, with optional `unit`, `integer`, and `decimals` |
|
|
217
|
+
| `date` | Issue date | `YYYY-MM-DD` |
|
|
218
|
+
| `time` | Delivery time | 24-hour `HH:MM` or `HH:MM:SS` |
|
|
219
|
+
| `datetime` | Delivery date and time | `YYYY-MM-DDTHH:MM:SS`, with an offset only when the state gives one |
|
|
220
|
+
| `duration` | How long unloading takes | A number in the question's `unit`, `seconds` by default |
|
|
221
|
+
| `list` | Each monthly invoice amount | Every match of the `items` type, in input order |
|
|
222
|
+
| `estimate` | Days until this invoice is paid | A likely range between your `min` and `max` |
|
|
223
|
+
| `forecast` | Amounts of the next monthly invoices | One estimate per step, for `horizon` steps |
|
|
224
|
+
|
|
225
|
+
Extraction answers come with rules your code can rely on:
|
|
226
|
+
|
|
227
|
+
- **Nulls.** A value answer has `value`, `p_null`, the probability that the state has no such value, and `confidence`. `value` is `null` when `p_null` is above the question's `null_threshold`, 0.5 by default. `guess`, the most likely value, is still there, so a person can check it.
|
|
228
|
+
- **Spans.** `span` points at the text the model read: a half-open `[start, end)` range of Unicode code point offsets. It indexes into `state_text` when the response has one, such as for JSON state, and into `state` otherwise. Use it to highlight the source for a reviewer. Computed values, and values read from images, have no span.
|
|
229
|
+
- **Lists** are never `null`: no match is an empty list.
|
|
230
|
+
- **Estimates** are never `null`. They return `median`, with `p10` and `p90` bounding the likely range, all within `[min, max]` and on the `step` grid. Set `quantiles: true` to also get the 1st to 99th percentiles. A forecast returns exactly `horizon` estimates in `steps`, nearest first.
|
|
231
|
+
- **Truncation.** `truncated: true` means the model read only the start of the state. Send such items to review, or split the state.
|
|
232
|
+
- **Reference date.** Send `reference_date`, as `YYYY-MM-DD`, to resolve relative and year-less dates, such as "March 9".
|
|
233
|
+
|
|
234
|
+
### Example: a supplier email
|
|
235
|
+
|
|
236
|
+
This request body reads a supplier email. Send it to `POST /v1/systemone` like the bank-line request:
|
|
237
|
+
|
|
238
|
+
```json
|
|
239
|
+
{
|
|
240
|
+
"model": "clairic",
|
|
241
|
+
"state": "Hi, this is Marta Silva from Acme Paper. Invoice AP-5531 for 3 boxes of A4 paper is attached: total $184.50, issued 2026-03-02 with net 30 terms. Delivery is booked for March 9 at 10:15 am, and unloading takes about 40 minutes. Our last four monthly invoices were $172.00, $178.25, $181.10 and $184.50.",
|
|
242
|
+
"reference_date": "2026-03-05",
|
|
243
|
+
"questions": {
|
|
244
|
+
"invoice_number": { "type": "text", "instructions": "Invoice number" },
|
|
245
|
+
"total": {
|
|
246
|
+
"type": "number",
|
|
247
|
+
"decimals": 2,
|
|
248
|
+
"unit": "USD",
|
|
249
|
+
"instructions": "Invoice total"
|
|
250
|
+
},
|
|
251
|
+
"issue_date": { "type": "date", "instructions": "Invoice issue date" },
|
|
252
|
+
"days_to_pay": {
|
|
253
|
+
"type": "estimate",
|
|
254
|
+
"min": 0,
|
|
255
|
+
"max": 90,
|
|
256
|
+
"step": 1,
|
|
257
|
+
"instructions": "Days after issue until this invoice is paid"
|
|
258
|
+
},
|
|
259
|
+
"po_number": {
|
|
260
|
+
"type": "text",
|
|
261
|
+
"instructions": "Purchase order number"
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
Clairic answered:
|
|
268
|
+
|
|
269
|
+
| Question | Answer |
|
|
270
|
+
| ---------------- | --------------------------------------------------------------------------------------------------- |
|
|
271
|
+
| `invoice_number` | `AP-5531`, read at span `[49, 56]` |
|
|
272
|
+
| `total` | `184.5` |
|
|
273
|
+
| `issue_date` | `2026-03-02` |
|
|
274
|
+
| `days_to_pay` | Median 30, between 24 and 32 |
|
|
275
|
+
| `po_number` | `null`, with `p_null` close to 1: the email has no purchase order number. The `guess`, `AP-5531`, is the invoice number. |
|
|
276
|
+
|
|
277
|
+
Code computes the due date from the issue date and the 30-day terms, and checks the total against the invoice lines before it records anything.
|
|
278
|
+
|
|
279
|
+
## Models
|
|
280
|
+
|
|
281
|
+
Each model lists the question types it answers in `question_types` in the [`GET /v1/models`](https://ai.bkper.app/v1/models) catalog. Choose a model that answers every question type in your request; any other type returns `unsupported_question_type`. Thresholds tuned on one model do not carry over to another, so test each on your own records.
|
|
282
|
+
|
|
283
|
+
| | Jev, by TypeSafe | Clef, by Cloudflare | Clairic, by Cloudflare |
|
|
284
|
+
| ------------------------------- | -------------------------- | --------------------------- | ------------------------------------------------------------------------------- |
|
|
285
|
+
| Model ID | `jev` | `clef` | `clairic` |
|
|
286
|
+
| Question types | `noul`, `choice`, `score` | `noul`, `choice`, `score` | `text`, `number`, `date`, `time`, `datetime`, `duration`, `list`, `estimate`, `forecast` |
|
|
287
|
+
| State and questions per request | Up to 32,768 tokens | Up to 65,536 tokens | Up to 65,536 tokens; longer state is truncated |
|
|
288
|
+
| Images | PNG and JPEG, experimental | Up to 4: PNG, JPEG, or WebP | Up to 4: PNG, JPEG, or WebP |
|
|
289
|
+
| Status | Available | Available | Preview |
|
|
290
|
+
|
|
291
|
+
For decision questions, start with Jev: it has the lower [usage rate](https://bkper.com/docs/ai/models.md#usage-rates). Choose Clef when the state and questions exceed Jev's limit, or when you send WebP images. For extraction questions, use Clairic.
|
|
292
|
+
|
|
293
|
+
### Jev
|
|
294
|
+
|
|
295
|
+
- **Versions.** `jev-latest` and versioned IDs are accepted but always select the current Jev; you cannot pin a version. Log the revision each answer reports, and re-check tuned thresholds when it changes.
|
|
296
|
+
- **Language.** English is Jev's primary training language; other languages work with lower accuracy.
|
|
297
|
+
- **Images.** An experimental TypeSafe feature, so accuracy and limits can change. Send PNG or JPEG images between 280 and 1568 pixels per side as base64 `assets` in a JSON request; TypeSafe's SDKs upload images in a form Bkper AI does not accept. Image tokens count as input. See TypeSafe's [Images](https://docs.typesafe.ai/images) guide.
|
|
298
|
+
- **Known weak spots.** Literal reading, arithmetic, date comparison, and large states full of irrelevant detail. See [Jev 1.13 jaggedness](https://docs.typesafe.ai/model-jaggedness/jev-1.13).
|
|
299
|
+
|
|
300
|
+
### Clef
|
|
301
|
+
|
|
302
|
+
- **Limits.** Up to 64 questions per request and at least 2 options per `choice` question. Up to 4 images of 4 MiB each, 8 MiB in total, read before the state.
|
|
303
|
+
|
|
304
|
+
### Clairic
|
|
305
|
+
|
|
306
|
+
- **Preview.** Its answers and limits can change before general availability.
|
|
307
|
+
- **Limits.** Question names of up to 64 characters and forecasts of up to 64 steps. Up to 4 images of 4 MiB each, 8 MiB in total.
|
|
308
|
+
|
|
309
|
+
## Common mistakes
|
|
310
|
+
|
|
311
|
+
- **Asking the model to calculate.** Match amounts, compute dates, and check balances in code.
|
|
312
|
+
- **Asking for the decision.** Ask what an item is, such as which Account fits, not what to do with it, such as post or review. Ask one judgment or one value per question, and combine the answers in code.
|
|
313
|
+
- **Writing rules into criteria.** If a criterion mentions an amount, a date, Book data, another option, or which option wins, such as "even if" or "not if", that part is a rule: move it to code.
|
|
314
|
+
- **Putting the question in its name.** The model never sees question IDs. Write the full question in its instructions.
|
|
315
|
+
- **Treating answers as verdicts.** A probability of yes is not a boolean, and a score can fall between levels. Compare both with thresholds.
|
|
316
|
+
- **Ignoring nulls and guesses.** A `null` value is an answer: the state probably lacks it. Show the `guess` to a person instead of discarding it.
|
|
317
|
+
- **Expecting an explanation.** System One models return no text. Use a [language model](https://bkper.com/docs/ai/models.md) when you need one.
|
|
318
|
+
- **Sending a language-model request.** A System One request carries only the model, the state, the questions, image `assets`, and `reference_date` for extraction questions. See the [request rules](https://bkper.com/docs/api/ai-gateway.md#decision-request).
|
|
319
|
+
|
|
320
|
+
## Next steps
|
|
321
|
+
|
|
322
|
+
- [Add Bkper AI to an App](https://bkper.com/docs/platform/apps/ai.md#ask-a-system-one-model) — call System One models from an app Worker, a script, or a browser.
|
|
323
|
+
- [AI Gateway API: decision questions](https://bkper.com/docs/api/ai-gateway.md#decision-questions) — the request, answer guarantees, errors, and compatibility with TypeSafe.
|
|
324
|
+
- [AI Gateway API: extraction questions](https://bkper.com/docs/api/ai-gateway.md#extraction-questions) — question settings, limits, and answer guarantees.
|
|
325
|
+
- [Open System One](https://github.com/bkper/open-systemone) — the open specification behind `POST /v1/systemone`: question types, answer guarantees, and errors.
|
|
326
|
+
- [Models and Usage](https://bkper.com/docs/ai/models.md) — usage rates, the allowance, and privacy.
|
|
327
|
+
- Building with a coding agent? Point it to this page for design, and to `https://bkper.com/docs/api/ai-gateway.md` for the endpoint, authentication, and errors. TypeSafe's [agent skill](https://docs.typesafe.ai/agent-skill) adds questions and patterns for decision questions.
|
|
328
|
+
- TypeSafe: [System One](https://docs.typesafe.ai/concepts/system-one), [How to build with System One](https://docs.typesafe.ai/concepts/how-to-build-with-system-one), [State](https://docs.typesafe.ai/concepts/state), [Confidence](https://docs.typesafe.ai/confidence), and [Patterns](https://docs.typesafe.ai/patterns).
|
|
329
|
+
- [Back to AI overview](https://bkper.com/docs/ai.md).
|