Knowledge Bases (RAG)¶
A Knowledge Base (KB) is your own document corpus that agents can consult while producing answers. Whiskers splits documents into chunks, vectorizes them and, while an agent runs, injects the chunks relevant to the question into the model's context (Retrieval-Augmented Generation).
Concepts¶
- A KB is independent of agents and can be attached to many agents (M:N) — no copies are kept for the same corpus.
- Every KB is defined with an embedding model alias (e.g.
embedding). Different embedding models are different vector spaces; a KB's model can be changed later with a re-embed operation (below). - Isolation is absolute: KB content is only searchable within your own tenant.
Adding documents (ingestion)¶
Knowledge Bases → [KB] → Add Document offers two paths: paste text (title + content + optional source label) or upload a file (txt, md, csv, json, pdf, docx, xlsx, pptx; OpenDocument odt/ods/odp; legacy Office doc/xls/ppt; images png/jpg/tiff/bmp/webp and scanned PDFs are read with a local OCR engine — it ships with the application image, see Agents → OCR; 25 MB). The content is:
- Chunked structure-aware (respecting paragraph/sentence boundaries, with overlap for context),
- Vectorized with the KB's embedding model,
- Written to the vector store.
Document states: Pending → Ingested (success) or Failed (with the error message).
What is stored where¶
- The original file is not stored. The uploaded or downloaded file itself (Word, PDF, image) is not kept; the file in your source stays where it is.
- The extracted text is stored in the database. Chunks and vectors are produced from this text. When you change the embedding model, correct a table layout, or the vectors have to be regenerated, the file is not downloaded, parsed or run through OCR again; only the embedding is redone.
- Vectors are stored in the vector store and are derived from the text. Vectors are the large part in storage terms: the text takes a small fraction of the space the vectors take for the same corpus.
- For a document you add by hand, this text is the only copy. It is not tied to a source, so if it is deleted you have to upload it again.
Backups rely on this split: even when vectors are left out of the backup, they are regenerated from the stored text after a restore (Backup and Restore).
A summary line sits above the document list (how many documents are ingested, pending and failed, and the total number of chunks). The list is paged; use the status filter to see only the failed ones, or search by title or folder name. The summary refreshes on its own while documents are being processed.
Large documents → process in background
If you turn on Process in background when adding a document, the add returns immediately in the Pending state and processing completes in the background — the screen does not have to wait for large content. Track the state in the document list.
Uploaded files are not written back to an attached source
A knowledge base can have a source attached (S3, SharePoint, Google Drive, SMB) and receive manual uploads at the same time. Sync is one-way: it reads from the source, never writes to it, and never deletes a manually uploaded document. If the same file arrives both ways you get two copies. Documents read with OCR carry an "N pages read with OCR" note in the list — letters in a skewed or low-quality scan can come out wrong.
Text in images embedded in documents¶
The text in images inside Word (docx), PowerPoint (pptx) and PDF
documents that have a text layer is read too: screenshots in a procedure
document, tables pasted onto a slide as a picture, labelled diagrams. The text
goes into the document where the image sits, with an [Görsel metni] (image
text) prefix — the agent knows it was read from an image. Reading uses the same
local OCR engine as scanned pages; the image never leaves your organisation
and is not stored, only the text read from it is. This is character
reading: what a photo or diagram means is not interpreted.
In our measurement some presentations had almost all of their content in images (a 28-word installation-flow deck grew to 560 words with its images). Reading took about 0.1 seconds per image on average, a few seconds per deck.
- On/off: per knowledge base, with the Read text in images switch on the KB detail page. It is on by default. You can turn it off to shorten sync time on a very large corpus.
- Not retroactive: the switch applies to documents processed from then on. A file is not re-read until it changes at the source; to have the images of an already processed document read, upload the file again or update it at the source.
- Images that are not read: images whose short side is under 100 pixels (icons, bullets) · an image repeated in the same document (a logo on every slide is read once) · images yielding fewer than 5 words or read with low confidence (logos, photo texture — so that meaningless letters do not enter the document) · vector drawings (WMF/EMF).
- Limits: at most 200 images and 120 seconds of reading per document. If a limit is reached the document is not rejected; the remaining images are not read. If image text would push the document over its text cap, the last image texts are dropped.
- Visible in the document list: an "N images read" note and, if any image could not be read, an "M images not read" note.
- Out of scope: images embedded in Excel, and images in OpenDocument and legacy Office (97-2003) documents.
Images are not read in documents attached to a chat
This reading happens only in knowledge bases; text in images inside a document attached to a chat or a room is not read. This is a deliberate decision: a chat document is processed while you upload it, and reading its images would lengthen your wait (5-20 seconds for a deck with images). If you need the text of an image in a chat, paste the image separately or put the document into a knowledge base. See Attaching temporary documents to a chat.
Large documents and large corpora¶
- Document cap: the extracted text of a knowledge base document can be at most 2,000,000 characters and a PDF at most 2,000 pages (separate from the cap for documents added to a chat — see Limits). A larger document is rejected with a visible reason; it is never silently truncated.
- Quota is checked first: a large document is sent to the provider in groups of chunks, but quota is checked once, up front, for the whole document — if it does not fit, the upload does not start rather than stopping halfway.
- No half documents: if a provider or vector store error happens midway, the document becomes Failed and the vectors written so far are deleted again; a half document never enters search. The usage actually processed up to that point is charged to your quota (the provider billed it). You can retry the document.
- Very large corpora (self-hosted): for corpora with millions of chunks, the team running the installation can run the vector store with a compressed (int8) and on-disk profile — vector memory drops roughly fourfold, it applies to existing knowledge bases without re-embedding, and search is re-scored with the original vectors. The effect of compression on answer quality depends on the corpus; we recommend measuring it with a pilot before enabling it on a large corpus.
Attaching a knowledge base to an agent¶
A knowledge base does nothing on its own — it has to be attached to an agent. The link is made from the “Knowledge Bases” tab on the agent detail page: Agents → [agent] → Knowledge Bases → select → Attach.
An agent with attached knowledge bases retrieves the chunks relevant to the input on every run and adds them to its context — this works in all archetypes (Simple, ReAct, the Workflow supervisor, Human-in-the-Loop steps, and the Orchestrator planner). In workflows the sub-agents, and in orchestrators the workers, also use their own attached knowledge bases.
Why it is not in the agent creation form: one knowledge base can be attached to several agents and the content is not duplicated. The link is therefore a separate relation, not part of the agent's configuration.
Takes effect immediately, even on a published agent
The link is stored on the agent itself, not on its version. Attaching a knowledge base to a published agent takes effect right away; there is no need to republish. (Prompt, model and tool changes work differently — those are edited on a draft and republished.)
You can see which agents use a knowledge base on the knowledge base detail page. Attaching and detaching happens only on the agent side; the knowledge base page just shows the list.
Check this list before deleting
Deleting a knowledge base removes its documents and vectors. Attached agents keep running but lose the corpus — they raise no error, their answers are just silently incomplete. The delete confirmation lists the affected agents.
Source attribution in answers¶
When an agent uses a knowledge base, the names of the documents used for that
answer appear beneath the response, numbered: [1] Assembly.docx.
The list is produced from the documents that were actually searched, not from the text the model wrote — so it stays correct even if the model forgets to mention a source, and a document that was never used can never appear.
Per-sentence citations¶
The model is instructed to append the source number to every fact it takes from
the knowledge base (… every six months [1].). In the chat screen those markers
are clickable: clicking one highlights the matching document in the source
list below the answer.
Temporary documents you upload into the conversation join the same number sequence — they are not numbered separately.
Invented citations are never shown
Writing citations is the model's job, and models get it wrong: they skip numbers, mix them up, or cite a source that does not exist. So before the answer is stored, every number in the text is checked against the documents that were actually searched in that run; a marker with no match is silently removed. What remains is a sentence without a citation — but still correct.
While the answer is streaming the markers may briefly appear raw; validation runs when the answer completes, and the stored text is always clean.
A missing citation does not mean a missing source
The model may leave a sentence unnumbered; the source list below still shows every document searched for that answer. The list is the guarantee, the citation is the convenience.
Automatic refresh from sources (source sync)¶
Instead of adding documents by hand you can attach a source: it keeps the KB in sync with an external corpus. KB → Sources → Add source.
Supported source types:
| Type | What | Requires |
|---|---|---|
| S3 / MinIO bucket | AWS S3 or any S3-compatible store | bucket, (optional) prefix, access key |
| SharePoint document library | A library on a Microsoft 365 site | site address, (optional) library + folder, Entra ID app details |
| Google Drive (shared drive) | A shared drive in Google Workspace | drive name or ID, (optional) folder, service account JSON key |
| SMB / Windows file share | A Windows file server, Samba or NAS share | server, share name, (optional) subdirectory, username + password |
| Directory mounted on the server | A file share mounted into the installation (NFS/SMB) | directory path |
SMB or mounted directory?
Both read a file share. SMB you configure yourself — server name and your own credentials, without going to a system administrator. Mounted directory requires the share to have been mounted into the installation beforehand, which only the team running the installation can do. If your share is already mounted, either option gives the same result.
Freshness: hours, not minutes
SMB offers no "what changed" interface — every run walks the tree from scratch. On large shares this is slow: narrow the scope with a subdirectory and extension filters and keep the schedule daily. Content that must be current to the minute is better served by a search tool than by a source.
Content from a source counts as untrusted content
Documents in a knowledge base fed from a source (S3, SMB, local directory, SharePoint, Google Drive) may have been written by someone outside the organization. If an agent attached to such a knowledge base also carries a tool that can send data out (email, web search, HTTP request, MCP), you will see a warning on the agent screen and in configuration health — it is not blocked, but check whether it is really needed. Knowledge base text is always given to the agent framed as "data, not instructions".
Connecting a SharePoint library¶
SharePoint works differently from the other sources: instead of walking the whole library on every run, it asks Microsoft 365 "what changed since last time?". The result is freshness on the order of minutes and a cost that does not grow with the library. Deletions are reported explicitly in the same stream.
This requires an app registration in your organisation's Microsoft Entra ID (Azure AD) — an M365 administrator does this once:
- Entra ID → App registrations → new registration (no redirect URI needed).
- Note the Directory (tenant) ID and the Application (client) ID.
- Create a credential: a client secret (simple) or a certificate (if corporate policy forbids secrets; upload the private key + certificate as PEM).
- Grant an application permission and complete admin consent.
Permission: Sites.Selected is recommended
With Sites.Selected the app reaches only the sites an administrator has
individually authorised; setup includes one grant step per site.
Sites.Read.All takes a single consent but lets the app read every site
in the organisation. Whiskers works with either; least privilege is
Sites.Selected, and the "source permissions are not mapped" warning below
makes that choice more important.
In the source form, enter the site address
(https://contoso.sharepoint.com/sites/marketing); leaving the library name empty
uses the site's default document library. Naming a folder narrows the
scope to a single subtree.
A deleted folder can take up to 24 hours to clear
Deleting a single file propagates immediately. When a whole folder is deleted, Microsoft 365 may not report a separate deletion for each file; those files are cleaned up by the daily full reconciliation run (at most 24 hours). The same reconciliation also catches any other missed changes.
If the credential expires
Client secrets have an expiry date (typically 6-24 months by corporate policy). Once it passes, sync ends with Failed and the run record says so; creating a new secret and updating the source is all that is needed.
Connecting Google Drive¶
A shared drive in Google Workspace works like SharePoint: the first run walks the drive, later runs ask Google "what changed since last time". Deletions and files moved to the trash arrive the same way.
Setup is done once (a Google Cloud project admin + a shared drive manager):
- In the Google Cloud console pick a project and enable the Google Drive API.
- Under IAM → Service accounts create a service account and generate a JSON key (the file is downloaded).
- Open the shared drive → Manage members → add the service account's email
(
…@….iam.gserviceaccount.com) as a Viewer. - In the source form enter the drive's name or ID (the part after
/drive/folders/in the drive's address) and paste the whole JSON key file into the credential field. Open the file in a text editor and copy it — the text starts with{. A JSON file opened in a browser is shown as a table; text copied from there is not the key. Enter a folder to narrow the scope to one subtree.
If key creation is blocked
New Google Workspace organizations block service account key creation by
default ("An Organization Policy that blocks service accounts key
creation…"). An Organization Policy Administrator selects the project
and turns off Disable service account key creation
(iam.disableServiceAccountKeyCreation; also
iam.managed.disableServiceAccountKeyCreation if present) for this
project only. The policy can be re-enabled after the key is downloaded —
it blocks creating new keys.
Why membership only?
The service account sees only the drive it is a member of; no Google Workspace super admin is needed, and a leaked key opens only that drive. Reading on behalf of users across the organization (domain-wide delegation) is not supported — so personal "My Drive" folders cannot be attached as a source; move the content into a shared drive.
Google Docs, Sheets and Slides
Google's own files are read after conversion to Office formats: Doc → Word, Sheet → Excel (all tabs; table mode sees every tab), Slides → PowerPoint. Google converts files up to 10 MB; a larger file shows up as an error in the sync history. Forms, Drawings, Sites and shortcuts are skipped.
Moving folders and the trash
When a folder is moved to the trash or out of scope, its files leave the knowledge base in the same run. Files of a folder permanently deleted from the trash are cleaned up by the daily full reconciliation run (at most 24 hours).
Every run lists the source and downloads/embeds only new or changed files; a file whose contents did not change (only its timestamp did) is not re-embedded. Supported file types match manual upload (txt/md/csv/json/pdf/docx/xlsx/pptx/odt/ods/odp/doc/xls/ppt).
If you entered the extension list by hand
When a source's extension filter is empty, the default list applies and new
types arrive automatically. If you entered the list by hand (e.g.
pdf, docx), new types are not added — add odt/doc/xls etc. yourself if you
want those files read.
Deletions propagate
When a file disappears from the source, its document and vectors are removed from the KB too — a withdrawn document must not keep informing answers. Documents you added manually are never touched by this cleanup.
Source permissions are not mapped
The area you sync is one you accept everyone who can use an agent bound to this KB may read. Per-file permissions are not carried over — narrow the scope with prefix and extension filters.
Scheduling is per source (manual only, hourly, every 6 hours, daily, weekly). Sync now triggers a run at any time; it is processed in the background.
Reading the sync history¶
Each run leaves a row: added / updated / deleted / skipped / failed counts and a result.
| Result | Meaning |
|---|---|
| Completed | The listing ran to the end. On a full scan, deletions were applied too. |
| Partial | Hit the per-run item or time limit, or the AI provider hit its rate limit — resumes where it left off and no document is lost. Scanning does not delete. |
| Quota exceeded | The embedding budget ran out; progress is kept and resumes once quota renews. |
| Failed | The source was unreachable or an unexpected error occurred. Scanning does not delete. |
There are two deletion paths, and which one applies depends on the source type:
- By scanning (S3 / SMB / mounted directory): the engine infers that "a file not seen in this run has been removed from the source" — which is why only a Completed run deletes; in a half-finished listing that inference is not trustworthy.
- By notification (SharePoint, Google Drive): the source states "this file was deleted". That is a fact rather than an inference, so it is applied even if the run later stops, and it is never rolled back.
Sync heals itself
SharePoint's and Google Drive's "since last time" link occasionally becomes invalid (after a long gap, or through a service-side change). That run reports Failed, but the next run automatically falls back to a full scan and also catches deletions missed in between — no manual intervention needed.
Test connection shows whether a saved source is reachable and how much of it passes your filters — without downloading anything.
Failed documents and retrying¶
If a document from a source cannot be processed (an unreadable file, a temporary provider error) it shows up as Failed in the list and is tried a few more times in later syncs. A "Failed N attempts" note sits next to the document; once the attempts are used up, the document is not retried on its own until the file changes at the source — so a broken file is not downloaded again on every sync.
Once you have fixed the problem (e.g. the provider's quota was raised, the file was repaired), press Retry failed above the document list: documents from a source are fetched again in the next sync (which starts right away), and documents you added by hand are reprocessed from their stored content. Old documents whose content was never stored cannot be retried; the screen tells you how many there are — upload them again.
Large initial load (thousands of files)¶
When you connect a library with tens of thousands of files for the first time:
- Start narrow. Connect a single folder as the source first; widen the scope (or add one source per folder) once you have seen the results.
- Be patient. The initial load is spread over many sync runs: each run stops as Partial after a certain time or number of files and the next run continues where it left off. This is not an error.
- Watch the failures. Set the status filter of the document list to Failed; each document's error message tells you why (unreadable file, size limit…).
- Know the size limit in advance. A file from a source can be at most 25 MB; larger files are skipped and show up in the sync history.
- Check your AI provider's rate limit. The provider's tokens-per-minute limit sets the speed of the initial load. A run that hits the limit ends as Partial and no document is lost; you can ask the provider for a higher limit.
- Don't use the quota as a brake. Lowering the tenant quota to slow the load down also stops chats. Tuning the speed is the job of whoever runs the installation.
If syncing does not start at all for a long time, Configuration health shows a "sync overdue" warning; this usually means the component that runs syncs is not running in the installation — tell your installation administrator.
Trying queries¶
Query on the knowledge base detail page lets you test retrieval without an agent: the chunks closest to your query are returned with scores. If answer quality is poor, check chunk relevance here first.
Follow-up questions¶
In a chat, questions are rarely self-contained: "And what does it cost?", "How many years?", "What if it does not fit?". Handed to a search engine as-is, what they refer to never reaches search — the model writing the answer sees the conversation, but the search does not.
Whiskers therefore completes the follow-up from the conversation before searching: "And what does it cost?" → "wall mounting service fee". What is searched is the completed question; the answer shown to the user is unchanged.
What it costs
Completion only runs when there is history: the first question of a conversation adds nothing. A cheap, fast model is enough and it is chosen in Tenant settings → AI; if none is chosen the feature stays silently off and search works as before. It can be turned off per agent (for latency-sensitive flows). The completion call counts toward the cost of the run that asked the question and toward the agent's quota.
Hybrid search (meaning + keyword matching)¶
Search runs through two channels whose results are then merged:
- Semantic (dense): finds text that asks the same thing even when worded differently ("how do I install the dryer").
- Keyword (lexical): matches the searched term exactly.
Without the second channel, identifier queries are unreliable: product
codes, employee numbers, order numbers, part numbers and error codes all look
nearly identical in semantic space (10138776 vs 10138775), so the right row
may never reach the top results at all. The keyword channel solves this class —
the difference is largest in corpora containing tables (Excel/CSV).
No extra cost: the keyword channel makes no LLM calls, consumes no extra tokens, and does not change how many chunks are sent to the agent.
Turning it on/off¶
Hybrid search is on by default. You can override it per knowledge base with the Hybrid search choice on the knowledge base detail page:
| Choice | Meaning |
|---|---|
| Use the tenant setting | Follows the installation default (on) — recommended |
| On — force for this knowledge base | Always on for this knowledge base |
| Off — force for this knowledge base | Always off for this knowledge base |
If you believe answer quality dropped in a prose-heavy corpus, you can turn it off and compare; the change takes effect immediately, needs no re-embed and does not harm your data (turning it back on restores the previous behaviour).
One-off re-embed for older knowledge bases
Hybrid search does not apply automatically to KBs whose documents were vectorized before this feature shipped. The KB detail page shows whether hybrid is active; if it isn't, run Re-embed once. Every document added after that point is already written in hybrid form.
Re-ranking results (rerank)¶
Search results are ordered by the semantic closeness between your query and the documents. That ordering never looks at the question itself — it only says "how similar are these". Rerank adds a step: a wider candidate set is pulled, and a second model reads those candidates together with your question and rebuilds the ordering from scratch.
Measured effect (our internal measurement set: 38 questions, 13 documents, real embeddings; two different rerankers on the same corpus):
| Correct document first | In top 3 | In top 5 | Average rank (MRR) | |
|---|---|---|---|---|
| Rerank off | 62% | 82% | 93% | 0.77 |
| Local open model (bge-reranker-v2-m3) | 78% | 95% | 100% | 0.88 |
| Cloud provider (multilingual rerank model) | 70% | 79% | 89% | 0.80 |
| Follow-up completion + local open model | 91% | 100% | 100% | 0.97 |
Rerank is not better in every setup — it depends on the model and the corpus
On the same corpus the local open model won on every question type; the cloud provider's model improved first place but fell below the no-rerank baseline in top 3 and top 5 — i.e. it pushed the right document out of the list. Paid does not have to mean better.
This is why rerank is off by default and why you should measure it on your own corpus, with your own model choice, before enabling it. It is not an "always better" setting.
The last row is the combined effect of two features: follow-up completion (above) carries what the question is really asking into the search, and rerank moves the right document to the top. With rerank alone follow-up questions stayed at 29% — for an uncompleted "and what does it cost?" the right candidate is not in the list to be ranked. The two complement each other; neither replaces the other.
Enabling it¶
Three things have to happen together:
- rerank is enabled in Tenant settings → AI (the cost decision is the organisation's),
- a rerank model is selected in the same place — without one the feature quietly stays inactive, raises no error, and search runs as before,
- it is enabled for the agent in the agent form (the design decision is the agent's: a fast support bot off, a compliance analyst on).
The model can be either a real re-ranking service (on your own server or at a provider) or one of the chat models you already use; both are defined from the same screen.
Cost
Rerank adds one extra call and some latency to every search — unlike follow-up completion, it also runs on the first turn. Because a wider candidate set is pulled, the cost grows with the number of candidates. The number of chunks sent to the agent does not change.
Search gate (TypeSafe Jev) — shadow mode¶
On an agent with rerank turned on, or where follow-up question completion runs, a knowledge-base search is expensive: with a local rerank model a single search can take a few seconds. Yet some messages need no search at all ("thanks", "put that in bullet points"). The search gate asks a fast decision model (TypeSafe Jev) "does this message need a knowledge-base search?" to tell them apart.
Today the gate only runs in shadow mode: Jev is asked but does not decide. The search runs as usual, Jev's answer is only written to a measurement log, and no time is added for the user. Letting the gate actually skip searches will be turned on after a safe threshold is chosen from the shadow log.
What is sent¶
Data leaves your organisation
TypeSafe is an external service. When turned on, the user's latest message (and the previous turn, if any) and the names and descriptions of the agent's knowledge bases are sent to TypeSafe; if the tool pre-filter is on too, the names and descriptions of the agent's tools are sent as well. Document contents, agent instructions and secrets are not sent. TypeSafe does not train on customer data; zero data retention is only available on its enterprise plan. In closed-network installations this feature cannot be used and nothing else is missing.
Turning it on¶
- On the LLM providers screen, add a provider of type TypeSafe (with your
own TypeSafe API key) and attach a model alias in the Decision category
(model name with its version:
jev-1.13.0). - Under Tenant settings → AI, pick that alias as the decision model and turn on RAG gate — shadow mode.
Once turned on for the organisation the gate applies to every agent, but it is only asked on agents where search is expensive (rerank on, or follow-up completion running). To leave a single agent out, use "Turn off the RAG gate for this agent" in the agent form.
Knowledge base description
The gate decides by reading each knowledge base's name and description. It works safely for knowledge bases without a description too, but can skip fewer searches. A short description of what the knowledge base covers makes the gate's job easier.
Table files (Excel/CSV) — counting and filtering¶
Text search over a spreadsheet returns a sample: the few closest rows. Questions like "how many products does this brand have", "which 50-inch models are there", "which items are below 10 in stock" cannot be answered that way — the answer is not in a few rows, it is in the whole table.
Whiskers therefore also makes table-shaped files queryable row by row. When an Excel/CSV file arrives in a knowledge base, one table is extracted per sheet: the header row is detected, column names and types (text/number) are derived, and rows are stored.
The decision is made sheet by sheet. If two of a three-sheet file are proper tables, those two become tables; a third sheet holding free-form text does not, and keeps being used as text. There is no all-or-nothing on mixed files, and no sheet's content is lost.
What an agent needs to use it¶
- The agent must be of type REACT. Single-step (SIMPLE) agents cannot call tools, so they cannot query tables.
- The Table Query tool must be attached to the agent. Once attached, the agent automatically sees the list of tables (name, columns, row count) in the knowledge bases it is connected to, and queries them when needed.
The agent cannot choose which knowledge base to look at: only the ones attached to it are used. This prevents the access boundary from being bypassed through the tool.
Which tool when: Table Query ↔ Internal Knowledge Search¶
The choice depends on the kind of question, not the kind of file:
| Question | Tool |
|---|---|
| Counting, filtering, sum, average, sorting — "how many", "which ones", "what is the total" | Table Query (knowledge_table_query) — the answer comes from the whole table |
| Finding a specific record ("price of product ABC-123") | Table Query — text search is unreliable for codes and numbers |
| Text in documents ("what does the leave policy say") | Automatic search; if that is not enough, Internal Knowledge Search (internal_kb) searches again |
| Both ("count the rows above the threshold in the policy") | Threshold from the text first, then the count from the table — a REACT agent can use both in the same run |
The agent knows which tables exist from the table list; when text search hits a table it also sees the note "this table can be queried row by row" and turns to Table Query. For a spreadsheet-heavy knowledge base, attach both tools to the agent.
In hybrid mode, counting questions still need Table Query
In hybrid mode (the default, see Table mode) the file's rows are also searchable as text. Without Table Query the agent tries to answer a counting question from the few rows text search returns, and the result looks plausible but is wrong.
Header row approval¶
In real spreadsheets the first row is often not the header (a logo, a date, a report title). When Whiskers can determine the header with certainty, the table becomes queryable immediately. When it cannot, the table stays in "Needs review" and the agent does not see it.
Use the Tables button on the document row to inspect the schema and the first rows, correct the header row and approve it. Correcting does not re-download the file and does not re-embed anything — it applies immediately.
Why approval is required
A table built on the wrong header row appears to work but makes every answer silently wrong. The approval step exists to make that silent failure visible.
Table layout: labels, turning columns into rows, picking a section¶
Real files are not uniform. Whiskers recognizes these shapes on its own:
- Side-by-side tables on one sheet (e.g. a TRY block and a USD block)
become separate tables, named like
Sheet [B:E]. - Tables with periods in the columns (
Item | 2023 | 2024,Product | January | February) are turned into rows:Label | Period | Value. Questions like "total by period" or "the 2024 value" work directly. - A report title and unit above the table (
(thousand TRY),units) are stored as the table's caption and told to the agent; values are not scaled. Excel errors such as#REF!and#N/Aare treated as empty and the agent is told how many there are.
In the Table layout section at the bottom of the Tables dialog you can:
| Action | What it is for |
|---|---|
| Add source label | To query files of the same template together (one file per branch, per company). The label (Branch = Kadıköy) is added to the table as a column, so the agent can "total by branch". The suggested value comes from the file names and is not saved until you confirm it. A table without a label is never combined with others. |
| Turn columns into rows | If the column headers are a dimension (Item | Akenerji | Mogan | Zoren, Product | Istanbul | Ankara), select them and name the dimension (Company). Period headers do this automatically; other headers cannot be told apart by a machine, so this is left to you. |
| Pick a table from the sheet | For sections that are not recognized automatically (small tables stacked on each other, blocks without a header row, merged headers): in the sheet preview click one corner of the table, then the opposite corner. If there is no header row you type the column names. |
These edits survive re-embedding and source sync: an approved header, labels, turned columns and picked sections are rebuilt. An edit that no longer fits because the file changed is dropped and the table returns to its automatic form.
Calculating with code (ratios, growth, median)¶
Table Query counts, filters and aggregates; calculations such as a ratio (net profit / net sales), period-over-period growth, median, ranking, deviation from the average or combining two tables are done by the Calculate with Code tool. The agent writes a small Python (pandas) calculation; the data is read from the table, so the numbers do not come from the model's own arithmetic. The result can be passed as-is to a chart, Excel and a presentation.
- The tool appears in the tool list only if your installation has the code execution component enabled (an optional component; ask your administrator). When it is off, the tool is not listed.
- The agent must be REACT and the tool must be attached to it. The agent can only use tables from its own knowledge bases and from files uploaded to that conversation.
- The code runs in an isolated environment: it cannot reach the internet or write files, and its time and memory are limited. If it fails, the agent fixes the code and retries.
- For long calculations you can enable the background offer on the agent: a run longer than 1 minute asks "notify me when it finishes?".
- The number of rows sent in one run is limited; for very large tables the agent first narrows them down with Table Query, then calculates.
Table mode¶
The KB detail page has a Table mode switch:
| Mode | Behaviour |
|---|---|
| Hybrid (default) | The file is both embedded as text and built as a table. Nothing changes in existing behaviour; the table is an added capability. |
| Table only | Only a short "business card" excerpt is embedded; the content is queried as a table. Embedding cost becomes independent of file size. |
\"Table only\" on mixed files
If some sheets of a file do not become tables (free-form text), their text is embedded even in table only mode. Otherwise their content would be silently lost — the mode exists to cut cost, not to drop content.
The cost of table-only mode
In this mode the file's content is reachable only through the tool:
- An agent that cannot call tools (SIMPLE) loses that file's content.
- The same happens to a REACT agent without Table Query attached: it only sees the business-card excerpt (columns, row count, a few sample rows).
- Free-form text inside rows cannot be searched by meaning (e.g. "complaints similar to a delivery delay"); only Table Query's "contains" filter remains.
Recommended for large, structured files (catalogue, stock, sales). Do not enable it if your agents are not REACT, or if rows hold long text that needs to be searched by meaning.
Limits¶
- Table Query has no joins across tables, no subqueries and no computed columns — use Calculate with Code for those (if enabled in your installation). Tables with the same columns and a confirmed source label can be stacked and queried in a single query (e.g. all branches). Questions like "the ones above average" are not supported; "the 5 most expensive products" works via sort + limit.
- Merged cells, subtotal rows or sheets filled in "like a form" may not become tables on their own; use Pick a table from the sheet to turn the section you want into a table. The text of these sheets is still used.
- Tables inside PDFs are not read as tables; they are used as text.
- A table takes at most 200,000 rows. A larger table is cut, but not silently: the Tables window warns "the source has N rows, only the first M were taken", and the agent states in its answer that counts and totals for that table are incomplete. Details: Limits.
- When the file changes the table is rebuilt (rows are replaced; no versioning).
Re-embed¶
To change the embedding model (or refresh the whole corpus), use Re-embed:
- All of the KB's documents are re-chunked and re-vectorized with the new model; old vectors are cleaned up.
- The operation runs in the background; documents flow through Pending → Ingested one by one. A single document's failure doesn't stop the others.
- Very old documents whose content isn't stored on the platform cannot be re-embedded — they are marked Failed; you'll need to re-upload them.
Deletion¶
KB deletion is soft (archive) and also purges the vectors. An archived KB no longer appears attached to agents and never enters retrieval. The KB's sources and their stored credentials (access key, password, client secret) are deleted; deleting a single source deletes its credentials as well.
Good practices¶
- One topic = one KB. Simplifies access and updates; you attach only the relevant corpus to an agent.
- Use source labels (the Source field when adding a document): mark where a document came from, for auditability and content management.
- For updated content, delete the old document and add the new one — a second copy under the same title produces duplicate results.
- Pin the embedding alias; don't change models casually — re-embedding is costly (the whole corpus passes through the new model and consumes quota).