Knowledge Base for Bots
The Knowledge Base (KB) is what makes an AI Assistant useful. Without KB content, the Assistant only has its personality prompt and the LLM's general training data to draw on; with a well-curated KB it can answer specific, up-to-date questions about your product, policies, and workflows.
This page focuses on how to organize KB content for bots. For the API reference (search endpoints, document CRUD, scopes), see the Knowledge Base API guide.
How KB search works
Every KB folder is a separate Vertex AI RAG corpus. When an Assistant runs a query:
- It searches each attached folder in parallel via vector similarity.
- The top chunks across all folders are merged, deduplicated, and reranked by distance (lower = more relevant).
- The merged context is sent to Gemini, which generates a grounded reply citing the chunks it used.
- A confidence score is computed from the chunks' relevance and the LLM's grounding agreement.
The Assistant compares that confidence to the bot's confidence_threshold. Above threshold → reply. Below threshold → escalate (or refuse, in KB-only mode).
Folder strategy
System folders
Every tenant starts with three system folders:
| Folder | Purpose |
|---|---|
| General | Catch-all for documents, FAQs, and manuals you upload directly. |
| Websites | Auto-populated by the website crawler. One folder regardless of how many domains you crawl. |
| Ticket Summaries | Auto-generated summaries of resolved support tickets (when ticket-summarization is enabled in your workspace settings). |
You can attach any combination of these to an Assistant.
Custom folders — when to split
Create a custom folder when you want isolation between content sets. Common reasons:
- Per-product — separate folders for Product A and Product B so a sales Assistant for Product A never accidentally cites Product B's pricing.
- Per-language — one folder per locale, attached to the language-specific Assistant.
- Per-audience — internal-only knowledge (
KB_internal) separate from customer-facing knowledge (KB_external). - Per-region — region-specific policies, hours, or compliance docs.
Don't over-split. Each folder is a separate corpus and a separate parallel vector search. 2–4 folders attached to a bot is fine; 20 is wasteful and slower.
Supported content types
| Type | How to add | Best for |
|---|---|---|
Upload via dashboard or POST /knowledge-base/documents | Product manuals, policy docs, brochures | |
| DOCX | Upload | Internal SOPs, longer-form articles |
| TXT / MD | Upload or paste | Snippets, READMEs, release notes |
| FAQ (text entry) | "Add FAQ" button — title + answer pairs | Frequently asked questions you've answered manually |
| Manual (text entry) | "Add Manual" button — longer free-text | How-to guides written directly in the dashboard |
| Website crawl | "Crawl website" — supply a URL, optional sitemap | Public marketing site, public help center |
What works well
- Short, focused chunks. A 500–1500-word doc on a single topic outperforms a 50-page doc covering ten things.
- Clear titles. "Return policy for electronics" > "policy_v3_FINAL.pdf".
- Real customer questions. If you've answered the same question in support 20 times, write it as an FAQ.
- Up-to-date content. Stale info will be retrieved and confidently cited — set a recrawl schedule (below) and prune obsolete docs quarterly.
What works poorly
- Image-heavy PDFs (slide decks, infographics). The crawler extracts text but loses the visual context.
- Login-gated pages. The crawler runs unauthenticated; it can only see public URLs.
- Spreadsheets. Tabular data doesn't chunk well — convert key tables into Markdown manually if you need them.
- Wikis with stale redirects. Crawl scope creep — set a strict include-prefix.
Website crawls
For a website-crawl folder:
| Setting | Description |
|---|---|
| Start URL | The root URL to crawl from (e.g., https://example.com/help). |
| Sitemap URL | Optional. If supplied, the crawler uses sitemap order; otherwise it does breadth-first link discovery. |
| Include prefix | Only crawl URLs starting with this prefix. Prevents the crawler from wandering off the help center into your blog. |
| Recrawl cadence | manual, daily, weekly, monthly. Daily is fine for active docs sites; weekly is the most common choice. |
Crawls run in the background. You'll get a Slack/email notification on completion if you've set that up; otherwise the folder page shows a progress bar. Vertex AI imports happen in batches of 25 GCS files per call automatically — you don't manage that.
Multi-bot folder reuse
You can — and should — attach the same KB folder to multiple Assistants. There's no duplication cost: the corpus is shared.
Common pattern:
- One General folder with company-wide policies.
- One Websites folder with the public help center.
- Per-product folders.
Then:
| Assistant | Attached folders |
|---|---|
| Support EN | General, Websites, Product-A |
| Sales EN | General, Websites, Product-A |
| Support DE | General, Websites-DE, Product-A-DE |
The bot list view shows a "Used by N bots" badge per folder so you can see reuse at a glance.
Recrawl & freshness
- Documents you uploaded are static. To update them, edit and re-upload (replaces the previous version).
- FAQs and manuals are edited in place.
- Website crawls refresh on the schedule you set. The first crawl indexes everything; subsequent crawls only re-import pages whose
etag/last-modifiedindicates a change.
Avoid setting daily recrawls on huge sites unless you genuinely change them daily. Each crawl consumes bandwidth and Vertex AI ingest quota.
Cost & billing
KB queries are billed per bot interaction, not per chunk retrieved. See the Knowledge Base API guide for the price table.
What's next
- Build an Assistant — attach KB folders to a bot.
- Prompt Engineering — tune
kb_only_modeandconfidence_threshold. - Knowledge Base API reference — programmatic CRUD and search endpoints.