Skip to main content
Extending Qoder CLI

Knowledge Base

Connect team and project knowledge to Qoder CLI CN so the Agent reuses established experience when completing tasks

The knowledge base is the long-term knowledge about your project and team that Qoder CLI CN can retrieve and reuse when completing tasks. It is not the temporary context within a conversation, but content that accumulates across sessions and tasks: project conventions, architecture notes, module responsibilities, code standards, and solutions to common problems. With a knowledge base, the Agent doesn't have to understand the project from scratch every time. It can:
  • Follow the team's established conventions and standards instead of having you re-explain them each time.
  • Quickly locate relevant modules and understand module boundaries and dependencies.
  • Reuse past pitfalls and validated solutions, reducing repeated mistakes.
Qoder CLI CN's knowledge comes mainly from three layers: project instructions and rules, long-term memory, and structured knowledge modules. This page covers their differences, how to bring them in, and how to make them work in everyday use.

The three layers of knowledge

Project instructions and rules

Project instruction files (AGENTS.md) and rule files describe "how things should be done in this project" — which package manager to use, directory naming conventions, test commands, code style preferences, and so on. They are committed to version control with the project, shared by the team, and loaded automatically by the Agent when a session starts. This is the most fundamental and most used knowledge layer, ideal for project conventions all contributors should follow. For detailed file locations and loading logic, see Memory.

Long-term memory

Long-term memory keeps preferences, facts, and habits across sessions, split into personal level (applies to all projects) and project level (applies to the current project only). Unlike project instructions, memory leans toward "accumulated experience and preferences," and can keep growing and being organized as you use the tool. Qoder CLI CN provides memory management capabilities to maintain this content:
  • The built-in memory-management subagent adds, deduplicates, and organizes memory entries, routing them to the right storage location.
  • /remember reviews automatically accumulated memory, suggests promotions into project or local instruction files, and identifies stale, conflicting, and duplicate entries.
For memory layers, routing rules, and management, see Memory.

Structured knowledge modules

For larger codebases, you can organize subsystem knowledge into structured knowledge modules (for example, per-module description pages) covering that module's architecture, key files, responsibility boundaries, and usage. This knowledge lives in the project as documents, and the Agent retrieves it on demand when handling related tasks, instead of stuffing everything into the context at once. Structured knowledge modules are ideal for capturing domain knowledge that "takes real effort to figure out and gets used repeatedly," so both new team members and the Agent can get up to speed quickly.

How to bring in a knowledge base

Start with /init

Run /init in the project root, and Qoder CLI CN analyzes the project and generates an initial project instructions file. This is the simplest starting point: get a basic project description first, then fill it in gradually.

Record project conventions

Write the conventions all contributors should follow into the project instructions file (AGENTS.md), for example:
# Project conventions

- Use bun rather than npm to manage dependencies
- Name API routes in kebab-case
- Run `bun test` before committing
- Prefer a functional style

Accumulate and organize memory

In everyday use, let Qoder CLI CN remember recurring preferences and facts; then use /remember to periodically review this auto-memory, promote what's worth keeping long-term into project or local instruction files, and clean up stale and duplicate entries.

Capture structured knowledge

For complex subsystems, organize the clarified architecture and conventions into structured knowledge modules and commit them to the project. Team members and the Agent alike can then reuse this knowledge instead of re-exploring.

How the Agent uses the knowledge base

When completing tasks, Qoder CLI CN treats the knowledge base as part of its background information:
  • Automatic loading: at session start, project instructions and rules, plus relevant long-term memory, are loaded into the context.
  • On-demand retrieval: for a specific task, the Agent retrieves the knowledge relevant to it (for example, a module's description) instead of loading everything at once, saving context space.
  • As constraints: retrieved conventions and standards act as behavioral constraints, shaping the Agent's planning and code generation so output stays consistent with the team's existing practices.
  • Continuous updates: after a task, if knowledge turns out to be inconsistent with the current code, update the corresponding knowledge to keep the knowledge base accurate.

Best practices

  • Only write knowledge that will be reused: the value of a knowledge base is reuse. Put in content that helps later tasks go better, faster, or closer to team conventions — not one-off temporary information.
  • Keep it lean and accurate: project instruction files load in every session, and overly long ones consume context. Move details into structured knowledge modules, keeping only the outline and index in the instructions file.
  • Be clear about layers: conventions shared by all contributors go in project instructions; personal preferences go in local or personal-level memory; deep knowledge of complex subsystems goes in structured knowledge modules.
  • Maintain regularly: as the code evolves, use /remember to organize memory and update instruction files in time, so stale knowledge doesn't mislead the Agent.
  • Avoid conflicts and duplication: don't repeat the same convention across layers. When conflicts appear, keep the newest and most accurate copy.

Next steps

  • Understand the full memory mechanism: Memory.
  • Understand how context works together: Context.
  • Reuse team workflows with Skills: Skills.