Barrel documentation
Every page is written for a task. Pick where Barrel will run and start there; each page links to the reference it uses.
If you are new to Barrel, start with a quickstart below: in about ten minutes you write a document, read it back and query it. When you know what you want to do, use the sections further down, which group the guides by task. Search finds a guide, a function, a REST route or an MCP tool by name.
Start here
{deps, [{barrel, "~> 1.14"}]}. As a server Run barrel_server and reach it over REST or MCP. curl -X PUT localhost:8080/db/notes In the browser Keep a copy in a web app with barrel-lite and sync it. await Database.open("notes", { remote }) Not sure which? Choose a deployment compares them in one table.
New to Barrel? Read in this order
- Overview for developers: what Barrel does today, what it does not do, and which part you need.
- One quickstart, embedded, server or browser: whichever matches where you run Barrel.
- The record: how a document, its files and its vector stay under one id.
- Versions, conflicts, convergence: what Barrel keeps when two copies edit the same document.
Look up any term you meet on the way in the glossary.
By what you want to do
Concepts
Read these before you write code, to learn how Barrel models data: the record, versions, spaces, contexts, and a glossary of the terms the docs use.
The recordVersions, conflicts, convergenceSpaces and capabilitiesContexts and working setsGlossaryStore and query
When you write documents and files and read them back, from Erlang or with BQL queries.
Embed barrel in an Erlang appRecord modeQuery with BQLAttachmentsSearch
When you find documents by meaning, by keyword, by exact text or regex, and choose the model that computes vectors.
Vector, keyword and hybridSubstring and regexRerankingChoose an embedding providerReplicate
When several copies of a database exchange changes, and you need to see and resolve conflicts between them.
SynchronizationConflictsUpgrade from 2.0Upgrade to docdb 3 and spaces 2Agents
When AI agents share data: a space and a token per agent, the MCP endpoint, and a record of who changed what.
Spaces, sessions, handoffsMCP endpointAudit and provenanceIndex a codebaseTimeline
When you try changes on a branch, merge them back, or recover the database as it was earlier.
Branch, merge, recoverContexts
When one BQL statement must query several datasets by name, on this node or on other nodes.
Query several datasetsBrowser
When a web app keeps its own copy of the data with barrel-lite and syncs it with a server.
barrel-liteSecurity
When you encrypt data on disk, or decide who can reach the server and with which rights.
Encryption at restAuthenticationOperate
When you run barrel_server for real: start it, embed it, watch it, fix it and back it up.
Run the serverRun in DockerReleasesEmbed the server in an appMonitoringTroubleshootingBackups and recoveryReference
When you need the exact name of a function, query form, route, MCP tool, option or error code.
Barrel APIBQLREST APIMCP toolsConfigurationError codesLibrariesArchitecture
When you want to know how the pieces fit, the status of each feature, and how replication is checked.
OverviewFeature statusReplication proofsContexts designVisionContribute
When you build Barrel from source, run its tests, write an embedding provider, or ship one app on its own.
Build and testEnd-to-end testsWrite a providerDistribute the appsReference, generated from the code
These pages are built from the source, so they match the version you run.
- Barrel API, per library, from the module docs
- MCP tools, from the server's own tool list
- REST API and BQL
For coding agents
Point your assistant at these instead of letting it guess function names.
https://barrel-db.eu/llms.txt https://barrel-db.eu/llms-full.txt https://barrel-db.eu/docs/guides/timeline.md https://barrel-db.eu/docs/reference/mcp-tools.json