knowledge / README.md
mkschreder123's picture
Upload folder using huggingface_hub
c3a45c0 verified
|
Raw History Blame Contribute Delete
23 kB
metadata
license: cc-by-4.0
language:
  - en
pretty_name: Knowledge
tags:
  - knowledge-base
  - agents
  - procedures

Knowledge

A small, human-reviewable collection of working knowledge for agents: principles, step-by-step procedures, one worked example per page and the mistakes to avoid. It covers how to work a task with tools, exact calculation with money and dates, bookkeeping, contract work, support-desk casework and the application of short written rules.

It teaches method. It is not an answer key for any task collection, and every figure, name and date in its examples is invented.

Swedish Embedded AB implements solutions for teaching small language-model agents professional procedures from written, reviewable knowledge for its clients. If your team needs expertise in agent knowledge bases and their evaluation then you can procure our services by sending an email to info@swedishembedded.com.

Status: version 0.3, not yet reviewed by a human domain expert. The reviewer index below lists what to check.

How an agent uses it

The collection is a directory of plain Markdown. An agent needs only its location and ordinary tools (ls, grep, cat, a file reader):

  1. read index.md at the top, which maps what a task asks for to a page;
  2. or read a folder's index.md, or grep for a word of the task;
  3. read the one or two pages that apply, and state each rule in its own words before acting.

Mount it read-only, outside the task workspace, without a .git directory. The pages refer to each other as /knowledge/<folder>/<page>.md; tools/kb.py export --mount-path <path> rewrites that prefix for another mount point. README.md, tools/ and .git are for maintainers and are not part of what an agent should see: mount an export, not the clone.

Conventions (followed here; nothing depends on them)

Any knowledge collection is interchangeable with this one as long as it is a directory an agent can traverse. The conventions this collection follows:

  • an index.md in every folder, written as "when the task asks X, read this page";
  • plain Markdown that is easy to grep, ASCII punctuation, lowercase file names;
  • optional YAML front-matter (here: SPDX line, copyright, title, tiers);
  • every page in one order: Rule, Procedure (numbered steps), Worked example, Common mistakes;
  • a first rule on every page that the task's own files and stated rules win over the page;
  • every page between about 600 and one thousand tokens, the root index at most about twelve hundred;
  • rules written so that a reader can restate each one in a sentence or two;
  • no page tells the reader to cite a file or a path.

No harness, examiner or learner may rely on these folder names, the front-matter or the tiers.

Tiers (an experiment convenience)

Each section of a page is preceded by a marker <!-- tier: N -->:

Tier Sections Meaning
1 Rule principles only
2 Procedure, Common mistakes plus procedures and self-checks
3 Worked example plus worked examples

An experiment that wants a subset builds a filtered copy; agents and harnesses never parse tiers:

python3 tools/kb.py export --out /path/to/copy                 # everything (the default use)
python3 tools/kb.py export --out /path/to/copy --max-tier 1    # rules only
python3 tools/kb.py export --out /path/to/copy --max-tier 2    # rules, procedures, mistakes

Maintenance checks

python3 tools/kb.py lint                 # headers, sections, links, index coverage, token budgets
python3 tools/kb.py audit DIR...         # leakage self-audit against practice-instance text
  • Token budget. Tokens are approximated as whitespace-separated words x 1.3. This undercounts code blocks and tables somewhat; a tokenizer-exact check belongs to whoever mounts the collection for a specific model.
  • Leakage self-audit. audit compares every page with text a student sees in practice instances (requests and workspace files): numbers with more than three digits before the decimal point, identifiers, ISO dates, names the instances never write in lower case, and any shared sequence of eight words. It is a self-check by the author. It cannot see sealed examination material, and it is not the examiner's contamination audit.

Provenance

  • Written on 20 November 2026 by an AI assistant (Claude, Anthropic) working as a domain author under the direction of Martin Schröder. No human domain expert has reviewed it yet.
  • Inputs that were allowed and used: the public task documentation and READMEs of the task collections it was first written for; practice instances drawn by the author, of which only the request and the workspace files a student sees were read; recorded practice attempts of a small model, of which only the agent's side (requests, tool calls, answers) and the pass or fail status of a whole attempt were read; general domain knowledge.
  • Inputs that were forbidden and not opened: verifier, oracle and grader code; generators' answer logic; reference solutions; sealed examinations and anything in an examiner's private directories; seed files; per-check verification results.
  • Consequence: the pages are grounded in what the tasks ask and in the mistakes actually observed, but no page was checked against a grader. Where a page takes a position that a grader might score differently, it is marked REVIEW: below.
  • Version 0.2 reworded three phrases that matched public task instruction text (found by the examiner's audit; no content change).
  • Version 0.3 (20 November 2026) makes every page defer to the task. Evidence, train-side only: a practice measurement in which preloading the bookkeeping and calculation pages lowered the pass rate on VAT and accrued-cost tasks, and the agent side of those practice attempts. What the attempts showed, in general terms:
    1. the worked example was read as a description of the task: the model expected the task's file to have the example's mix of cases, "saw" a date in an empty field, and reduced its answer to the example's single expense account;
    2. a generic rule about cents and currency made the model decide that plainly decimal input amounts were in another unit and rescale them;
    3. "amount x rate" on the page met a rate table in percent, and the model divided by 100 twice or doubted its correct result;
    4. a page covering three kinds of adjustment made the model look for the two kinds the task had no inputs for;
    5. restating a rule the request already states gave the model two sources to reconcile, and the attempts with pages took about two to four times as many steps, many of them ending without an answer. Changes: a first rule on every page ("The task's own files and stated rules always win over this page; use this page only for what the task leaves open"); the same in the index and the workflow page; a fixed disclaimer above every worked example; the period-end page split into three single-purpose pages whose examples show several accounts and mixed cases; the money and VAT pages rewritten around "use the request's method as written"; default counting rules on the dates and limits pages marked as applying only where the task is silent; mistake lists shortened to keep the token budget.
  • Direction of information. An examiner may read this collection freely. Nothing from an examiner's oracles, seeds or item-level results may flow into it. Revisions are made only from train-side evidence, and each revision gets a new version tag.

Reviewer index

For each file: the real-world authority it summarises, the claims a human should check (REVIEW:), and the resources that would strengthen it. Sizes are from tools/kb.py lint.

agent-workflow/workflow.md (how to work any task with tools)

  • Authority: engineering practice for tool-using agents; no formal standard.
  • REVIEW: the rule "never clean or reset the repository" and "delete your helper files" assume a workspace graded by its final file state. Confirm for each harness.
  • REVIEW: the budget rule (write an answer when half the steps are gone) is a heuristic.
  • REVIEW: "never search the repository history" matches the examiner's anti-probing rule as publicly documented; confirm the exact boundary (is git status acceptable?).
  • Resources wanted: the harness's tool definitions and step and token limits, so the page can be checked against them; the examiner's public statement of what counts as probing.

agent-workflow/answer-file.md (JSON answer files)

  • Authority: RFC 8259 (JSON); Python json and decimal documentation.
  • REVIEW: writing money as a JSON number through float() is safe for two-decimal values only if the grader compares in whole cents. Confirm, or prescribe numeric strings.
  • Resources wanted: the answer-format conventions of each task collection.

agent-workflow/missing-information.md (abstaining correctly)

  • Authority: professional scepticism in auditing (ISA 200, ISA 500 on sufficiency of evidence); burden-of-proof reasoning in law.
  • REVIEW: "a total over an unknown line is unknown" follows the task wording seen in practice; a different collection may want partial totals.
  • Resources wanted: an audit-evidence standard extract; internal rules on incomplete filings.

calculation/money.md

  • Authority: IEEE 754 (why binary floats misround); the EU VAT Directive 2006/112/EC (output and input tax); national VAT rounding guidance; commercial rounding ("round half up").
  • REVIEW: since version 0.3 the page states no default rounding or unit: "use the task's formula, rounding and units as written", "take input amounts as they stand", "a percent rate is divided by 100 exactly once". The cents-against-currency rule was removed from this page (it stays on the support pages, where records really are in cents).
  • REVIEW: the interest formula uses simple interest over a stated year length; check against the applicable interest act (in Sweden, Rantelagen 1975:635: reference rate plus eight percentage points, actual days).
  • Resources wanted: Skatteverket guidance on VAT calculation and rounding; the interest act and the current reference rate.

calculation/dates.md

  • Authority: conventions of period computation, for example Regulation (EEC, Euratom) 1182/71 on periods, dates and time limits; in Sweden, lagen (1930:173) om berakning av lagstadgad tid; the ISO date notation.
  • REVIEW: "a period starts the day after its trigger" and "month periods end on the same day number, clamped" are the common rules; some statutes differ.
  • REVIEW: rolling to the next business day is stated as conditional on the task; real law usually rolls performance deadlines and not limitation periods, but there are exceptions.
  • REVIEW: the notice-period convention (count from the first day of the following month) is a contractual convention, not a general rule.
  • Resources wanted: the period-computation statute that applies; the organisation's own business-day calendar rules.

calculation/limits.md

  • Authority: legal drafting conventions for thresholds; contract practice on liquidated damages per commenced week.
  • REVIEW: "within N" is treated as inclusive of day N; confirm for the governing drafting style.
  • REVIEW: the look-back window is taken as inclusive at both ends.
  • REVIEW: "a threshold stated in weeks is tested in days as weeks x 7" follows the rule table seen in practice; a contract may define it differently.
  • Resources wanted: a drafting manual (for example a government legislative drafting guide) for threshold wording.

accounting/bank-reconciliation.md

  • Authority: standard bank-reconciliation practice as taught in introductory financial accounting; internal-control guidance (COSO) on reconciliations.
  • REVIEW: the page assumes the bank is right when amounts differ (transpositions are book errors). Bank errors exist in practice and are not covered.
  • REVIEW: "a duplicate is reported as the later entry" is a task convention.
  • REVIEW: matching by description rather than date assumes descriptions carry a reference.
  • Resources wanted: an accounting textbook chapter on bank reconciliation; the company's reconciliation procedure.

accounting/vat.md

  • Authority: EU VAT Directive 2006/112/EC; Mervardesskattelagen (2023:200); Skatteverket guidance.
  • REVIEW: the page teaches rate-by-category-and-date lookup only. It omits reverse charge, the place-of-supply rules, partial deduction and the tax point (the invoice date is assumed to decide the rate).
  • REVIEW: gross-to-net by division then subtraction is the statutory method; confirm rounding.
  • Resources wanted: the current rate table and its change history from the tax authority; guidance on which date decides the rate.

accounting/journal-errors.md

  • Authority: double-entry bookkeeping; Bokforingslagen (1999:1078) on vouchers as the basis of entries; the "divisible by 9" test for transpositions (standard audit technique).
  • REVIEW: the fault kinds and "report the later duplicate" are task conventions.
  • REVIEW: the corrected trial balance is built from the documents alone, assuming every transaction has exactly one document with one debit and one credit account.
  • Resources wanted: the BAS chart of accounts; an auditing text on error detection.

accounting/accrued-costs.md, accounting/prepaid-costs.md, accounting/depreciation.md

One page per kind of period-end adjustment since version 0.3 (before: one page for all three).

  • Authority: accrual basis of accounting (IAS 1; in Sweden Arsredovisningslagen 1995:1554 and BFN guidance K2/K3); IAS 16 on depreciation.
  • REVIEW: each page now says "if the request states the method, apply it as written" and gives its own rules only as explanation. Check that the explanations never read as a second method.
  • REVIEW: "invoiced after the period end counts as not invoiced" is the correct cut-off rule but ignores materiality thresholds that K2 allows.
  • REVIEW: prepaid costs are spread over the invoice's own service period in the unit and rounding order the request names; daily proration is equally common in practice.
  • REVIEW: the first month of depreciation is "the one the request names"; many policies start the month after acquisition, or prorate.
  • REVIEW: "only what the task gives inputs for" (no prepaid or depreciation entries in a task that has only deliveries) is a task-scoping rule, not an accounting rule.
  • Resources wanted: BFNAR 2016:10 (K2) and BFNAR 2012:1 (K3) sections on accruals and depreciation; the company's accounting manual.

accounting/consolidation.md

  • Authority: IFRS 10 (consolidated financial statements); K3 chapter 9; acquisition method in IFRS 3.
  • REVIEW: the page eliminates the investment against the subsidiaries' share capital only and lets their retained earnings add up. This matches the simplified task rules; real consolidation eliminates all pre-acquisition equity and recognises goodwill.
  • REVIEW: goods in transit are booked as a purchase at the buyer, as the task prescribes; real practice books inventory in transit and eliminates unrealised internal profit.
  • REVIEW: wholly owned subsidiaries only; no non-controlling interests.
  • Resources wanted: IFRS 10 and IFRS 3 extracts or a group-accounting textbook; the group's consolidation manual.

legal/contract-review.md

  • Authority: contract-drafting practice (for example K. Adams, A Manual of Style for Contract Drafting); general principles of contract interpretation.
  • REVIEW: "a definition anywhere in the agreement counts, also after first use" is standard drafting practice; confirm.
  • REVIEW: what counts as a defined-term use (capitalised, used repeatedly) is a heuristic.
  • REVIEW: precision is weighted like recall here because the tasks penalise false reports; a real review would flag doubtful items with a note.
  • Resources wanted: the firm's contract-review checklist and drafting style guide.

legal/deadlines.md

  • Authority: Koplagen (1990:931) on complaints; Rantelagen (1975:635); Preskriptionslagen (1981:130) on limitation (ten years, three years for claims against consumers); CISG articles 38-39 on examination and notice.
  • REVIEW: the page deliberately gives no periods; it sends the reader to the contract and the rule table. Confirm this division of sources.
  • REVIEW: "where a clause gives two limits the earlier governs" matches the rule table seen in practice and CISG article 39(2)-style long-stop clauses.
  • Resources wanted: the statutes named above; the standard terms in use (for example NL 17, Orgalim S 2022).

legal/breach.md

  • Authority: sale-of-goods law on delay and defects (Koplagen sections 22-40; CISG articles 45-52 and 74-77); contract practice on liquidated damages and limitation of liability.
  • REVIEW: "a late complaint removes the remedy but not the breach" is the legally sound position and the page teaches it firmly; a grader could instead treat the case as no breach. This is the single most consequential unverified claim in the collection.
  • REVIEW: the damages ceiling is taken from the general limitation-of-liability clause and not from the cap on liquidated damages.
  • REVIEW: "evidence is only the decisive documents" (which documents count as decisive for each breach type is left to the reader).
  • Resources wanted: a commentary on Koplagen or CISG remedies; the firm's breach-assessment template.

support/tickets.md

  • Authority: service-desk practice (ITIL 4 incident and request handling); internal-control principle of acting only through the system of record.
  • REVIEW: "exactly one outcome per ticket" and "first applicable rule decides" follow the policy seen in practice; other desks allow combined outcomes.
  • REVIEW: the advice to avoid quotation marks and special letters in messages trades natural language for shell safety.
  • Resources wanted: the organisation's support policy and tool manual.

support/refunds.md

  • Authority: consumer-return practice; Distansavtalslagen (2005:59) and the EU Consumer Rights Directive 2011/83/EU on withdrawal; Konsumentkoplagen (2022:260) on defects; card-scheme chargeback rules.
  • REVIEW: the screening order (abuse, order identified, already refunded, kind of claim, agent limit) mirrors the policy seen in practice and is presented as "usual", not as universal.
  • REVIEW: "over the agent's limit means no refund by you" (no partial payment).
  • REVIEW: windows are counted inclusive of the last day, from delivery to the system date.
  • Resources wanted: the real refund and fraud policy; consumer-law summaries for the markets served.

support/procurement.md

  • Authority: purchasing practice (CIPS guidance on supplier selection); for public buyers, Directive 2014/24/EU award criteria.
  • REVIEW: "the choice is fixed before the limit is tested" (no switching to a cheaper or dearer quote to stay under the approval limit).
  • REVIEW: lowest total as the sole award criterion.
  • Resources wanted: the organisation's procurement policy and approval matrix.

compiled/apply-rules.md

  • Authority: statutory interpretation: rule, exception, burden; lex posterior for amendments.
  • REVIEW: the three-way distinction (right exists; right barred by an exception; condition never met) and the instruction to test the condition before the exception. Practice attempts suggest this is where most points were lost, but which label a grader expects when both the condition fails and an exception would apply was inferred, not confirmed.
  • REVIEW: "an exception to one right does not touch another unless the text says so".
  • Resources wanted: an introduction to statutory interpretation; the organisation's rule authoring guide, if rules are written in-house.

compiled/which-document-wins.md

  • Authority: hierarchy-of-norms principles (lex superior, lex posterior); document-control practice (ISO 9001 clause 7.5 on controlled documents).
  • REVIEW: precedence order authority, then date, then version, is taken from the task request and presented as "common".
  • REVIEW: "an amendment replaces only the statements it restates".
  • REVIEW: "give the value exactly as written, with its unit".
  • Resources wanted: the organisation's document-control procedure.

compiled/deadlines-and-drafts.md

  • Authority: as for calculation/dates.md and calculation/limits.md.
  • REVIEW: chained deadlines are computed without rolling or business-day rules unless the material states them.
  • REVIEW: a draft item equal to a maximum is treated as allowed.
  • Resources wanted: none beyond those above.

Every page (since version 0.3)

  • REVIEW: the deference rule and the example disclaimer are untested: they were written from the failure analysis above, and no measurement has yet shown that they remove the harm. The with-pages against without-pages comparison on bookkeeping tasks must be repeated.
  • REVIEW: whether worked examples should be mounted at all for a small model when pages are preloaded rather than looked up (the tier-2 export leaves them out).
  • REVIEW: mistake lists were shortened for the token budget; check nothing important was lost.

index.md and the folder index.md files

  • REVIEW: every trigger phrase should use words a task would actually use; check against real task requests of each new collection the knowledge is used with.

What the user could supply to strengthen it

In order of expected value:

  1. A domain expert's read of the REVIEW: items marked in bold above (breach versus remedy; the three-way outcome distinction).
  2. The organisation's own handbooks where the pages now say "usual": accounting manual (cut-off, proration, depreciation start), support and refund policy, procurement policy and approval matrix, contract-review checklist.
  3. Standards and statutes named per file: K2/K3, IFRS 10 and 3, IAS 16, the VAT act and Skatteverket rounding guidance, Rantelagen, Preskriptionslagen, Koplagen, CISG, the period-computation statute.
  4. The harness facts the workflow page depends on: tool names and parameters, step and token limits, and the examiner's definition of probing.
  5. Textbook chapters for depth where a 4B reader lacks the prerequisite: bank reconciliation, error detection in journals, group accounts.

Licence

Creative Commons Attribution 4.0 International (CC-BY-4.0). Copyright (c) 2026 Martin Schröder info@swedishembedded.com.