You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Each agent maintains its own isolated knowledge base, ensuring that knowledge contexts are scoped to the specific agent you're working with. This provides better organization and prevents knowledge conflicts between different agents.
174
+
175
+
### Folder Structure
176
+
177
+
Knowledge bases are stored in the following directory structure:
178
+
179
+
```
180
+
~/.q/knowledge_bases/
181
+
├── q_cli_default/ # Default agent knowledge base
182
+
│ ├── contexts.json # Metadata for all contexts
183
+
│ ├── context-id-1/ # Individual context storage
184
+
│ │ ├── data.json # Semantic search data
185
+
│ │ └── bm25_data.json # BM25 search data (if using Fast index)
186
+
│ └── context-id-2/
187
+
│ ├── data.json
188
+
│ └── bm25_data.json
189
+
├── my-custom-agent/ # Custom agent knowledge base
190
+
│ ├── contexts.json
191
+
│ ├── context-id-3/
192
+
│ │ └── data.json
193
+
│ └── context-id-4/
194
+
│ └── data.json
195
+
└── another-agent/ # Another agent's knowledge base
196
+
├── contexts.json
197
+
└── context-id-5/
198
+
└── data.json
199
+
```
200
+
201
+
### How Agent Isolation Works
202
+
203
+
-**Automatic Scoping**: When you use `/knowledge` commands, they automatically operate on the current agent's knowledge base
204
+
-**No Cross-Agent Access**: Agent A cannot access or search knowledge contexts created by Agent B
205
+
-**Independent Configuration**: Each agent can have different knowledge base settings and contexts
206
+
-**Migration Support**: Legacy knowledge bases are automatically migrated to the default agent on first use
207
+
208
+
### Agent Switching
209
+
210
+
When you switch between agents, your knowledge commands will automatically work with that agent's specific knowledge base:
211
+
212
+
```bash
213
+
# Working with default agent
214
+
/knowledge add /path/to/docs
215
+
216
+
# Switch to custom agent
217
+
q chat --agent my-custom-agent
218
+
219
+
# This creates a separate knowledge base for my-custom-agent
220
+
/knowledge add /path/to/agent/docs
221
+
222
+
# Switch back to default
223
+
q chat
224
+
225
+
# Only sees the original project-docs, not agent-specific-docs
0 commit comments