botserver/docs/src/chapter-03/README.md

38 lines
1.7 KiB
Markdown
Raw Normal View History

## gbkb Reference
The knowledgebase package provides three main commands:
2025-11-23 13:46:55 -03:00
- **USE KB** Loads and embeds files from the `.gbkb/collection-name` folder into the vector database, making them available for semantic search in the current session. Multiple KBs can be active simultaneously.
- **CLEAR KB** Removes a knowledge base from the current session (files remain embedded in the vector database).
- **ADD WEBSITE** Crawl a website and add its pages to a collection.
**Example:**
```bas
2025-11-21 23:23:53 -03:00
' Add support docs KB - files from work/botname/botname.gbkb/support_docs/ are embedded
2025-11-23 13:46:55 -03:00
USE KB "support_docs"
2025-11-21 23:23:53 -03:00
' Add multiple KBs to the same session
2025-11-23 13:46:55 -03:00
USE KB "policies"
USE KB "procedures"
2025-11-21 23:23:53 -03:00
' Remove a specific KB from session
2025-11-23 13:46:55 -03:00
CLEAR KB "policies"
2025-11-21 23:23:53 -03:00
' Remove all KBs from session
2025-11-23 13:46:55 -03:00
CLEAR KB
```
2025-11-21 23:23:53 -03:00
2025-11-23 20:12:09 -03:00
The vector database retrieves relevant chunks/excerpts from active KBs and makes them available to the system AI automatically, providing context-aware responses during conversations.
## See Also
- [KB and Tools System](./kb-and-tools.md) - Complete reference for knowledge bases and tools
- [Vector Collections](./vector-collections.md) - How vector search works
- [Document Indexing](./indexing.md) - Automatic document processing
- [Semantic Search](./semantic-search.md) - Meaning-based retrieval
- [Context Compaction](./context-compaction.md) - Managing conversation context
- [Caching](./caching.md) - Performance optimization
- [Chapter 2: Packages](../chapter-02/README.md) - Understanding bot components
- [Chapter 5: BASIC Keywords](../chapter-05/README.md) - Complete command reference
- [Chapter 7: Configuration](../chapter-07/config-csv.md) - Bot configuration options
- [Chapter 9: Knowledge Base](../chapter-09/knowledge-base.md) - Advanced KB patterns