Configure the knowledge base plugin for OpenClaw Agents to enable RAG-based question answering.
Effect Comparison
The following example demonstrates the difference between the default Agent and the Agent with the knowledge base plugin enabled.
Default Agent (No Knowledge Base)
User: What is the Alibaba Cloud Bailian phone X1?
Agent: I'm not aware of a specific "Alibaba Cloud Bailian phone X1". Please provide more details.
Agent with Knowledge Base Plugin
User: What is the Alibaba Cloud Bailian phone X1?
Agent: Based on the retrieved knowledge base content, the Alibaba Cloud Bailian phone X1 is a flagship smartphone featuring...
Installation
Configure the knowledge base plugin in your OpenClaw Agent settings. The plugin uses the knowledge base retrieval API to search for relevant content and inject it into the Agent's context.
Configuration
| Parameter | Type | Default | Description |
|---|---|---|---|
apiKey (required) | string | - | Starts with sk- |
workspaceId | string | - | The business space ID |
indexId (required) | string | - | The knowledge base ID to search |
topK | number | 5 | The number of chunks returned per search |
enableRewrite | boolean | false | Enable query rewriting for better retrieval |