Session Zero opened the Familiars as a party of small, sharp C++ libraries, the first of them carved out of Xapiand, and every post since has opened one of them on its own terms. This one steps back to look at the whole table.
Extraction on its own proves very little: a library that compiles in its own repository has only shown that it can be moved. The test I cared about was whether different systems could be built from the same box, and whether the box got better for it. Three have been, and the pieces now travel in both directions.
The framework trap
Section titled “The framework trap”Inside Xapiand nothing was tangled on purpose, yet everything could reach everything else. Most attempts to make a large C++ codebase reusable end in the same place: a common library. Someone moves the string type, the allocator hooks, a base class and a logging singleton into it, and from then on every project that wants one hash function swallows the whole universe to get it.
So the Familiars follow a short set of rules, and the catalog’s AGENTS.md spells them out for people and coding agents alike. Each library is one idea in its own repository, with a README, a test suite, usually a small demo, and one CMake target named after it. There is no umbrella header, no common runtime and no registration step. Most are header-only, and more than half pull in nothing first-party at all. A library brings its own dependencies through FetchContent, and builds its tests only when it is the top-level project, so you never compile a test suite you are not running.
Using one takes a few lines of CMake:
# One library; its own dependencies come along.include(FetchContent)FetchContent_Declare(flat-map GIT_REPOSITORY https://github.com/Kronuz/flat-map.git GIT_TAG main)FetchContent_MakeAvailable(flat-map)
target_link_libraries(my_service PRIVATE flat_map::flat_map)Every library runs the same shared CI: Linux on x86_64 with GCC and Clang and on arm64, macOS on arm64 and x86_64, FreeBSD, and separate AddressSanitizer, UndefinedBehaviorSanitizer and ThreadSanitizer builds. A piece that only builds on my laptop is not a piece anyone else can use.
Three puzzles, one box
Section titled “Three puzzles, one box”Here is what the same box has built so far. Each system on top links only the pieces it needs, and the shared ones in the middle are where the reuse actually happens.
prism is the smallest: an HTTP application server with content negotiation, compression, colored logs and tracebacks. It is mostly glue. http brings the server, built on reactor (shared-nothing Asio reactors, one per core), http-parser and radix-router, and logger and traceback bring the diagnostics. The catalog calls it the worked example: read it first if you are building a service.
Detent has nothing to do with search. It is runtime configuration (feature flags, kill switches and live settings, read without allocating), and it was the real test, because the pieces it started from had been written for other systems. Its authority serves HTTP with the same http stack, and every handler is a task coroutine. Its durable state replicates through Raft in consensus, on top of journal and completion. Rollout buckets come from sha256 and endian, names are validated with char-classify, and the daemons log through logger. None of that is Detent’s own code, so Detent’s own code is about configuration. Every dependency is pinned by commit in one cmake/dependencies.json, so a change to a shared piece reaches Detent only when Detent asks for it.
Xapiand closes the loop: the engine that gave the catalog its first pieces is now built from it. Its search runs on prospect, which adds terms, postings, BM25 scoring and coroutine queries on top of strata, an LSM-style segment store: immutable segments, background merges under a memory budget, and commits verified against power loss, a full disk and media faults. strata never names a search type, and under it sit termdict for the sorted term table, fusefilter to answer “is this key here?” in three probes, completion for I/O and task for coroutines. Its replication groups run on the same consensus Raft as Detent, and it serves HTTP through the same http and logger as prism. Together, prospect and strata are built to replace Xapian inside it. Store, Then Search tells that half of the story in full.
Pieces flow both ways
Section titled “Pieces flow both ways”The part I did not expect is that Detent gave pieces back.
Its model keeps four tables that are built in bulk and merged in order, which is exactly what a sorted vector does well and what std::map does badly. So on October 23 I wrote a flat_map inside Detent, with a bulk builder and linear merges, and moved the four tables onto it. The next day it became flat-map, a library of its own, and Detent includes it from there. Its authority had a similar story: an immutable, versioned map whose versions share structure, living inside Detent since October 4. It became persistent-map on October 29, and Detent switched to the library on November 25.
That direction matters more than it looks. Once a piece lives in the catalog, a fix found while building one system lands in the library, and every other system picks it up on its next pin. The catalog’s first rule is never duplicate; extend: if a library almost does the job, it gets extended at the source, never copied and patched. The second half of that bargain is that these libraries are used by applications that are not in front of me, so additions are welcome, and a breaking change to an API or an on-disk format has to be called out explicitly.
What carries over
Section titled “What carries over”None of this needed a grand design up front. Many of the Familiars spent years inside Xapiand before their edges stopped moving, and flat-map needed a single day; in both cases the library came out after the boundary was obvious, not before.
What does need discipline is keeping leaves as leaves. A hash function never gets to pick up logging because it would be convenient, and a container never learns about I/O. That is the whole trick: if adding something would make a library harder to drop into an unrelated project, it belongs in the caller, or in a new library. Keep that one rule, and the pieces stay small enough to fit puzzles you have not thought of yet.
If you want to explore, start at Meet the Familiars to find the piece you need, the catalog for how they layer, and Session Zero for the series that opens them one at a time.