Skip to main content

Curate context to your context tree

This guide walks you through curating context to your context tree. curate can both be executed by you via /curate in the REPL or by your coding agent (in your prompt to your coding agent, simply mention ByteRover and it will then run brv curate accordingly).curate offers two modes:
  • Interactive mode: Manually select domain and topic, then add content (for developers who want full control)
  • Autonomous mode: Automatically detects domains, searches for duplicates, organizes hierarchically, and prevents duplication using intelligent processing
Both modes use the same content structure. Let’s use this example context:
Task: Add a health check endpoint to the Express server

Steps:

1. Create basic Express server setup
   - File: src/server.ts
   - Set up Express app with TypeScript
   - Configure basic middleware

2. Create health check route
   - File: src/routes/health.ts
   - Implement GET /health endpoint
   - Return status, timestamp, uptime

3. Add types for response
   - File: src/types/health.ts
   - Define TypeScript interface

4. Create tests
   - File: tests/health.test.ts
   - Test endpoint returns 200
   - Validate response structure

5. Update package.json scripts
   - Add dev script
   - Add test script

Success Criteria:
- GET /health returns 200 status
- Response includes: status, timestamp, uptime
- TypeScript compiles without errors
- Tests pass

The Easier Way - Let Your Coding Agent Work with Us

The context tree evolves with your project. Your coding agent can intelligently update existing knowledge. To update context, copy this prompt and paste it into your coding agent’s chat (e.g., Cursor, Claude Code, etc.):
> update the context tree so that when creating tests, the health endpoint should return both 200 status and JSON with health: ok
Your coding agent will then execute:
brv curate "Task: Add a health check endpoint to the Express server

Steps:

  1. Create basic Express server setup
     - File: src/server.ts
     - Set up Express app with TypeScript
     - Configure basic middleware

  2. Create health check route
     - File: src/routes/health.ts
     - Implement GET /health endpoint
     - Return status, timestamp, uptime

  3. Add types for response
     - File: src/types/health.ts
     - Define TypeScript interface

  4. Create tests
     - File: tests/health.test.ts
     - Test endpoint returns 200
     - Test endpoint returns JSON with health: ok

  5. Update package.json scripts
     - Add dev script
     - Add test script

Success Criteria:
  - GET /health returns 200 status
  - Response includes: status, timestamp, uptime
  - TypeScript compiles without errors
  - Tests pass"
ByteRover detects that this relates to existing health check context and updates the appropriate topic rather than creating a duplicate.

Two Manual Ways to Curate Context

Interactive Mode (Manual Selection)

Perfect for developers who want full control over where their context is placed. You manually navigate the context tree, select the domain and topic, then add your content. Step 1: Run the command
# In the REPL:
/curate
Step 2: Navigate and select location The CLI opens an interactive file selector. Navigate through the context tree to choose where to add your content:
  • Select a domain (e.g., structure/, testing/, code_style/)
  • Navigate to or create a topic folder
Step 3: Create topic Enter a topic name when prompted (e.g., “health-check-endpoint”) Step 4: Add content The CLI creates the topic folder with context.md and opens it in your default editor. Add the health check context:
# Health Check Endpoint

Task: Add a health check endpoint to the Express server

Steps:

1. Create basic Express server setup
   - File: src/server.ts
   - Set up Express app with TypeScript
   - Configure basic middleware

2. Create health check route
   - File: src/routes/health.ts
   - Implement GET /health endpoint
   - Return status, timestamp, uptime

3. Add types for response
   - File: src/types/health.ts
   - Define TypeScript interface

4. Create tests
   - File: tests/health.test.ts
   - Test endpoint returns 200
   - Validate response structure

5. Update package.json scripts
   - Add dev script
   - Add test script

Success Criteria:
- GET /health returns 200 status
- Response includes: status, timestamp, uptime
- TypeScript compiles without errors
- Tests pass
Example output:
✔ Target context location: [Navigate through domains/topics]
✔ New topic name: health-check-endpoint

Created: .brv/context-tree/structure/health-check-endpoint/context.md
Opening context.md for editing...

Autonomous Mode (Intelligent Curation)

Perfect when you want ByteRover to automatically categorize and organize your context. The autonomous mode detects domains, searches for duplicates, and places content intelligently using semantic understanding. Run the command with your context:
# In the REPL:
/curate "Task: Add a health check endpoint to the Express server

Steps:

1. Create basic Express server setup
   - File: src/server.ts
   - Set up Express app with TypeScript
   - Configure basic middleware

2. Create health check route
   - File: src/routes/health.ts
   - Implement GET /health endpoint
   - Return status, timestamp, uptime

3. Add types for response
   - File: src/types/health.ts
   - Define TypeScript interface

4. Create tests
   - File: tests/health.test.ts
   - Test endpoint returns 200
   - Validate response structure

5. Update package.json scripts
   - Add dev script
   - Add test script

Success Criteria:
- GET /health returns 200 status
- Response includes: status, timestamp, uptime
- TypeScript compiles without errors
- Tests pass"
Example output:
Starting autonomous context tree curation...
🔧 detect_domains → Executing...
✅ detect_domains → Complete
🔧 find_knowledge_topics → Executing...
✅ find_knowledge_topics → Complete
🔧 create_knowledge_topic → Executing...
✅ create_knowledge_topic → Complete

Response:
I have added the context to the context tree. The context tree has been updated with the new information.
How Autonomous Mode Works:
  1. Domain Detection: Analyzes your input and detects relevant domains (code_style, testing, structure, etc.) using semantic understanding—not keyword matching.
  2. Search Existing Knowledge: Searches your context tree for related existing knowledge to prevent duplication.
  3. Decide Create or Update: Determines whether to create a new topic or update an existing one.
  4. Hierarchical Organization: Structures content into the appropriate hierarchy: domain → topic → (optional) subtopic.
  5. Add Relations: Identifies and creates explicit @domain/topic relations to connect related knowledge, building a navigable knowledge graph.

File Reference

You can include text/code files in your codebase when curating. Use the @ syntax or the --files flag to reference files:
# In the REPL:
/curate "API documentation" @src/api.ts @README.md
Constraints:
  • Maximum 5 file references per curation
  • Files must be text-based (no binary files)
  • Paths are relative to project root
Examples:
# In the REPL:
/curate "Authentication flow" @src/auth/login.ts @src/auth/oauth.ts
/curate "Database schema" @prisma/schema.prisma
/curate --files src/components/Button.tsx src/styles/button.css

Customize Your Intention

The power of the CLI is its flexibility—autonomous mode adapts to how you want to organize your knowledge. For example: Copy this prompt and paste it into your coding agent’s chat:
> curate the following context about health check implementation
> [Your content here]
> break it into small context pieces
Your coding agent will execute the command, and ByteRover will intelligently divide your content into separate, focused topics—making it easier to reference specific parts later.

You’re in Control of Your Context

You decide exactly how your context is organized. Autonomous mode is flexible and follows your lead.

Breaking Context Into Smaller Pieces

Want granular organization? Copy this prompt and paste it into your coding agent’s chat:
> curate the following context, break it into small focused pieces
> [Your content here]
ByteRover will divide content into separate topics, each with clear scope.

Keeping Context Together

Prefer cohesive organization? Copy this prompt and paste it into your coding agent’s chat:
> curate the following context, keep it together as one topic
> [Your content here]
ByteRover will create a single, comprehensive topic instead of multiple smaller ones.

Summarizing Before Storing

Have lots of detail but want condensed knowledge? Copy this prompt and paste it into your coding agent’s chat:
> curate the following context, summarize it before adding
> [Your content here]
ByteRover extracts essential information, keeping your context tree focused and concise.

Mix and Match

Combine approaches! Some contexts broken down, others kept whole, some summarized. ByteRover adapts to your workflow—you’re always in the driver’s seat. ByteRover follows your instructions for granularity and organization style, ensuring your context tree matches your team’s preferences.