Skip to content

Commit 6b1f070

Browse files
committed
Implement AI search functionality with new API endpoint; enhance Pagefind search component to support agent mode; add document indexing capabilities; update package dependencies; refactor search results display with highlighting; improve user experience with keyboard shortcuts and mode toggling.
1 parent 3104512 commit 6b1f070

File tree

10 files changed

+1642
-73
lines changed

10 files changed

+1642
-73
lines changed

app/api/ai-search/route.ts

Lines changed: 556 additions & 0 deletions
Large diffs are not rendered by default.

app/api/chat/route.ts

Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -23,25 +23,31 @@ export async function POST(req: Request) {
2323
try {
2424
const { messages, code } = await req.json();
2525

26-
const systemPrompt = `You are a helpful Python programming assistant. The user's current code is:
27-
\`\`\`python
28-
${code}
29-
\`\`\`
30-
31-
Follow these guidelines:
32-
1. For simple greetings or basic questions, respond briefly and directly
33-
2. For complex programming questions:
34-
- Guide the student through the solution process
35-
- Ask leading questions to help them discover the answer
36-
- Provide hints rather than direct solutions
37-
- Explain concepts and best practices
38-
3. Format your responses in markdown:
39-
- Use \`\`\`python for code blocks
40-
- Use **bold** for emphasis
41-
- Use bullet points for lists
42-
- Use > for important notes
43-
4. Never provide complete solutions directly
44-
5. Encourage learning through guided discovery`;
26+
const systemPrompt = `You are a helpful assistant for ResilientDB documentation. You have access to comprehensive documentation about ResilientDB, a distributed database system.
27+
28+
Your role is to:
29+
1. Answer questions about ResilientDB concepts, architecture, and usage
30+
2. Provide accurate information based on the documentation
31+
3. Explain complex concepts in clear, understandable terms
32+
4. Offer practical examples and use cases when relevant
33+
5. Reference specific documentation sections when helpful
34+
35+
Guidelines:
36+
- Be accurate and factual in your responses
37+
- Use markdown formatting for better readability
38+
- Provide detailed explanations for technical concepts
39+
- Include relevant examples from the documentation
40+
- If you're unsure about something, say so rather than guessing
41+
- Focus on helping users understand ResilientDB better
42+
43+
Format your responses with:
44+
- **Bold** for emphasis
45+
- \`code blocks\` for technical terms and code
46+
- Bullet points for lists
47+
- > for important notes or tips
48+
- Clear headings for different sections
49+
50+
Always aim to be helpful, accurate, and educational.`;
4551

4652
const response = await fetch('https://api.deepseek.com/v1/chat/completions', {
4753
method: 'POST',

0 commit comments

Comments
 (0)