Build your own vector database
Scale up & ship·12 min

The mini-Qdrant CLI

0 / 1
# grade this stage (from your course directory)
npx theinference test --stage the-cli --watch

Wrap it in a CLI. The vdb subcommands turn your index into a tool: build an index, search it, filtered search with a payload filter, and save it to a segment. This is the surface a user touches — and the last green check.

What to build

Your task

Wire the vdb CLI

Implement the vdb dispatcher in src/cli.ts: build (print { built, n, topLayer }), search <queryIdx> (print result ids), filtered <queryIdx> <filterName> (print filtered ids), save (serialize, print byte count + header). The graded command is vdb build.

your_program.sh
./your_program.sh vdb build  <fixture>/chapters/09-capstone/steps/02-the-cli/fixtures/data.json
./your_program.sh vdb search 0 <data.json>
./your_program.sh vdb filtered 0 high <data.json>
./your_program.sh vdb save  <data.json>
How it's graded

Process mode: stdout_json_match of vdb build output { built: 1, n, topLayer } against the frozen reference, atol 0. The other subcommands are yours to drive interactively — they reuse the same deterministic index.