Patterns pick knowledge by folder. Include a folder and the agent reads the documents in it; exclude a folder inside it to leave those out.
Before you start
You need an agent and knowledge in folders. See Limit what an agent reads.
Include a folder, exclude another
- Set your agent's
knowledgeto patterns.trueincludes a folder andfalseleaves one out:agents/support.tsimport { 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/policies/**": true, "knowledge/policies/drafts/**": false, },}); - Start the project with
npm run dev. - Open Chat in Studio.
- Pick Support assistant.
- Ask "How many days do I have to return an item?". You should now see it reply 45 days, not the draft's 60.
Try it in a sandbox
Create a project
Before you start: knowledge in folders
Set the patterns
Start it
Ask it