CADPrk6a…krfpump
habitat
Browse the docs

Build agents

Knowledge

Teach an agent with documents, websites, FAQs and notes. Habitat extracts, chunks, embeds and searches them, and cites sources in answers.

Knowledge is what makes an agent yours: the documents, sites and notes it searches before it answers. Knowledge is shared by everyone who talks to the agent and is never mixed with any one person's private memories.

Supported sources#

SourceDetails
PDFText-based PDFs. Headings, page numbers and repeated headers/footers are detected; scanned images without text can't be read.
TXT and MarkdownUTF-8 text. Markdown structure (headings, lists, code, tables) is kept.
CSVEach row becomes a record that's never split. Export spreadsheets (.xlsx) as CSV first.
Website URLA polite crawl of public pages (see below).
FAQQuestion and answer pairs, each kept together.
Custom textPaste notes, policies or anything else.

By default each file can be up to 10 MB, each agent can have 25 sources and each account has 200 MB of storage. Duplicate uploads are detected and rejected.

The pipeline#

Every source goes through the same steps, in the background worker:

  1. Validate — extension, declared type, file signature, size and (for text formats) strict UTF-8.
  2. Extract — text plus structure: headings, pages, tables, records.
  3. Normalize — whitespace, encoding artefacts and boilerplate are cleaned up.
  4. Chunk — structure-aware chunks of roughly 600–800 tokens that prefer breaking at headings, never split a paragraph unless they must, keep code blocks and table rows intact, and carry a small overlap. Each chunk remembers its heading path, page range and URL.
  5. Embed — each chunk is embedded (1,536-dimensional vectors).
  6. Store — chunks and vectors go into Postgres with pgvector, linked to the agent.
  7. Search — during conversations.

The dashboard shows each source's status (queued, processing, ready or error), size, indexed chunks, last update, storage use and any indexing error. You can add, remove or replace documents, reindex a source, refresh website content and test retrieval with a sample question.

How retrieval works#

For each message, Habitat searches only that agent's knowledge with a hybrid of semantic vector search and keyword search, merges the results with reciprocal-rank fusion and passes the best chunks (6 by default) to the model. With citations on, answers include numbered markers like [1] that link to the source title, page or URL. Agents can also use the Document Search tool to run their own follow-up searches.

When the knowledge doesn't contain the answer, agents are instructed to say so rather than invent one. Turn on strict mode to keep an agent to its knowledge base.

Websites and crawling policy#

Website sources are fetched by Habitat's crawler, which:

  • Starts at the URL you give, follows links breadth-first up to two levels deep on the same site, and uses the site's sitemap.xml when there is one.
  • Crawls up to 15 pages by default (admins can allow up to 100).
  • Respects robots.txt — disallowed pages are skipped, and its crawl delay is honoured. Requests are spaced at least 500 ms apart.
  • Only fetches public addresses on standard web ports. Private networks, localhost and internal addresses are blocked, including after redirects.
  • Never bypasses authentication — pages that are behind a login are skipped and reported.
  • Removes navigation and boilerplate, keeps headings, lists and tables, and de-duplicates pages with the same canonical URL or content.

Privacy#

Knowledge files are private to the agent's owner (and platform admins for moderation). People chatting with the agent see only the snippets the agent cites. Remixing an agent never copies its knowledge.

Retrieved text is treated as untrusted data: instructions hidden inside a document or web page are ignored. See Security model.