Starting Knowledge Bases

Writing a coding agent tool in OCaml.

A couple days ago, Steve Yegge wrote about a coding agent tool he's been developing called Beads.

Beads is a lightweight memory system for coding agents, using a graph-based issue tracker. Four kinds of dependencies work to chain your issues together like beads, making them easy for agents to follow for long distances, and reliably perform complex task streams in the right order.

I haven't had an opportunity to see if it works well or not, but the feature set seems straightforward to implement and I've been looking for a project to work on which will involve OCaml and publishing to opam. I'll be documenting the development process here 😁.

MVP Requirements

I'll shoot for these basic features:

Dune Init

Using dune init, fiddling around with symbol names, and moving some files around, gets me a basic OCaml setup for a package named knowledge-bases containing only a binary named bs. See ebf883e.

dune-project:

(lang dune 3.11)
(name knowledge-bases)
(generate_opam_files true)

(package
 (name knowledge-bases)
 (synopsis "Knowledge base management CLI for coding agents")
 (description "A CLI tool for creating and managing git-distributed knowledge bases suited for coding agents.")
 (depends
  (ocaml (>= 5.4.0))
  (dune (>= 3.20.0))
  )
)

bin/dune:

(executable
 (name main)
 (public_name bs)
 (package knowledge-bases))

At this point I can run hello world:

alex@box % dune exec bs
Hello from knowledge-bases!

README & LICENSE

After the init commit, comes a basic README and settling on the MIT License. See 1da59bb.

Retro

It's straightforward to setup a really basic executable with dune. Love how fast and full-featured dune is at compiling OCaml code, syntax-aside (I've struggled a bit to figure out how and where to stick commands I see in the documentation).

More to come!