Skip to main content
MeshAPI RAG lets you upload documents, embed them as vectors, and run semantic search queries against them.

Full workflow

The upload → embed → search lifecycle is 6 steps:
1

Init upload

Request a signed upload URL and get a file_id.
2

PUT to signed URL

Upload the file bytes directly to the signed URL using a plain HTTP PUT.
3

Poll upload status

Call rag.get(file_id) until upload_status == "ready".
4

Embed

Call rag.embed([file_id]) to start the embedding process.
5

Poll embedding status

Call rag.get(file_id) until embedding_status == "ready".
6

Search

Run a semantic search query against the embedded file.

Code examples

List files

File statuses

Upload in one call

upload_file (uploadFile in Node.js, UploadFile in Go) runs steps 1 and 2 for you: it calls init_upload, PUTs the bytes to the signed URL, and returns the same response with the file_id. If you leave embed unset, the file is embedded (and billed) as soon as the upload lands. The examples pass embed=False so you can call embed() yourself, as in the full workflow above. Drop it to embed right away.

Delete a file

DELETE /v1/files/{file_id} removes the file’s vectors and stored object, so it stops appearing in search. It returns 204, and repeating it for an already-deleted file also returns 204. The SDKs have no wrapper for it yet, so call it over HTTP with your rsk_ key:
Treat the file as deleted only after a 204. A 5xx means the delete did not finish and the file may still show up in search, so repeat the call until it returns 204. See Delete a file for the full response table.

Search options

RAG chat

Combine search results with a chat completion to answer questions from your own documents.