Maintain Your Knowledge Base
Introduction
Once your Knowledge Base is deployed with an agent, keeping it current is essential. Over time, you may need to add new content, revise outdated entries, or remove documents that are no longer relevant.
This page explains how to:
- Insert new documents into a KB
- Update existing records
- Delete records by ID
All of this is handled via the same named queries you defined in your action package — typically insert_records
and delete_records
.
Inserting New Records
To add new content to your KB, use the insert_records
query provided in your action package template.
This adds a new document to your KB and automatically triggers embedding.
Content is indexed at insert-time. Ensure each record has a unique id
.
Updating an Existing Record
Updating content works the same way as inserting — as long as the id
remains the same, the new content overwrites the previous one.
Changing the id
will result in a new record being created instead of updating the existing one.
Deleting a Record
To remove a record from your KB, use the delete_records
query:
This permanently removes the record from your KB and its associated vector.
Tips for Keeping KBs Relevant
- Use consistent
id
conventions so updates work cleanly - Keep metadata fields aligned for filtering
- Automate updates if your KB syncs from an external source