Knowledge Base Sync
Keep TR-AI's vector index up to date as your knowledge base evolves.
How sync works
TR-AI crawls your KB sources and generates vector embeddings for each content chunk. These embeddings are stored in the database and used for similarity search when a ticket arrives.
The sync process:
- Crawls your website starting from the root URL, following internal links
- Fetches pages from Confluence or Notion via API
- Splits content into ~400-token chunks
- Generates 384-dimension embeddings using the all-MiniLM-L6-v2 model (local WASM)
- Stores chunks and embeddings in the database
- Uses SHA-1 deduplication to skip unchanged pages
Automatic sync by plan
Under Settings → Knowledge base sync you choose how often TR-AI checks your documentation for changes (it only re-embeds pages that changed). Each plan sets the most frequent interval; choosing a slower one is always possible.
| Plan | Most frequent auto-sync | Knowledge sources | Ticket history learned from |
|---|---|---|---|
| Starter | Weekly | 1 source | 6 months |
| Bronze | Daily | 3 sources | 12 months |
| Growth Pro | Every 6 hours | Unlimited | 24 months |
After a downgrade, a previously chosen faster interval is kept but auto-sync runs at the new plan's interval.
Triggering a manual re-index
Trigger a re-index from the Dashboard → Knowledge Base card → Re-index button. This rebuilds all embeddings from scratch.
You can also trigger a re-index via the API:
POST /api/admin/reindex
Content-Type: application/json
// Re-index a specific trial account:
{ "trialAccountId": 42 }
// Re-index all accounts (admin only):
{}Auto re-index on startup
On server startup, TR-AI automatically detects trial accounts that have KB chunks but no 384-dimension embeddings (e.g. accounts that were indexed with the old 1536-dimension OpenAI model). These accounts are re-indexed in the background automatically.
While a re-index is running, tickets for that account are routed directly to the agent (routed_to_agent outcome) to avoid low-quality resolutions.
Vector stats
Check the current state of your embeddings via the API:
GET /api/admin/vector-stats?trialAccountId=42
Response:
{
"chunks": [
{ "model": "minilm384", "dims": 384, "count": 1247 },
{ "model": "openai", "dims": 1536, "count": 0 }
]
}A healthy account should show a non-zero count for minilm384 (384 dims) and zero for openai (1536 dims). If you see 1536-dim vectors, trigger a re-index to rebuild with the local model.
KB source limits
| Source | Limit | Notes |
|---|---|---|
| Website | Up to 1,000 pages per crawl | Cursor-paginated; SHA-1 dedup skips unchanged pages |
| Confluence | All pages in the specified space | Concurrency: 6 parallel requests |
| Notion | All pages shared with the integration | Depth: 5 levels; concurrency: 6 |
| KB URLs stored | 2 per account (current limit) | URLs 3–5 entered in the UI are silently dropped — fix planned |