Skip to main content

Sources and influences

Status: Ready

Truth label: Limited

Audience: Fleet operator, System designer

Reader outcome: Take a document from upload to eligible retrieval evidence, and control exactly which sources a request may use.

Last verified: 2026-09-09

Full guides: Influence library, Source quality, Source passages, Document structure, Source lifecycle

What source choices do​

Open Sources beside chat, or Manage Cortex > Sources and influences.

Source choices select reference material. They do not change the operator's voice, approve a book as a writing example, or train a model.

Import and review​

  1. Choose a PDF, EPUB, DOCX, TXT, or Markdown file up to 50 MiB and upload it for review.
  2. Open the source and extract its text. PDF pages and EPUB chapters keep their locators. Markdown and Word heading paths identify sections. Image-only PDFs need OCR outside this workflow.
  3. Inspect the extracted segments. Edit the title, author, edition note, optional declared influence group, and extracted text. Download the original or export the source and its review history.
  4. Review extraction quality. Flagged text requires a saved usable verdict and an explanation.
  5. Optionally open passage settings and preview boundaries, size, and overlap.
  6. Publish reviewed text. Publication embeds a new generation in batches, and the source becomes eligible only when every batch finishes.
  7. Cancel, retry extraction or publication, retire, and restore from the source editor. Retirement immediately excludes the source from later retrieval.

Identity rules:

  • Exact bytes share an existing source, even under another filename.
  • Different bytes get a different identity, even with the same title.
  • An upload id cannot replace an original with different bytes, including during concurrent uploads.
  • Reindexing and extraction edits retain the source id.
  • Metadata and review versions use optimistic revision checks, so a stale edit returns a conflict instead of overwriting saved work.

If publication fails, partial rows are ineligible and a prior published generation remains usable. Retrying publishes another generation. Cancellation prevents a late result from becoming active. An operation that stops reporting progress for an hour becomes interrupted when the catalog reads it.

Structured imports​

Markdown imports keep ATX headings and nested heading paths as extraction segments. Headings inside fenced code remain code. Plain text files remain one segment. Existing sources keep their retained text until Extract text / retry creates a new review.

Word extraction is text based. It combines text runs into ordered body paragraphs and recognizes Heading1 through Heading9, outline levels, and inherited heading styles. It includes insertions and omits deleted text when tracked changes are present.

It flags automatic list labels, flattened tables, tracked changes, hyperlinks, images, floating text, and omitted note, header, and footer parts for comparison with the original. It does not render the document, resolve external links, reconstruct automatic numbering, or perform OCR. Flagged imports require a saved usable verdict and explanation before managed publication.

Catalog existing indexed books​

Catalog existing indexed books assigns deterministic identities from existing source paths without reading original files or calling embeddings. Path spellings remain distinct, because the system cannot infer whether two paths represent the same edition. Legacy sources retain their indexed text and citations, but their original bytes and parser versions are unknown. Upload an original to create a managed review record, then retire the older record if it should no longer participate.

Extraction quality​

Open a source's Extraction quality section.

The report shows missing PDF pages or skipped EPUB spine entries, empty segments, isolated word lines, and replacement characters. Word imports also report structures that need comparison with the original. Each segment shows its word and line counts.

The checks are fixed and versioned:

SignalThreshold
FragmentationAt least eight nonblank lines with 60 percent single-word lines
Encoding noiseAt least three replacement characters and one percent of visible characters

Up to 100 flagged segment indices appear in the summary. The count and per-segment diagnostics cover every retained segment.

No mechanical flags means these checks found no listed problem. It does not establish correct reading order, factual fidelity, usable OCR, or complete tables. Layout and language can produce false positives.

The review loop:

  1. Inspect the original and the flagged segments. Choose Usable for retrieval or Needs repair before publication and save a note.
  2. A usable verdict for flagged text requires an explanation. Publication refuses flagged text without that verdict, refuses empty text, and refuses a current needs-repair verdict.
  3. For broken text, choose Preview broken-line repair on a saved segment. The proposal joins runs of four or more single-word lines while preserving list and rule boundaries, headings, fenced code, and short runs. Poems and intentional layout still need judgment.
  4. Use proposed text in editor changes only the editor. Save reviewed text writes a new extraction version. Publishing stays separate.

Verdicts bind to the exact extraction hash and quality report. Changed text clears the current verdict, unchanged wording retains it, and restoring an old extraction recomputes its report and requires a fresh review.

Passage settings​

Open a source, then Passage settings and preview. These settings belong to that source and do not affect the operator's voice or other books.

  1. Choose recursive text splitting, which stays the default, or whole paragraphs and rules. Paragraph and rule mode keeps each paragraph, numbered or bulleted entry, and fenced code block separate when it fits.
  2. Set maximum passage characters and overlap. Limits are 256 to 8,000 characters and 0 to 1,000 overlap, with overlap smaller than the passage limit. Oversized blocks split with overlap. Whole separate blocks do not overlap.
  3. Preview the actual passages. More preview passages loads another page of 20. The preview identifies pieces from oversized blocks and retains page, chapter, or heading metadata. It performs no embedding.
  4. Save the reviewed settings. An edit or a changed source requires another preview.
  5. Publish the source. The active generation changes only after indexing finishes, and earlier citations keep their retained text and locators.

Managed sources are limited to 20,000 passages per publication. Increase passage size or use recursive splitting when necessary.

More passages do not establish better retrieval. Small rule entries can create many competing results. Compare relevance and citation coverage on real questions before treating a strategy as an improvement.

Groups and lenses​

Source groups​

Open Create or edit source groups. Create a group or load one to edit its label and matching rules. Use a new id to clone it.

Explicit membership only is the default for new groups: assign uploaded books through each source's Group field. It does not guess membership from filenames. Automatic groups can instead use filename text, relative path patterns, and folder prefixes under the library, the knowledge directory, or both.

Matching rules apply to future path imports. They do not regroup already indexed books. New groups append after existing rules, and unrelated group definitions are preserved. The editor refuses unusual TOML layouts when it cannot preserve unrelated settings.

Open Group order, settings, and history to move a rule earlier or later, or to retire a group. Preview shows both orders and the references from active lenses and catalog sources. Apply rechecks the manifest revision. Filename rules use the first matching active group for future path imports.

Retirement disables automatic tagging by that rule and retrieval through that group. Existing lenses and saved source choices keep the group id and report its retirement. A book in a retired group remains available when selected individually or through All published sources. New source assignments and lens-editor selections require an active group. Referenced groups must be retired rather than removed.

Every Cortex group edit saves before and after manifest snapshots in the library's .cortex-manifest-history directory, including the original TOML.

Reasoning lenses​

Open Create or edit reasoning lenses to create, load, edit, or clone a lens. Choose up to 12 declared groups and write up to 10 principles of at most 300 characters each. Fixed reasoning boundaries are inspectable and cannot be changed by a lens definition. Reserved none and default ids cannot be overwritten.

Saving a lens validates and reloads the pack in the serving Brain process. A request already in progress keeps its resolved lens. Use saved lens in chat selects it for future requests and leaves the voice register and explicit source choices unchanged.

A lens with no groups retains whole-library behavior. It does not mean No imported sources.

Group edits use a manifest revision. Lens edits use the manifest plus a definition revision. A stale tab must reload before saving. Failed lens validation restores prior files and leaves the active registry unchanged.

Groups live in the external influence_pack.toml inside the influence library. Lenses live in the external voice pack. Neither definition is copied into the browser or the source catalog as a competing authority. Preflight still requires every lens group to be declared, and other Brain processes need their existing reload path to pick up lens edits.

Choose evidence per request​

ModeImported sources eligible
Follow the reasoning lensIts configured groups plus ungrouped material
Only selected sources or groupsExplicit ids, or members of an included group. An empty selection supplies none
All published sourcesEvery published library source, subject to exclusions
No imported sourcesNone

Explicit source, group, and passage exclusions win over any mode.

Save and name a reusable selection in Cortex. Load it, adjust it, preview it, and apply it to chat. Applying is explicit. Choices stay active for later requests in the current conversation and its browser cache until changed, and named conversation snapshots retain them. A saved selection can be loaded into other conversations. Choosing a different lens does not override an explicit selected, library, or none mode.

Preview uses the same source eligibility and ranking service as automatic recall, bound model tools, and /knowledge/search. Exclude a returned passage directly or remove its id from the exclusion editor. Each response includes Source buttons that open the exact indexed passage.

Managed source generations and lens groups are fixed at request start. A later publication or retirement prevents subsequent tool lookups from using a stale generation. Text already supplied to a model call cannot be retracted, and changing choices cannot erase text already present in conversation history. Start a new conversation when previous material should no longer be in context.

Compare and restore extraction versions​

Expand Compare and restore extraction versions on a managed source. Choose earlier and later revisions. The comparison shows changed segments, retained page and chapter metadata, and title, author, edition, and group differences.

A comparison checks all segment changes but limits inline text differences to 30,000 characters per side and 400 lines, with a visible notice when shortened. Segment pairing follows extraction order.

Restore earlier extraction as a new review restores the retained text and parser provenance. It keeps the current title, author, edition, group, original bytes, source id, and active published generation. Review the restored text, then publish to change what retrieval can use.

Restore rejects stale revisions, busy imports, and retired sources. Historical extraction files must still exist and match their recorded hash.

Replace a source and clean the index​

Open a source and choose Replace source or clean index.

Replace and reconcile​

Upload, extract, review, and publish the replacement first, then choose it in the lifecycle editor. The preview shows both source identities, current revisions, group ids, the replacement publication, and every affected saved source selection.

Optionally migrate saved selections. Both included and excluded source ids move to the new identity, preserving exclusion precedence. Applying the exact preview retires the old source and updates both source histories in one transaction. Changed revisions or selection impact require another preview. Existing tasks and current conversation choices keep their original snapshots.

Undo restores the earlier relationship state and, by default, migrated selections as new revisions. It stops if a migrated selection has since changed. Disable selection restoration to keep those operator edits while undoing the relationship. Undo a later link in a replacement chain first.

New original bytes always keep their own source id. Replacement records a relationship between two ids. It does not rewrite the old original or pretend two editions are identical.

Clean indexed copies​

Choose old index generations, or every indexed passage of a retired source. Preview shows the affected count, retained index count, text bytes, and the exact passage manifest. The operation refuses a changed source or changed indexed content. It is bounded to 20,000 source passages and 80 MiB of passage text per cleanup.

Cleanup archives exact passage text and provenance in compressed records before the first deletion, then removes only the previewed copies. Old-generation cleanup preserves the active publication. Full cleanup requires retirement and clears publication readiness before deletion.

Earlier citations remain inspectable through the library passage endpoint and the historical passage view. They report as archived and are ineligible for new retrieval. Cleanup reduces index clutter. It does not erase text from the retained citation archive.

Storage and backup​

LocationContents
sources.sqlite3 in the Brain data rootStable source ids, revisions, import state, active generation, named selections, archived passages
<INFLUENCE_LIBRARY_DIR>/.cortex-sources/<source-id>/Original uploads and immutable extraction files
.cortex-manifest-history in the libraryGroup manifest snapshots, in TOML
The vector storeDerived index for managed imports

The configured library root must sit outside both the repository and the runtime data root. Existing discovery ignores the hidden managed directory.

The runtime backup captures SQLite. It does not back up external content roots. Copy the originals, extraction files, and manifest history with the library. Old and failed generations remain on disk for historical inspection and are filtered from retrieval.

Limits worth stating​

  • Extraction review is capped at 12 million characters.
  • Retrieval backfill stops at 512 candidates per search. The preview reports when the cap prevented filling the result limit, and many inactive generations can consume that window.
  • Managed passage ids cannot be edited or deleted through the Memory editor. Use this library instead.
  • Existing command line and path ingestion still writes directly to the index. Use Cortex upload when you want review before publication.
  • No preference, voice-quality, or retrieval-relevance gain is claimed from the synthetic checks behind this feature.