Cortex influence library
Status: Ready
Truth label: Current
Audience: Fleet operator
Reader outcome: Use cortex influence library in Cortex, with every control, its verification, and its limits stated.
Last verified: 2026-09-13
The S2 workflow adds reviewed imports, deliberate source selection, editable groups/lenses, and extraction-version comparison and restore to Brain chat. 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 voice example, or train the model.
Import and review
- Choose a PDF, EPUB, DOCX, TXT, or Markdown file, up to 50 MiB, and upload it for review.
- Open the source and extract its text. PDF pages and EPUB chapters keep their locators. Markdown and Word heading paths identify sections; complex Word structures require quality review. Image-only PDFs require OCR outside this workflow.
- Inspect the extracted segments. Edit the title, author, edition note, optional declared influence group, and extracted text in Cortex. Both save buttons save the source editor. Download the original or export the source and review history.
- Review extraction quality. Flagged text requires a saved usable verdict and note; repairs are previewed before saving.
- Optionally open Passage settings and preview to review boundaries, size and overlap. Recursive splitting remains the default.
- Publish reviewed text. Publication embeds a new generation in batches. The source becomes eligible only when every batch finishes.
- Use cancel, retry extraction/publication, retire, and restore from the source editor. Retirement immediately excludes the source from subsequent retrieval.
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 have optimistic revision checks; stale edits return a conflict instead of overwriting saved work.
If publication fails, partial rows are ineligible. A prior published generation remains usable. Retrying publishes another generation. Cancellation prevents a late worker result from becoming active. An operation that stops reporting progress for an hour becomes interrupted when the catalog reads it; retry it in Cortex.
Catalog existing indexed books assigns deterministic identities from existing source paths without reading original files or calling embeddings. Existing tagged sources and PDF/EPUB records are supported. Path spellings remain distinct because the system cannot infer whether two paths represent the same edition. Legacy sources retain their indexed text and citations. 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.
Edit source groups and reasoning lenses
Open Create or edit source groups in Sources. 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, knowledge directory, or both. Matching rules apply to future path imports and do not regroup already indexed books. New groups append after existing rules; existing rule order and unrelated group definitions are preserved. The editor refuses unusual TOML layouts when it cannot preserve unrelated settings.
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. Each principle can
contain up to 300 characters. Fixed reasoning boundaries are inspectable. They
cannot be changed by a lens definition. Reserved none and default IDs cannot be
overwritten; clone into a new ID. A built-in lens can be overridden in the external
operator pack without modifying the installed built-in file.
Saving a lens validates and reloads the pack in the serving Brain process. A request already in progress keeps its resolved lens. Use Use saved lens in chat to select the saved lens for future requests. This leaves the voice register and explicit source choices unchanged. Choose Follow the reasoning lens when its group selection should govern retrieval. A lens with no groups retains the historical whole-library behavior; it does not mean No imported sources.
Group edits use a manifest revision. Lens edits use the manifest plus definition
revision. A stale tab must reload before saving. Group/lens/profile writers share
the existing cross-process write lock. Failed lens validation restores prior files
and leaves the active registry unchanged. Existing links used by the legacy
influence_profile API remain intact; the editor does not expose voice reassignment.
Quick JSON exports capture saved definitions for inspection. Full group-definition history, ordering, retirement and previewed import/export are available in the group manifest editor. Full voice-pack content import/export is available in Voice and drafts.
Groups remain in the configured external influence_pack.toml. Cortex editing
requires that manifest to be inside the external influence library. Lenses remain
in the external voice pack and its voice_pack.toml references. Neither definition
is copied into the browser or source catalog as a competing authority. Existing
preflight validation still requires every lens group to be declared. Other Brain
processes need their existing reload path to pick up lens edits.
Compare and restore extraction versions
Open a managed source and expand Compare and restore extraction versions. Choose earlier and later revisions. The comparison shows changed segments, retained page/chapter metadata, and title/author/edition/group differences. Open either historical segment to inspect its full text. More changed segments loads another page of results. 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. The catalog records a new revision and the revision it was restored from. Earlier history remains unchanged. Review the restored text, then publish to change what retrieval can use.
Restore rejects stale revisions, busy imports, and retired sources. Restore a retired source first or cancel its active import. Historical extraction files must still exist and match their recorded hash. Missing or externally changed files produce an error without changing the source. Legacy index-only entries have no retained extraction to restore. A source's original uploaded bytes remain separate from extraction versions.
Choose evidence independently from tone
| Mode | Imported sources eligible for retrieval |
|---|---|
| Follow the reasoning lens | Its configured groups plus ungrouped material. A lens without groups retains the historical whole-library behavior. |
| Only selected sources or groups | Sources explicitly included by ID, or belonging to an included group. An empty selection supplies no imported books. |
| All published sources | All published library sources, subject to exclusions. |
| No imported sources | No imported influence sources. General knowledge is independently controllable. |
Explicit source, group, and passage exclusions win. The general-knowledge checkbox controls automatic notes, learnings, conversations, and project memory plus bound memory/conversation tools. It does not remove the current request, attachments, conversation history, voice instructions, or approved voice examples.
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 future requests in the current conversation and its browser cache until changed. Named conversation snapshots also retain them. A saved selection can be loaded into other conversations. Choosing a different lens does not override an explicit selected/library/none mode. The active mode appears on the Sources button. The full selection is recorded in each response's generation settings and trace.
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. Historical generations can be inspected but
are labeled unavailable when no longer eligible. These records show retrieval and
rendering, not proof that the model relied on or cited every 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 managed generation. Already supplied text cannot be retracted from a model call. Changing choices also cannot erase text already present in conversation history. Start a new conversation when previous material should no longer be in context.
Worker retrieval and attachments
Brain resolves worker searches from the task currently assigned by Central. The saved source choices, lens groups, and recorded managed-source publications govern retrieval. Worker-supplied source choices cannot replace this policy. Retirement or replacement of a recorded publication makes it unavailable to the saved task; it does not substitute a newer edition or broaden the chosen groups.
CLI workers receive eligible source passages before execution. Agentic planning and its knowledge tool share an assigned-task client. The legacy executor also receives the prepared passages. Cortex task details show retrieved evidence for the attempt, including available source IDs, publication versions, and rendered hashes. A selected source with no matching passage is not evidence that the whole book was read. Workers require the updated Brain and Central retrieval contract; an unavailable or older service produces an explicit retrieval error.
In Sources, Use enabled conversation attachments controls attachments as a separate evidence category. Each attached-file chip also has an inclusion checkbox. General notes can be disabled while an operator brief remains attached. Imported PDF/EPUB attachments still obey imported-source choices. An exact-byte copy of a managed original uses only eligible published passages, even after it is renamed. This prevents raw original text from bypassing reviewed text or passage exclusions. Generation settings report which attachments were included, excluded, unavailable, or shortened. Attachment content shares one per-turn budget based on the selected provider's context settings; changing a file after attachment cannot multiply it.
These controls govern Agent Asian's managed retrieval paths. They do not sandbox CLI shell commands or project files, remove material from earlier conversation turns, or transfer arbitrary attached files to remote workers. Standalone document excerpts and managed passage candidates retain different provenance. When an attachment is shortened, its overall rendered hash is recorded; full candidate hashes do not claim that every character reached the prompt.
Implementation and authority
brain/library_store.py:DATA_DIR/sources.sqlite3owns stable source IDs, revisions, import state, the active generation, and named selections.brain/library_imports.py: originals and immutable extraction files live underINFLUENCE_LIBRARY_DIR/.cortex-sources/<source-id>/. The configured root must be outside both the repository and runtime data root. Existing discovery ignores this hidden managed directory.brain/memory/ingestion.py: existing PDF/EPUB extraction and chunking preserve page/chapter metadata. Extraction review is capped at 12 million characters.brain/source_policy.py: request-bound policy, canonical publication checks, scope checks, rating adjustments for learnings, bounded candidate backfill, and passage evidence. Query embeddings are reused for the same query/index within this shared service. CPMI and voice-example retrieval retain their own paths.brain/influence_editors.pyandbrain/profile_editor.py: validated external group/lens definitions and pack reload.brain/library_history.py: verified historical extraction comparison and restore.brain/library_api.py:/librarymanagement and preview routes.cortex-ui/src/library-studio.jsandcortex-ui/src/influence-editors.js: source, group, lens, selection, and extraction-history workflows.brain/chat.pyandbrain/agent/graph.py: synchronous/streaming chat and bound tool searches use the policy. Reports include automatic and tool passage hashes, source IDs, generations, and rendered-text hashes.
Managed passage IDs cannot be edited or deleted through the older Memory editor. Use the Influence library to review and publish changes or retire a source.
Chroma remains a derived index for managed imports. Old/failed generations remain on disk for historical inspection and are filtered from retrieval. The canonical catalog must be retained with the external original/extraction files. The existing runtime-data backup captures SQLite; it does not back up external content roots.
Brain's Compose influence mount permits writes, alongside its existing voice mount. Preflight and backup mounts remain read-only. The runtime database stays on the named data volume. An existing container needs recreation to apply changed mounts; this code change does not restart a running service.
Group history, order, and retirement
Open Sources, then Group order, settings, and history. Load the current definitions, move a rule earlier or later, or retire a group. Preview shows both orders and references from active lenses and catalog sources. Apply checks the manifest revision again. Filename rules use the first matching active group for future path imports. Existing book assignments do not move when rules change.
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. Retiring the book itself removes those paths too. Restore the group to enable group-based selection again. New source assignments and lens-editor selections require an active group. Editing an existing source's other metadata can keep its retired group assignment.
Every Cortex group edit saves before/after manifest snapshots in the external
library's .cortex-manifest-history directory. History includes the original TOML.
The full-definition editor can load a prior version or JSON export for review;
preview and apply are separate actions. Restoring is a new apply against the current
revision. Full-definition writes normalize formatting; quick group edits preserve
unrelated manifest text. Referenced groups must be retired instead of removed.
The reference check covers the loaded lens registry and the source catalog.
Import/export includes rule order, library ID, strict path-import setting, and retirement flags. It excludes books and extraction content. The history files are TOML, which document ingestion does not index. Copy this external history with the library when making a backup. Automatic history cleanup is still pending.
Value, limits, and next work
This closes the main selection failure: a book excluded from automatic recall could previously return through a model's knowledge-search tool. Review before publication also prevents bad extraction or partial indexing from silently becoming usable evidence. If source review and the shared policy were omitted, the operator would have selection controls without consistent behavior behind them.
The VB02/VB03 workflow now includes group/lens editors and extraction comparison and restore. Remaining work includes source replacement/merge reconciliation, deletion and old-generation cleanup, OCR, complete attachment transport to tasks, shared context budgets, passage expansion, and measured retrieval evaluation. Existing CLI/path ingestion still writes directly to the index; use Cortex upload for review before publication. Remote workers retrieve eligible passages through Brain. They do not need local copies of the influence library, and a saved choice does not grant direct file access.
Backfill stops at 512 candidates per search. The preview reports when the cap prevents filling the result limit. Many inactive generations can consume that window, so cleanup and tighter index filters remain useful follow-up work. Different callers can request different final counts; eligibility and shared ranking match. No preference, voice-quality, or retrieval-relevance gain is claimed from synthetic checks. Authentic operator judgments and labeled retrieval questions remain needed.
Verification uses real generated PDF/EPUB files, a real Chroma round trip with local deterministic embeddings, lifecycle and concurrent-upload checks, and a real Cortex browser flow through Brain streaming chat and its bound knowledge tool. The browser model is deterministic. Tests do not call a live model or use the operator's books.
The editor/restore acceptance check also creates and edits a group and lens, assigns real PDF/EPUB imports, uses the lens in streaming chat without changing the voice, reloads definitions, compares historical text, restores it as a review, and verifies that publication is still needed to change searchable text.
Replacement and index cleanup
The source review now includes Replace source or clean index. Reconcile a published replacement with optional saved-selection migration and undo, or preview removal of old/all-retired index copies. Exact earlier passages remain in a compressed citation archive. See source lifecycle controls for revision checks, retention and retry semantics.
Published managed passages can support research findings. Research freezes explicit source/group choices and published generations, retains exact passage evidence and supports separate operator acceptance and context activation. Retiring or republishing a source prevents old research evidence from being reused in an accepted brief or context resolution.