Query context from the context tree
This guide walks you through querying context from your context tree using agentic search. There are two ways to query your context tree:/query(or/q) — Run directly in the ByteRover REPL for quick, manual lookupsbrv query— Executed by your coding agent for integration into coding workflows
Manual Query via /query
You can also query the context tree directly in the ByteRover REPL using the /query command (or /q shorthand):
When to Use /query vs Agent Prompts
| Approach | Best For |
|---|---|
/query in REPL | Quick lookups, ad-hoc questions, exploring what’s stored |
Agent prompts (brv query) | Complex workflows, multi-step tasks, when context feeds into code generation |
/query when you want to quickly check what knowledge is available before starting a task. Use agent prompts when the retrieved context should flow directly into your coding workflow.
What Makes This Intelligent?
Not Similarity but Agentic Search: ByteRover doesn’t just find similar documents. It reasons about what you’re asking for and strategically searches the context tree. Follows explicit relations: ByteRover follows the@domain/topic relations between topics to gather comprehensive, connected context.
Synthesizes information:
Instead of returning ranked documents, ByteRover reads relevant context files and synthesizes a coherent answer with citations.
Context-aware answers:
You get understanding, not just matches. ByteRover comprehends your query semantically and provides relevant, actionable information.
Multi-Step Queries
For complex tasks requiring different types of context, you can run multiple queries: Copy this prompt and paste it into your coding agent’s chat:Crafting Effective Queries
The quality of your results depends on your query. Here are some tips: Specific queries work better:You’re in Control of Your Queries
Thebrv query command is flexible and adapts to how you want to work: