What is a Context Tree?
A context tree is your project’s hierarchically organized knowledge base stored in.brv/context-tree/. It captures patterns, best practices, and learnings in a structured format that’s both human-readable and intelligently searchable.
Structure
The context tree organizes knowledge into a three-level hierarchy:1. Domains
These are the default top-level domains that group related knowledge:- code_style - Coding standards, patterns, and conventions
- testing - Testing strategies and patterns
- structure - Project architecture and organization
- design - UI/UX and visual design patterns
- compliance - Security, legal, and regulatory requirements
- bug_fixes - Solutions to known issues
2. Topics
Specific subjects within each domain:3. Subtopics (Optional)
Deeper organization within topics (maximum one level):4. Context Files
Each topic (and subtopic) contains acontext.md file with:
- Content - Your knowledge in markdown format (explanations, code examples, etc.)
- Relations - Links to related topics (optional
## Relationssection)
context.md:
Relations: The Knowledge Graph
Relations create explicit connections between topics using@domain/topic/subtopic notation.
Why relations matter:
- Enable graph-like navigation between related knowledge
- Not based on similarity scores - these are explicit, intentional links
- Help find comprehensive context by following connections
- Prevent knowledge silos
Why This Matters
Human-readable and git-friendly:- Browse the context tree in your file explorer
- Edit
context.mdfiles with any text editor - Track changes with git
- Review in pull requests
- Knowledge is categorized by domain and topic
- Easy to find what you need
- Clear structure vs flat document storage
- ByteRover follows connections between topics
- More reliable than similarity-based search
- Intentional knowledge graph vs automatic clustering
Common Domains
When usingbrv curate, ByteRover automatically detects and organizes your context into these default domains:
- code_style - How code should be written
- testing - How to test the system
- structure - How the project is organized
- design - Visual and UX patterns
- compliance - Requirements and constraints
- bug_fixes - Known issues and solutions
.brv/context-tree/ or query them with brv query.