Skip to main content
A knowledge base holds what your business already has written down: your website, policy documents, product sheets, pasted text and answers to common questions. Attach it to an agent, and the agent looks things up there while it talks. When a caller asks “do you deliver to Surat?”, the agent finds the part of your delivery page that answers it and replies in a sentence or two. Callers can ask in their own language. A Hindi or Gujarati caller can ask about an English policy page, and the agent answers in the caller’s language. Mira does the search and the answering; you only add the sources. A knowledge base belongs to a workspace. One agent can use up to five, and one knowledge base can serve many agents.

Set it up in the console

1

Create a knowledge base

Open Knowledge in the sidebar, under Agent Studio. Click New knowledge base, give it a name such as “Store policies”, and click Create.
2

Add your sources

Click Add source and pick one of four kinds:
  • Files: drop one or more files. PDF, Word (DOCX), TXT, Markdown, HTML, CSV or Excel (XLSX), up to 50 MB each.
  • Website: enter an address and choose This page only, Sitemap or Whole site. For a sitemap or a whole site, you can cap the number of pages and limit the crawl to some paths, such as /help.
  • Paste text: up to 200,000 characters.
  • FAQ: question and answer pairs.
You can add more sources later. Each source is ready as soon as it finishes; small ones (text, FAQ, files) go first, so a large website doesn’t hold them up.
3

Wait for Ready

The sources table shows each source’s progress, for example Fetching · 12 of 40, then Ready. A website with many pages takes longer than one file. If a source fails, the reason appears under its name.
4

Try a question

Under Try a question, type something the way a caller would say it, in any language. You see the passages your agent would read and which source each came from. If the right passage is missing, see Tips for good answers.
5

Attach it to an agent

Open the agent in Agent Studio and choose the Knowledge tab. Tick the knowledge bases this agent should use, leave the mode on Auto, and click Save changes. A knowledge base that is still syncing shows Still syncing · calls don’t use it yet.
6

Test it on a call

Click Test agent and ask a question your sources answer. After the call, a chip such as From returns.pdf appears under each agent line that used your knowledge. The same chips appear on the call’s transcript in Call history.

Set it up with the API

Base URL https://sandbox.voice.miraiminds.co. All endpoints require Authorization: Bearer sk_live_…. Every route is listed in the API reference.

1. Create a knowledge base

name is required, up to 200 characters. description is optional, up to 2,000. settings.languages lists the languages your callers will ask in; leave it out and Mira chooses. The response is 201 Created:

2. Add a web page

The response is 202 Accepted with the new source in status queued. Syncing starts on its own. To read a whole site instead, use "type": "site"; see Sources and limits for every type.

3. Upload a file

Send a file as multipart/form-data with a file field. name is optional; without it the source is named after the file. Send one file per request.
This also answers 202 Accepted with the source queued.

4. Wait until the source is ready

status moves through queued, fetching, parsing and indexing to ready or failed. While it syncs, progress shows the stage and how far it has got. A failed source carries error with a code and a plain-words message. To list every source at once, call GET /v2/knowledge-bases/{id}/sources, optionally with ?status=failed. Poll every few seconds until the source settles:
The knowledge base itself is ready once a version is built, and active_version stops being null. Calls only use a knowledge base that has an active version.

5. Try a question

query is 1 to 500 characters, in any language. top_k is 1 to 20, default 5. The answer lists the passages an agent would read, best first. Each hit has at least text, title, source_id and score. ms breaks down how long the search took in milliseconds (embed, dense, lexical, rerank and total). Abridged:
Before the first source is ready, search answers 409 not_ready. To see every passage a source was split into, call GET /v2/knowledge-bases/{id}/chunks?source_id=ks_….

6. Attach it to an agent

Add a knowledge block to the agent:
The block is part of the agent, so each change makes a new agent revision. A PATCH replaces the whole block, and "knowledge": null removes it. Like every agent change, it applies from the next call. Each call uses the version of the knowledge base that was ready when the call started.

Sources and limits

Every JSON source also takes an optional name. include and exclude are lists of path prefixes, such as ["/help", "/policies"], up to 20 each. max_pages keeps the first pages in the order the sitemap lists them (or the order links are found), so on a large site use include to point it at the pages that matter. Supported files: Password-protected files fail; remove the password and upload again. Old .doc and .xls files are not supported; save them as DOCX or XLSX. On websites, Mira reads the main text of each page and skips menus, footers and cookie banners. It respects your robots.txt. A page that only shows its text after JavaScript runs may come back empty; add that content as a file or text instead.

Modes

Passages per answer (max_chunks) is how many passages the agent reads before it answers. Raise it when answers need facts from several places. Lower it when the agent pulls in unrelated detail. If a search finds nothing relevant, the agent gets no passages for that turn and is told to say it will check. A call never waits on knowledge. If a lookup cannot finish in time, the agent answers that turn without it.

What not to put in a knowledge base

A knowledge base is for facts that stay the same for days or weeks: policies, product details, store hours, how-to steps. It is a copy of your content from the last sync, so it cannot know what changed this morning. Stock levels, order status, delivery dates for a specific order, today’s prices and free appointment slots change by the minute. Give the agent an on-call tool for those. A tool asks your system during the call, so the answer is always current.

Sync, re-sync and delete

Sync a source again

When a source’s content changes, click Sync again on the source, or call:
It answers 202 with the source queued. A website re-crawl only re-reads pages that changed. Syncing is manual for now; there is no schedule yet. If a sync fails, calls keep using the last good content.

Remove a source

Click Remove, or call DELETE /v2/knowledge-bases/{id}/sources/{source_id} (204). The knowledge base is rebuilt without it. Until the rebuild is ready, calls keep using the previous version.

Delete a knowledge base

Click Delete, or call DELETE /v2/knowledge-bases/{id} (204). While agents use it, the delete is refused with 409 and the list of those agents:
Remove it from those agents first, or delete with ?detach=true to do both in one step. In the console, choose Remove from agents and delete. Each agent it is removed from gets a new revision. A deleted knowledge base disappears at once and new calls stop using it. Its stored files are removed about two hours later, so calls already running can finish.

Tips for good answers

  • Add FAQ pairs for the ten or twenty questions callers ask most. An FAQ answer is never split, so the agent reads all of it.
  • Keep each fact in one place. If your delivery page says 3 to 5 days and your FAQ page says 7 days, the agent may read either one. Fix the contradiction in your content, or leave the outdated page out with exclude.
  • Use clear headings. Headings such as “Returns” and “Exchange within 7 days” tell the agent what a passage is about. Long pages with no headings are harder to search.
  • Keep a website crawl to the pages that answer customers. Use include for paths such as /help and /policies, and exclude for blogs and careers pages.
  • Test the way callers talk. In Try a question, ask short, spoken questions in Hindi, Gujarati or Hinglish as well as English. If the right passage doesn’t come back, add an FAQ pair in the caller’s words.
  • Put facts in the knowledge base and keep the prompt for how the agent should speak and behave.

Errors

Errors use the standard envelope.