Limit what an agent reads

A new agent reads none of your knowledge. Pick documents, and it reads only those.

Before you start

You need an agent and knowledge. See Add knowledge.

Pick the documents

  1. Set your agent's knowledge to the document's path:
    agents/support.ts
    import { agent } from "veryfront/agent"; export default agent({  id: "support",  name: "Support assistant",  system: "Answer customer questions about orders and refunds from the project's knowledge. Keep replies to two sentences.",  knowledge: "knowledge/returns-policy.md",});
    knowledge also takes a list of paths, a glob such as "knowledge/policies/**" for a whole folder, or include and exclude patterns: see Include or exclude knowledge folders.
  2. Start the project with npm run dev.
  3. In Studio, open Chat.
  4. Pick Support assistant.
  5. Ask "How many days do I have to return an item?". You should now see it call veryfront__search_knowledge, which finds only the returns policy, and reply 45 days.

Try it in a sandbox

  1. Create a project

  2. Before you start: knowledge

  3. Set the knowledge

  4. Start it

  5. Ask it

Try it out

Next steps