ENGINE 07

SFS-E07-KBN · CITED KNOWLEDGE · REV 2026-07-20 · PRODUCTION

PRODUCTION = runnable end-to-end, CI-backed, full test suite passing. All data fictional.

Knowledge Brain

Queryable institutional memory with a citation on every answer — or no answer

Knowledge Brain turns fictional meeting transcripts into a deterministic TF-IDF index for cited questions, paste-ready footnotes, meeting prep, and review-remediation handoffs. Its remediation path generates a cited, apply-ready prompt and a PENDING change log; a downstream AI or operator owns execution and confirmation of the workpaper changes.

A knowledge system earns trust by carrying each quote back to its meeting, date, timestamp, and speaker — and by refusing to answer when no source clears the relevance floor.

Run it Book a consultation

Architecture

functional block stack · static overview
Downstream Handoff Cited Renderers Deterministic Retrieval Verbatim Extraction Transcript of Record substrate: fictional data

Select a layer

The stack preserves chain of custody from the transcript of record through retrieval and the downstream handoff. Select a layer for its plain-terms and engineering detail.

Key specifications

at a glance
7,0111
Tests
the checks that pin this engine's behavior
52
Meetings ingested
fictional transcripts in the runnable corpus
153
Knowledge cards
cited decisions, rules, definitions, and open items
44
Card kinds
three authoritative kinds plus parked open items
45
Review directives
each mapped one-to-one to a PENDING log row
36
Refusal exit
a scriptable no-source result

What it does for you

plain terms

Finance and tax decisions often survive only as meeting memory or buried notes. When the same position is needed in a workpaper, disclosure, or review response, an uncited paraphrase is not enough: the user needs the recorded words, who said them, and when — or an explicit refusal when the source is absent.

A workpaper assertion gets one traceable footnote7. Cite mode filters out open items, returns the best authoritative card, and renders its transcript text byte-identically with the meeting title, date, timestamp, and speaker attached.

An off-topic question produces a machine-readable refusal8. When no card clears the relevance floor, the CLI prints “No sourced answer — the brain does not guess” and exits 3 instead of filling the gap with a plausible answer.

A review meeting becomes a cited prompt, not an untracked edit9. The remediation command retrieves four fictional reviewer directives in spoken order and generates an apply-ready prompt plus a one-to-one change log at PENDING. A downstream AI or operator performs the edits and confirms their status.

Stored knowledge drift is re-derived only where the transcript supports it10. The integrity demo starts with four injected findings, re-derives three text-or-speaker corrections across two turns, and leaves the orphaned citation quarantined. The final verdict is ESCALATED with exit 3 because no utterance exists to support that record.

Functional block diagram

engineering · each block links to its source
Functional block diagram of the Knowledge Brain engine utterances cards + directives ranked corpus hits or refusal matched review ordered citations prompt + PENDING log Fictional Transcripts Verbatim Extractor Corpus + TF-IDF Index Ask · Cite · Prep Cited Outputor Refusal Review Directives Cited Apply-ReadyPrompt DownstreamAI / Operator SFS-E07-KBN · FUNCTIONAL BLOCK DIAGRAM · REV 2026-07-20

Plain terms

  • Fictional Transcripts. timestamped meeting utterances
  • Verbatim Extractor. selects recorded statements and review requests
  • Corpus + TF-IDF Index. stores cited cards and ranks them by topic
  • Ask · Cite · Prep. answers a question, supplies one footnote, or prepares a meeting
  • Cited Output or Refusal. returns sourced text or says there is no sourced answer
  • Review Directives. retrieves the reviewer's recorded corrections in spoken order
  • Cited Apply-Ready Prompt. generates the prompt and a PENDING source-to-status map
  • Downstream AI / Operator. performs the requested work outside the Brain

Engineering

  • Fictional Transcripts. Meeting + ordered Utterance tuples form the transcript of record
  • Verbatim Extractor. timestamp lookup creates byte-identical KnowledgeCards and ChangeDirectives
  • Corpus + TF-IDF Index. BrainEngine builds a deterministic keyword/tag TF-IDF index over the fixed corpus
  • Ask · Cite · Prep. ask returns ranked hits, cite filters to authoritative kinds, and prep separates settled positions from open items
  • Cited Output or Refusal. citation_block binds the verbatim card text to its provenance; empty hits render REFUSAL
  • Review Directives. directives_for matches a review title or topic, then orders citations by meeting, timestamp, and directive_id
  • Cited Apply-Ready Prompt. Remediation contains ordered directives, the generated prompt, and one FixPacketEntry per directive at STATUS_PENDING
  • Downstream AI / Operator. external execution and confirmation boundary; the Brain's handoff ends with the cited prompt and PENDING log

Instruction set

every public command
CommandOperationOutputExitArtifacts
python -m brain_engine
print the fictional corpus indexmeeting, card-kind, topic, and provenance catalogue0none
python -m brain_engine ask "<question>"
retrieve the best cited cards for a questionranked cited answer(s) or explicit refusal0 sourced · 3 refusalnone
python -m brain_engine "<question>"
use the equivalent bare-question formranked cited answer(s) or explicit refusal0 sourced · 3 refusalnone
python -m brain_engine --cite "<assertion>"
return one paste-ready authoritative footnoteverbatim quote + provenance tag or refusal0 sourced · 3 refusalnone
python -m brain_engine --prep "<topic>"
assemble cited prior positions and open itemsmeeting-prep briefing or refusal0 sourced · 3 refusalnone
python -m brain_engine remediate "<review>"
generate a cited apply-ready remediation handoffordered directives + generated prompt0 sourced · 3 refusal · 2 missing topicnone
python -m brain_engine --seed N
accept the compatibility seed argumentthe unchanged hand-authored corpus; the current build ignores N0none
python -m brain_engine --min-relevance R ask "<question>"
set the retrieval relevance floorcited hits clearing R or refusal0 / 3 · 2 if R is outside [0,1]none
python -m brain_engine --out DIR
write all Markdown example deliverablesindex, citation, prep, remediation, and change-log files0DIR/brain_index.md · citation_example.md · meeting_prep_example.md · remediation_prompt.md · change_log.md
python run.py --out DIR
use the convenience entrypointthe same five Markdown deliverables0DIR/*.md
python -m brain_engine.loop
compare the clean knowledge corpus with its transcriptsCLEAN integrity-loop report0none
python -m brain_engine.loop --demo
inject the documented internal knowledge-drift profileESCALATED after supported drift is re-derived and the orphan is held3none
python -m brain_engine.loop --seed N
accept the loop's compatibility seed argumentthe same fixed-corpus integrity verdict; the current build ignores N0 / 3none
python -m brain_engine.loop --budget N
cap internal knowledge-remediation turnsfinal CLEAN, REMEDIATED, or ESCALATED verdict0 / 3none
python -m brain_engine.loop --out DIR
write the knowledge-integrity reportintegrity-loop verdict and report0 / 3DIR/integrity_loop_report.md
python -m pytest -q
run the engine test suitepytest session summary0none

Benchmarks

measured demo results
MeasureResult
Engine tests117,011 tests
live collection, not the README's historical sample output
Indexed fictional corpus1215 knowledge cards across 5 meetings
Review handoff134 cited directives mapped one-to-one to PENDING entries
Integrity demo recovery143 corrections over 2 turns; 1 orphan quarantined

Control characteristics

engineering

Plain terms

Every returned answer is tied to a recorded source. The remediation boundary ends with the generated cited prompt and PENDING log; execution and confirmation belong to the downstream user or system.

Engineering

Deterministic envelope. offline default mode.

SeverityVerdictAction
No internal knowledge driftCLEANnothing is changed; exit 0
All internal drift has transcript supportREMEDIATEDstored text or speaker is re-derived verbatim; exit 0
Orphaned source or turn budget exhaustedESCALATEDunsupported entries are held for a human; exit 3

Ask. returns the best relevant cards with citation blocks, or refuses when no card clears the floor

Cite. returns one authoritative decision, rule, or definition as a paste-ready footnote; open items are excluded

Prep. groups relevant authoritative positions separately from open items for meeting preparation

Remediate. generates the cited apply-ready prompt and PENDING change-log handoff from recorded review directives

Integrity loop. compares stored cards and directives with the transcript of record, re-derives supported drift, and quarantines orphaned citations

Operating limits

what it refuses to do

See it run

brand animation
Knowledge Brain system illustration showing meeting and SOP documents entering a queryable knowledge store, with a cited verbatim timestamped answer and a no-source no-answer control
Repository system animation: meeting and SOP sources feed the Knowledge Brain; answers leave cited verbatim and timestamped, while an unsourced query returns no answer.

Integration

how to run it

Distribution: public repository, MIT license.

git clone https://github.com/sophonfinance-wq/finance-automation-portfolio.git && cd finance-automation-portfolio/knowledge-brain-engine && python -m brain_engine
python -m brain_engine --cite "return of capital in excess of basis is a deemed gain"
python -m brain_engine remediate "Surplus Workpaper Review — Reviewer Corrections"
Source on GitHub Engine README All tests, by engine Run in Codespaces
Substantiation
  • 1py -3 -m pytest --collect-only -q -o addopts= (knowledge-brain-engine/); live collection verified 2026-07-20 and pinned in site-datasheets/counts.json
  • 2python -m brain_engine (knowledge-brain-engine/) — live index reports 5 meetings; brain_engine/generate.py builds the five-meeting fictional corpus
  • 3python -m brain_engine (knowledge-brain-engine/) — live index reports 15 knowledge cards
  • 4brain_engine/model.py CARD_KINDS — decision, rule, definition, open-item; confirmed by the live index
  • 5python -m brain_engine remediate "Surplus Workpaper Review — Reviewer Corrections" — live CLI emits 4 cited directives in spoken order
  • 6brain_engine/cli.py main — ask, cite, prep, and remediate return 3 when no sourced result exists; confirmed with an off-topic live CLI query
  • 7python -m brain_engine --cite "return of capital in excess of basis is a deemed gain"; brain_engine/engine.py cite; brain_engine/report.py render_citation
  • 8python -m brain_engine ask "what is the office parking and lunch policy"; live exit 3; brain_engine/cli.py and brain_engine/report.py
  • 9python -m brain_engine remediate "Surplus Workpaper Review — Reviewer Corrections"; brain_engine/engine.py remediate; knowledge-brain-engine/README.md Review → remediation
  • 10python -m brain_engine.loop --demo (knowledge-brain-engine/); live demo output; brain_engine/loop.py
  • 11py -3 -m pytest --collect-only -q -o addopts= (knowledge-brain-engine/); verified 2026-07-20 and pinned in site-datasheets/counts.json
  • 12python -m brain_engine — live index summary; brain_engine/generate.py build_corpus
  • 13python -m brain_engine remediate "Surplus Workpaper Review — Reviewer Corrections" — live CLI output; brain_engine/engine.py
  • 14python -m brain_engine.loop --demo — live output reports 3 corrections, 2 turns, and 1 quarantined orphan
  • 15knowledge-brain-engine/README.md — public runnable version over invented transcripts; brain_engine/generate.py module documentation
  • 16brain_engine/engine.py — stdlib TF-IDF index, tokenization, weighted tags, and MIN_RELEVANCE
  • 17brain_engine/model.py AUTHORITATIVE_KINDS; brain_engine/engine.py cite and prep
  • 18knowledge-brain-engine/README.md Review → remediation; brain_engine/engine.py Remediation and STATUS_PENDING; brain_engine/report.py
  • 19brain_engine/loop.py — REMEDIABLE excludes ORPHANED; integrity_loop and verdict_exit_code

Show us where the hours go.

One conversation: you describe the work that consumes your team's month; we tell you plainly what this engine can take over, what it can't, and what a scoped first phase would cost. Your people keep approval authority.

Book a free consultation