Barrel
FR GitHub

Examples

Complete projects you can download and run. Each folder has a README, the source and the output of a real run in expected.txt. scripts/verify-examples.sh runs every one against the Barrel source and fails on any difference.

Embed barrel in an Erlang app Open a database inside your node, write documents, query them with BQL, close cleanly. No server. Erlang, embedded Agent memory across restarts A session with messages, pinned context and working data in a space; facts embedded on write and recalled by search on a second node. Erlang, embedded Private knowledge search Ingest support articles, search them with keyword and hybrid search, optionally rerank, and build the prompt for your LLM. Erlang, embedded Share a space between agents One space, a read-only token for one agent, and a task handed to another agent, accepted and completed. Erlang, embedded Branch, compare, merge, recover Change a branch of a database, compare it with the parent, merge it back, then open a branch of a past state. Erlang, embedded Local-first with barrel-lite Two TypeScript clients with a local copy: offline edits, sync with a barrel_server, and one conflict resolved for everyone. TypeScript, Node, a server Query two databases as contexts Register databases as contexts and run one BQL statement over them, with sources, coverage and a partial answer when one is down. Erlang, embedded An MCP session with curl The raw JSON-RPC an agent sends to barrel_server: initialize, list the tools, write, read, query and search. Shell, a server

Run them all

From a checkout of the site repository, next to a checkout of the barrel repository. You need Erlang/OTP 26 or later, rebar3, a C compiler and CMake for the native dependencies, Node 22.6 or later, curl and jq.

BARREL_DIR=../barrel scripts/verify-examples.sh

Up and down to moveEnter to open