Skip to main content

The local SOP index

GreatBook retrieves operating procedures from one Git-rendered manifest inside the running process. The runtime path has no network call, credential, model, embedding, mutable remote index, or session-feedback store.

One corpus, one retrieval implementation

agents/common/sops.py owns the generated SOP text. agents/common/knowledge_manifest.py combines those documents with reviewed skill files and binds each document to its UTF-8 bytes, source path, source hash, tags, and content SHA-256. agents/common/sop_index.py builds the read-only index and returns those exact manifest bytes with deterministic match evidence. The same index implementation serves two principals:
  • the Clerk uses its declared four-dataset scope;
  • the authenticated operational-explanation adapter uses an explicit all-corpus grant.
An undeclared or unknown dataset is rejected before document lookup. The other in-process agents do not pretend that dataset names are independent service credentials; user and connector authorization remains at the capability layer.

Generated from enforcement code

If a structural owner cannot be imported, the renderer does not substitute a stale approximation. Runtime then reports the SOP unavailable.

Exact and lexical lookup stay different

A document intake lookup resolves only by an exact doc:<id> tag or the exact document id rendered into one flow stub. Procedure search uses deterministic normalized lexical ranking and requires discriminating grounding. Common terms alone do not establish that a procedure was found. Every successful result carries the dataset, stable filename, exact text, tags, content hash, source path, source hash, and match method. An unavailable manifest, denied dataset, ambiguous identity, or non-discriminating search produces an explicit miss rather than an uncited paraphrase.

Nine stable dataset identities

The nine names preserve document identity and intended audience:
  • sop-clerk;
  • sop-bookkeeper;
  • sop-auditor;
  • sop-accountant;
  • sop-typewriter;
  • sop-shared;
  • sop-shared-close-checklist;
  • sop-shared-posting-rules;
  • sop-shared-recon-ontology.
They are retrieval scopes in the manifest, not a remote deployment plan.

Cognee is a separate optional lane

The Clerk can still publish extracted customer text to a content-addressed Cognee dataset when that optional raw-intake store is configured. That path preserves original storage and SHA-256 lineage, but it does not supply GreatBook’s operating procedures and is not used by the local SOP index.

Verified at source

  • langgraph_chat/agents/common/sops.py owns the corpus and audience map.
  • langgraph_chat/agents/common/knowledge_manifest.py builds the exact source-bound manifest.
  • langgraph_chat/agents/common/sop_index.py implements scoped exact and lexical retrieval.
  • langgraph_chat/agents/common/kb.py constructs SopIndexClient.from_runtime() for the Clerk.
  • langgraph_chat/agents/clerk/raw_intake_cognee.py is explicitly retained only for the separate optional raw-intake lane.