Docs / RAG server
ModelBrain RAG is a free, open source add-on that gives apps and scripts on your computer an HTTP API for searching your documents. ModelBrain does the indexing and the searching; the add-on adds collections, API keys, user accounts and a web page for search and administration. It runs on your computer only and it needs the ModelBrain app. Version 0.1 is a preview.
RAG stands for retrieval-augmented generation: an app looks up the passages that bear on a question and hands them to a language model along with the question. ModelBrain RAG is the lookup half. You send it a query and it returns passages, each with the file it came from, a score and its headings.
It does not write answers and it contains no language model. Pass the passages to the model of your choice. It also contains no ModelBrain code: it starts the helper program that the ModelBrain app installed and uses the same tools any AI assistant uses.
ModelBrain-RAG-0.1.0.pkg) and double-click it. It is signed and notarized, needs a Mac with Apple Silicon, and carries everything it needs, so there is nothing else to install.To open the page again later, double-click Open ModelBrain RAG in /Library/Application Support/ModelBrain RAG. To remove it, double-click Uninstall ModelBrain RAG in the same folder; your documents and settings are left alone.
npm install -g modelbrain-rag modelbrain-rag service install modelbrain-rag openThe first command installs it, the second starts it now and at every sign-in, and the third opens its web page.
ModelBrain RAG in your home folder) with a Copy button. In the ModelBrain menu choose Add Vault and pick that folder. ModelBrain only adds a folder that you choose yourself, so the add-on cannot do this step for you.To try it without installing, run npx modelbrain-rag. Started that way it prints an administrator API key, a username and a password once, and stops when you close the terminal.
There is no Windows installer yet, and version 0.1 is not yet supported on Windows.
Make a key on the API keys tab, then send it on every request. The server listens on http://127.0.0.1:8757 unless you change the port.
curl -s http://127.0.0.1:8757/v1/search \
-H "Authorization: Bearer mbrag_..." \
-H "Content-Type: application/json" \
-d '{"query": "how long do refunds take", "collection": "handbook", "k": 5}'
The reply lists the passages, best first:
{
"query": "how long do refunds take",
"collection": "handbook",
"count": 1,
"results": [
{
"text": "Refunds are issued within 14 days.",
"score": 0.81,
"collection": "handbook",
"document": "refunds.md",
"headings": ["Policy", "Refunds"],
"document_url": "/v1/collections/handbook/documents/refunds.md",
"source": "document"
}
]
}
A result from a collection also carries document_url, the address of the whole document, and the web page shows an Open document button beside it.
A search has one target. Name a collection, or a shared vault (optionally with one folder inside it), or a shared partition. Add a document with one request:
curl -s -X PUT http://127.0.0.1:8757/v1/collections/handbook/documents/refunds.md \ -H "Authorization: Bearer mbrag_..." \ --data-binary @refunds.md
query; one of collection, vault (with optional folder) or partition; k from 1 to 50; min_score; merge_chunks.POST creates one; DELETE /v1/collections/{name} removes an empty one.GET .../documents/{file} returns the whole document as a file; PUT adds or replaces one with the file as the body; DELETE removes it.PUT /v1/vaults/{id} and PUT /v1/partitions/{id} with {"shared": true} switch sharing on or off.Errors come back as {"error": {"code": "...", "message": "..."}}. The full table, with every field, is in the README.
Users, for the web page, and API keys, for apps, share three levels. Read can search and list. Write can also add and remove documents and collections. Admin can also manage users, keys and settings, and choose which vaults and partitions are shared.
A user or key can carry a limit list. It then sees and searches only the collections, vaults and partitions on the list, and must name one in every search. Asking for something that is not shared, or not on the list, gets the same reply as asking for something that does not exist.
The server listens on 127.0.0.1 only, so other computers cannot reach it, and it makes no outgoing connections. Its web page loads nothing from outside your computer and has no analytics.
API keys are stored only as SHA-256 hashes and passwords only as scrypt hashes. Five wrong passwords in a row lock that username for 30 seconds, doubling up to 15 minutes. Requests from web pages on other sites are refused unless you allow that site in settings.
Sharing a vault or partition lets every user and key without a limit list search all of it. Mail and chat vaults and partitions of saved memories can hold private material, so share them with that in mind.
The source is public under the MIT licence at github.com/ModelBrain/modelbrain-rag, with the full list of protections and limits in its security notes. The ModelBrain app itself is closed source; what it does with your documents is on the privacy page.
Version 0.1 was run on macOS against ModelBrain 0.9.4 on November 14, 2026: install, first-run setup, uploading a document and searching a collection, and searching a shared vault. Its automated tests pass on Node.js 18 and 22 on Linux. It has not been tested on Windows.
Every search runs ModelBrain's full ranking, which is thorough and takes most of a second on a typical laptop. Search quality on document collections has not been measured on a public benchmark; the figures on the benchmarks page are for conversational memory.
It serves apps on the same computer. It is not built to be reached from other computers, and the connection is plain HTTP.
No. It is a separate, open source add-on. ModelBrain must already be installed, and the add-on talks to it through the same tools any AI assistant uses.
No. It returns the passages that best match a query, with the file each came from. Your app passes them to the language model of your choice.
No. It listens on 127.0.0.1 only, which is your own computer, and it makes no outgoing connections.
No. It writes only inside its own documents folder. Vaults and partitions that an administrator shares are search-only.