Knowledge Routes
The knowledge API can be used to add additional documents to the knowledge base of the agent. App creators must implement two routes to enable the knowledge API.
/knowledge/listDocuments: Returns a list of all documents that the App wants to add. This list will be compared to previous requests and new or updated documents will be enqueued for syncing.
/knowledge/getDocument: Returns the content of a specific document. The content will then be embedded and added to the vector database.
List Documents
Code
id is used as an identifier for the document, it can be anything that uniquely identifies a document on your system.
name is the name of the document and will be displayed in the knowledge base.
lastUpdated: The timestamp when the document was last updated. This is used to determine if the document has changed since the last request.
Get Document
Code
id: The identifier of the document.
name: The name of the document.
content: Plain text content of the document.
updatedAt: Timestamp of the last content update
metadata: Additional metadata about the document in JSON format.
You can use the parseFile function from the bridge to convert various document types to plain text.