import { Agent } from "oncell";
const agent = new Agent("support", {
instructions: `You are a support agent.
Always search the knowledge base before answering.
If you can't resolve an issue, escalate to a human.`,
model: "kimi-k3",
skills: {
escalation: {
when: "Issue cannot be resolved or customer is frustrated",
guide: "Use askHuman to escalate. Acknowledge the frustration.",
model: "claude-opus",
},
},
tools: ["files", "memory"],
});
agent.chat(async ({ message, user }) => {
const docs = await agent.files.search(message);
return agent.llm(message, {
context: docs,
autoContext: true,
});
});
// Upload your knowledge base:
// oncell files push ./docs/ support
export default agent;