Template filling
Have a form or report to fill in from a stack of documents? For every field, Knovas looks for the passages that contain the answer and tells you when it finds none.
Optional feature
Template filling is switched on per customer. If it is off, the call answers 404. Ask your Knovas contact to enable it.
How it works
- You send the list of fields in your template, each with a short description.
- Knovas returns, for every field, the best passages it finds in your documents, with document name, page and the exact words highlighted.
- Your own software (for example your own AI model) reads those passages and writes the values into the form.
Knovas never invents field values. If it cannot find evidence, it says so.
Send your fields
curl -X POST https://api.knovas.ch:8443/secured/fulfill-evidence \
--cert client_cert.pem --key client_key.pem --cacert ca_root_cert.pem \
-H "Content-Type: application/json" \
-d '{
"fields": [
{
"placeholder": "{{BirthYearMother}}",
"type": "year",
"description": "Year of birth of the mother, as a 4-digit year."
},
{
"placeholder": "{{AssessmentType}}",
"type": "dropdown",
"description": "Type of assessment: '\''Initial assessment'\'' or '\''Progress review'\''."
}
],
"scope": {"node_id": "<node id of the case>"}
}'import requests
BASE = "https://api.knovas.ch:8443"
AUTH = dict(
cert=("client_cert.pem", "client_key.pem"), # your certificate and private key
verify="ca_root_cert.pem", # Knovas' certificate
timeout=60,
)
r = requests.post(f"{BASE}/secured/fulfill-evidence", **AUTH, json={
"fields": [
{
"placeholder": "{{BirthYearMother}}",
"type": "year",
"description": "Year of birth of the mother, as a 4-digit year.",
},
{
"placeholder": "{{AssessmentType}}",
"type": "dropdown",
"description": "Type of assessment: 'Initial assessment' or 'Progress review'.",
},
],
"scope": {"node_id": "<node id of the case>"},
})
r.raise_for_status()
for field in r.json()["fields"]:
print(field["placeholder"], field["status"])| Field | What it does |
|---|---|
placeholder | The name of the field in your template. Must be unique. |
type | text, date, year, number, dropdown, checkbox or array. |
description | What belongs in the field. Write it as if briefing a colleague. |
scope | Optional: search only one case (a knowledge graph node) or a list of documents. |
Send the whole template in one request (up to 200 fields). It counts as a single search.
Read the answer
For each field you get a status:
| Status | Meaning |
|---|---|
complete | Evidence was found for everything the field needs. |
partial | Some information is missing. See missing_atoms. |
no_evidence | Nothing relevant was found. Leave the field empty. |
Each piece of evidence contains the passage text, a shorter focus with the most important sentences, the document it came from and the page number. Give your AI model the focus first.
Tips for the best fill rate
- Describe fields in the words your documents use, not the words of the form. If they differ, add a
search_descriptionin document language. - For dropdowns, list every allowed value in single quotes, like
'Progress review'. - Run a second pass. Send the fields again with
refinefor the ones that werepartial, andknown_valueswith the answers you already have. - Tell your AI model to leave a field empty unless the evidence clearly states the value. An empty field is better than a wrong one.
- Using access control? Add
access_groupsso only evidence the user may see is returned.
Questions? Write to contact@knovas.ch.
This page describes Knovas 1.3.0. Last updated .