Skip to main content

Data model

Each document has an id and text (plus optional metadata). Use moss-minilm as the default model.

Examples

From files (PDF and DOCX)

Build an index directly from raw documents - the server parses, chunks, and embeds them. Up to 20 files per call, 50 MB per file. Parsed document pages count against your plan’s monthly allowance; see Pricing & Limits. When the allowance is used up on a plan without overage billing, createIndexFromFiles fails with 429 USAGE_LIMIT_EXCEEDED at init or at confirm; a denial at confirm marks the job failed. PDF pages are counted before parsing. A PDF that cannot be page-counted before parsing (larger than 10 MB, unreadable, or past the page-counting budget of 200 MB or 20 seconds per request) is also denied on those plans. A confirm denied because your organization is running its maximum number of crawl and parse jobs leaves the job open: retry the confirm once a job finishes.
See Index from files for parse options, limits, and querying notes.

From a website

Register a site as a web source and Moss crawls it into an index - optionally on a daily or weekly refresh schedule (scheduled refresh requires the Startup plan or above; omit refreshCadence on Developer and Hobbyist and re-sync manually on Hobbyist). Linked PDF and DOCX files found during the crawl are parsed into the same index. An index can hold up to 20 web sources. Each site is crawled and refreshed on its own, and a crawl only replaces that source’s pages, so several sites can share one index together with documents you add directly. The first source creates the index; later ones add to it, and a crawl requested while another is running on the index simply queues behind it.
See Web Sources for the JavaScript SDK, Web Sources for Python, and Create Web Source for crawl limits, scheduling, and the full set of web source actions.

Local-first indexing (sessions)

createIndex / create_index builds an index through the cloud (then keeps it usable locally). When you need to index during a live interaction - adding transcript turns mid-call or building a per-user working set - use a session instead. A session indexes documents locally in real time with no cloud round trip, embedding each document on-device, and lets you optionally push the result to the cloud when you’re done.
See Sessions for the full create-resume-query-push lifecycle.

Notes

  • createIndex / create_index will sync indexes to cloud (if enabled) while remaining usable locally
  • Supports multiple indexes per project; pick the model per index:
    • moss-minilm: fast, lightweight (default)
    • moss-mediumlm: higher accuracy, still efficient
    • Use moss-minilm for speed-first, edge/offline use; use moss-mediumlm when you need higher recall/precision

Chunking tips

  • Aim for ~200-500 tokens per chunk
  • Overlap 10-20% to preserve context
  • Normalize whitespace and strip boilerplate