akashA
Convex Community2w ago
1 reply
akash

Help me , stuck rag based agent . I want similar to this https://mikecann.blog/ agent "MikeAgent"

Hello I m building a chatbot for my college where student can ask queries related to college . I am using rag and agent components for custom knowledge based chatbot. i want something similar to https://mikecann.blog/ "mikeAgent" @wildcat . Help please 😭 . but i stuck i agent not calling my tools to get context for user message . Here is code spinnet `` typescript export const agent = new Agent(components.agent, { name: "College Assistant", languageModel: openai.chat("gpt-4o-mini"), instructions: You are a helpful VPM RZ SHAH college ai assistant chatbot. Your role is to help students with questions about:
tools: {
searchContext: createTool({
description: "Search the college knowledge base for information about admissions, exams, events, policies, and other college-related topics.",
args: z.object({
query: z.string().describe("The search query to find relevant information")
}),
handler: async (ctx, args) => {
const ragResult = await rag.search(ctx, {
namespace: "all-users",
query: args.query,
limit: 3,
vectorScoreThreshold: 0.3,
});
console.log("calling tool call \n");
return ragResult.entries.map((e) => ({ chunkContent: e.text, source: e.metadata?.storageId || "unknown" }));
},
}),
},
});
mikecann.blog
The Blog of Mike Cann
mikecann.blog
Was this page helpful?