Help me , stuck rag based agent . I want similar to this https://mikecann.blog/ agent "MikeAgent"
`` 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" }));
},
}),
},
});
