Skip to content

Open source file-system and knowledge based agent template. Build AI agents that stay up to date with your knowledge base

up

Hugo Richard91bf967d44cc
diff --git a/apps/chat/app/components/ToolCallItem.vue b/apps/chat/app/components/ToolCallItem.vue
index 7937e0b..877e683 100644
--- a/apps/chat/app/components/ToolCallItem.vue
+++ b/apps/chat/app/components/ToolCallItem.vue
@@ -165,11 +165,12 @@ function truncateOutput(text: string, maxLines = 8): string {
:transition="{ duration: 0.35, ease: [0.25, 0.1, 0.25, 1] }"
>
<button
- class="flex items-center gap-2 w-full text-left py-0.5 group rounded -mx-1 px-1"
+ class="flex items-center gap-2 w-full text-left py-0.5 group rounded -mx-1 px-1 outline-none focus-visible:ring-1 focus-visible:ring-muted/30"
:class="[
canExpand ? 'cursor-pointer hover:bg-muted/5' : 'cursor-default',
isExpanded && 'bg-muted/5',
]"
+ :tabindex="canExpand ? 0 : -1"
@click="canExpand && (isExpanded = !isExpanded)"
>
<span class="relative flex size-1.5 shrink-0">
diff --git a/apps/chat/server/api/chats/[id].post.ts b/apps/chat/server/api/chats/[id].post.ts
index 8ada4ed..d2c4db4 100644
--- a/apps/chat/server/api/chats/[id].post.ts
+++ b/apps/chat/server/api/chats/[id].post.ts
@@ -16,29 +16,28 @@ Your knowledge may be outdated. ONLY answer based on what you find in the source
- NEVER make up information or guess - only state what you found
- Always cite the source file when quoting content
-## Search Strategy (IMPORTANT for speed)
+## Search Strategy
-1. **Explore first** - Start by discovering the available sources:
+1. **Explore first** (use relative paths, NEVER recursive):
\`\`\`bash
- ls /docs # See what sources are available
+ ls docs/ # List available sources (NOT ls -R)
+ ls docs/nitro/ # Explore one source
\`\`\`
-2. **Target specific directories** - Don't search everything at once:
+2. **Search with grep** (always limit results):
\`\`\`bash
- ls /docs/[source]/ # Explore the structure
- grep -r "keyword" /docs/[source] --include="*.md" -l | head -10
+ grep -r "keyword" docs/nitro --include="*.md" -l | head -5
\`\`\`
-3. **Use simple keywords**: one word is better than a phrase
+3. **Read files with cat**:
+ \`\`\`bash
+ cat docs/nitro/file.md
+ \`\`\`
-## Workflow
+## IMPORTANT
-1. User asks a question
-2. Explore available sources with \`ls\`
-3. Identify which source(s) are relevant
-4. Search within those specific directories
-5. Read the relevant files
-6. Answer based ONLY on what you found
+- Always provide a text response after searching
+- Use "| head -N" to limit output
## Response Style
diff --git a/apps/chat/server/utils/router/route-question.ts b/apps/chat/server/utils/router/route-question.ts
index abb8543..7fc0097 100644
--- a/apps/chat/server/utils/router/route-question.ts
+++ b/apps/chat/server/utils/router/route-question.ts
@@ -11,25 +11,23 @@ Analyze the user's question and determine the appropriate configuration for the
## Classification Guidelines
-**trivial** (maxSteps: 3, model: gemini-2.5-flash-lite)
+**trivial** (maxSteps: 4, model: gemini-2.5-flash-lite)
- Simple greetings: "Hello", "Thanks", "Hi there"
- Acknowledgments without questions
-**simple** (maxSteps: 6, model: gemini-2.5-flash-lite)
+**simple** (maxSteps: 8, model: gemini-2.5-flash-lite)
- Single concept lookups: "What is X?", "How to use Y?"
- Direct questions with likely clear answers
-- Questions about a single topic
-**moderate** (maxSteps: 12, model: gemini-3-flash)
+**moderate** (maxSteps: 15, model: gemini-3-flash)
- Comparisons: "Difference between X and Y?"
- Integration questions requiring exploration
-- Questions requiring multiple file searches
+- Questions requiring multiple searches
-**complex** (maxSteps: 20, model: gemini-3-flash or claude-opus-4.5)
+**complex** (maxSteps: 25, model: gemini-3-flash or claude-opus-4.5)
- Debugging scenarios
- Architecture questions
- Deep analysis requiring extensive research
-- Cross-topic questions
Use claude-opus-4.5 only for the most complex cases requiring deep reasoning.`
diff --git a/apps/chat/server/utils/router/schema.ts b/apps/chat/server/utils/router/schema.ts
index 185f898..ed3f0ac 100644
--- a/apps/chat/server/utils/router/schema.ts
+++ b/apps/chat/server/utils/router/schema.ts
@@ -5,7 +5,7 @@ export const agentConfigSchema = z.object({
.describe('trivial=greeting, simple=single lookup, moderate=multi-search, complex=deep analysis'),
maxSteps: z.number().min(1).max(30)
- .describe('Agent iterations: 3 trivial, 6 simple, 12 moderate, 20 complex'),
+ .describe('Agent iterations: 4 trivial, 8 simple, 15 moderate, 25 complex'),
model: z.enum([
'google/gemini-3-flash',
@@ -22,7 +22,7 @@ export type AgentConfig = z.infer<typeof agentConfigSchema>
export function getDefaultConfig(): AgentConfig {
return {
complexity: 'moderate',
- maxSteps: 12,
+ maxSteps: 15,
model: 'google/gemini-3-flash',
reasoning: 'Default fallback configuration',
}