Skip to main content
Project Knowledge builds project understanding using two types of input: one type is basic project sources such as manifest, configuration, directory structure, and specified documentation; Another type is task execution events such as Review, verification, fault recheck, Change Archive and application results. The system only saves the content that has a source, a scope of application and is helpful for subsequent tasks as Project Knowledge Record. It does not take over rules written by users, nor does it generate project wikis that cover the entire repository.

Core component

Overall data path

Three types of objects in the data link undertake different responsibilities:
  • ** Project evidence ** includes source code, configuration, tests, documentation and verification results in the current repository, and is the direct source of project facts;
  • Project Knowledge Record is a standardized Project Model or project strategy established from evidence;
  • **SQLite FTS Index ** is a reconfigurable retrieval read model used to improve the efficiency of candidate recall.
Rules are maintained by users or teams and loaded by the host by scope. Project Knowledge can reference the basis of the Rule when the source configuration allows, but it will not write, replace or take over the Rule. The project Wiki is a complete project document oriented towards people and is not included in this automatic learning chain.

Corpus: The scope of the project’s corpus

The Corpus (project corpus) defines the sources that the Local Provider can read, split, and index. Default sources include:
  • Native current Spec and Archive;
  • “Classic Current Spec and Archive;”
  • Workflow products supported by Comet;
  • The identifiable project structure, manifest and configuration can be determined;
  • The Markdown path explicitly added in the configuration.
You can use knowledge.local.include to expand the corpus range:
include uses the glob relative to the project root directory. The system will split the document into source units with path and section (chapter) information for retrieval and source status checking. The default corpus scope only includes sources that Comet can clearly recognize. The Rule files or rule directories supported by the target platform are managed by the host. When it is necessary to use the Markdown as a knowledge corpus at the same time, please explicitly add it through include. The Corpus defines the range of sources that are allowed to be read, but this does not mean that Comet will convert all of their content into long-term knowledge. The Builder only selects the content that can form the Project Model, project strategy or subsequent task clues.

Formation logic: Basic model and execution accumulation

Project Model Builder

When the Project is used for the first time, the Project Model Builder builds the base Project Model from the manifest, configuration, directory structure, limited source code relationships, and custom Markdown. The subsequent repository.changed, verification.completed and change.archived events will update these records. The Project Model only saves the structural information that can be determined for extraction:
  • topology: Directory, module and workspace topology;
  • fact: Facts that can be verified from the current project;
  • dependency: Relationships among modules, packages and components.
The deterministic extracted Project Model can directly enter the proven (confirmed) state and retain the source for review before task use. It consists of structured knowledge records and does not generate a complete project Wiki in directory or chapter format.

Project Policy Learner

The Project Policy Learner processes engineering experiences that have formed project significance during task execution: Candidates that require semantic induction and have not yet been reused first enter the trial (trial) state. Project agreements explicitly proposed by users, existing project instructions, definite project facts, and execution results that have been successfully re-verified can be entered into proven. trial can also be promoted to proven after successfully assisting with subsequent tasks.

Record: Traceable knowledge unit

Project Knowledge Record (Project Knowledge Record) contains at least the following information: The system uses semantic identity (content identity) to identify the same knowledge unit. New evidence will update existing records and retain version relationships, reducing synonym duplication. The main text clearly corrected by the user has higher authority. Automatic extraction can only supplement evidence or form a version to be confirmed.

Policy Compiler: Policy activation

The Policy Compiler selects the following activation forms for the Project Policy based on content determinism and usage methods:
  1. Context : decision, pattern, procedure or constraint need to be judged by the Agent in combination with the task and provided in the form of a complete policy or Context Manifest;
  2. Verification : constraint has bound a runnable project command that can be judged as successful or failed and is provided as a verification policy;
  3. Skill candidate : When the procedure is stable across tasks, contains multiple steps and can be combined, generate an evidence-based Skill candidate summary.
During the strategy compilation stage, only context, validation associations, or candidate summaries are generated. Skill, linter, compiler, build and CI are still maintained by users and the existing processes of the project. Only Project Policy can enter enforced and needs to bind the currently existing and successfully executed deterministic validation entry. enforced indicates that this strategy has a runnable validation association and does not expand model permissions or system permissions.

Hybrid retrieval

The project task involves multiple retrieval signals:
  • Precise paths, commands, error codes and identifiers are suitable for strong string matching;
  • The Chinese description, chapter titles and engineering semantics are suitable for full-text search.
  • Module responsibilities and cross-file impacts are suitable for structural filtering and finite relationship extension;
  • The current branch changes and source failures need to be verified on-site.
The Local Provider combines these channels into a bounded search chain:
SQLite FTS5 provides section-level full-text indexing and sorting; Limited ripgrep retains the capabilities of exact matching, changing file supplementation, and fault rollback. When SQLite indexes are corrupted, lock conflicts occur, or FTS is unavailable, the system can rebuild the read model or use bounded source code search. Hybrid retrieval takes into account both semantic recall and precise engineering evidence, reduces wide-area exploration, and improves the coverage of the complete modification range.

Source validity check

Before the record enters the context, the system will check the project-relative source, anchor, digest, or version:
  1. When the source exists and the content is consistent, the record continues to participate in the search.
  2. When the source changes, the old record shall cease to be used as the current conclusion.
  3. When the source is deleted, the selector becomes invalid, or the verification command disappears, the record enters superseded.
  4. New evidence forms a new version and retains the substitution relationship with the old version.
Source checking binds Project Knowledge to the current warehouse status, reducing the risk of outdated conclusions entering tasks.

Context Director: Task context control

The Provider query returns a candidate set. The Context Director then performs the second layer of selection:
  • Filter out candidates that do not match the current project, path, task, operation, or phase;
  • Exclude superseded;
  • Rank proven and enforced before trial.
  • Prioritize the repository and user explicit authority over automatic inference;
  • Improve the ranking of specific scope and recently successful application content;
  • Reduce the ranking of corrected or failed content.
A small number of key Project policies can be provided completely. Project Model, trial Policy, long Procedure and evidence are usually included in the Context Manifest. The Manifest uses a stable ID and carries:
  • Title and Abstract;
  • Knowledge types and life cycles;
  • Source type;
  • whyApplied
  • application ID。
The Agent acquires the complete text, source and verification through expand. The single-character budget only limits the resident content of the current task and does not limit the total number of records of the Provider.

The main workspace and linked worktree

The Local Provider distinguishes items using a stable repository identity:
  • The main workspace shares the normalized Record with the linked worktree in the same repository;
  • Document sections and full-text indexes are isolated by workspace.
  • File changes in a branch or worktree only affect the source snapshot corresponding to the workspace.
  • Different warehouses are isolated from each other.
This design enables the same repository to reuse stable Project Knowledge while keeping the search results consistent with the current workspace files.

Local and Remote Provider

The Project Knowledge domain accesses the Provider through the unified status/query/apply contract.

Local Provider

  • Use SQLite isolated by repository ID in the user data directory;
  • Record stores the normalized machine state;
  • The section and FTS indexes can be rebuilt.
  • Limited ripgrep is responsible for strong matching, changing file supplementation, and fault rollback.

Remote Provider

  • After enabling Remote configuration, Local will no longer be read simultaneously.
  • Queries only send bounded task, path, phase, operation and ID selector;
  • apply only sends normalized records and evidence.
  • Complete repositories, complete diffs, logs, personal memories, and credentials will not enter the request;
  • When Remote fails, it returns the actual state and does not switch to Local.

Execution boundaries with rules, hooks, and engineering checks

You can continue to write project constraints through the Rule carrier supported by the target platform, and the host is still responsible for loading. The AGENTS.md of Codex, the CLAUDE.md of Claude Code and the .cursor/rules of Cursor are all just specific examples. Comet reuses these rules and the existing checks of the project; The basis for the existence of Project Knowledge record constraints, applicable paths and verification commands, deterministic judgments are still completed by the corresponding actuators.

Failed behavior

Recall diagnosis

When diagnosing a Project Knowledge recall, check in the order of Provider → Record → Query → Context:
Focus on verifying the following information:
  1. The source has entered the default Corpus or knowledge.local.include;
  2. The project, path, operation, phase and lifecycle of Record match the task.
  3. The source version is still valid.
  4. The Query has returned relevant candidates.
  5. The whyApplied and application history in the Context Manifest are in line with expectations.
Return to Project Knowledge , or continue reading Agent Learning Loop.
Last modified on August 31, 2026