Harnesschain is a Rust library that helps you maintain LLM context chains.
It stores your LLM context as a tree onto a disk database, and helps you submit requests to OpenAI-compatible or OpenResponses-compatible servers.
Each context chain is a path from the root to a head node, and is append only. Chains allow forking by appending from a non-head node, or appending multiple blocks from the same node. This append-only design ensures perfect KV Cache efficiency.
Harnesschain is designed with no in-memory state, allowing your AI application to be stopped and resumed at any point.
This library is being developed. The APIs and database schema aren't finalized. The code quality can't be guaranteed.
This library is developed using large language models. Again, the code quality can't be guaranteed.