How it works
When you save a query named “AGENTS.md” (case-sensitive) in the Cloud Console:- The ClickHouse Assistant chat agent automatically loads this file when a message is sent
- The content is placed within a structured content tag and injected into the agent’s system prompt
- The instructions are applied to all ClickHouse Assistant chat conversations in that service
Creating AGENTS.md
1
Create the saved query
- In the Cloud Console, create a new query
- Name it exactly: “AGENTS.md” (case-sensitive)
- Write your custom instructions in the query text editor (not actual SQL)
- Save the query
2
Add your instructions
Structure your instructions using clear, actionable language. Include:- Business rules and calculations
- Data structure guidance
- Domain-specific terminology
- Common query patterns
- Performance optimization rules
Best practices
Treat context as a finite resource
Context is precious—every token depletes the agent’s “attention budget.” Like humans with limited working memory, language models experience performance degradation as context grows. This means finding the smallest possible set of high-signal tokens that maximize the likelihood of your desired outcome.Find the right altitude
Strike a balance between two extremes:- Too specific: Hard coding brittle if-else logic that creates fragility and maintenance complexity
- Too vague: High-level guidance that fails to give concrete signals or falsely assumes shared context
Organize with structured sections
Use XML tags or Markdown headers to create distinct, scannable sections:Provide diverse, canonical examples
Examples are the “pictures worth a thousand words.” Rather than stuffing every edge case into your prompt, curate a focused set of diverse examples that effectively portray expected behavior.Keep it minimal yet complete
- Include only frequently-needed instructions
- Be concise—larger context degrades performance due to “context rot”
- Remove outdated or rarely-used rules
- Ensure sufficient information to guide desired behavior