Stateful agent-graph framework with deterministic governance via Fathom
Project description
Harbor
Stateful agent-graph framework with deterministic governance.
Harbor composes LLMs, classical ML models, tools, and deterministic logic into auditable, replayable graphs. Transitions between nodes are decided by Fathom (a CLIPS rules engine) over provenance-typed facts — not by an LLM playing router.
Status: v0.2.2 — Alpha. Public API is unstable until v1.0. Built for environments where auditability, determinism, and provenance matter more than ecosystem size (DoD, regulated, air-gapped, cleared workloads).
The thesis
LLMs are knowledge engineers, not inference engines. CLIPS is a better inference engine than any LLM. Use the right tool for each job and let rules — not LLMs — decide what happens between tools.
In most agent frameworks the LLM is both the worker and the router: it does the thinking and picks the next step. That is fine for demos and brittle in production. Harbor splits the job. Nodes do work (LLM calls, ML inference, tool invocations, retrieval). Rules decide what happens next. The decision layer is inspectable, versioned, replayable, and free of stochastic drift.
What you get
- Rule-routed graphs. No static edges. Transitions are derived at runtime by Fathom rules matching against typed facts in CLIPS working memory.
- Provenance-typed facts. Every fact carries
(origin, source, run_id, step, confidence, timestamp). Origins are typed:llm | tool | user | rule | model | external. Trust is a first-class type. - Classical ML as first-class nodes. sklearn, XGBoost, PyTorch, ONNX run alongside DSPy LLM modules. Route on confidence, fall back to LLMs only when the cheap model is unsure.
- Counterfactual replay. Checkpoint pinning + structural graph hashing makes deterministic replay free. Re-execute from any step with mutated rule, node output, or fact, and diff against the original run.
- Pluggable stores behind Protocols.
VectorStore(LanceDB),GraphStore(Kuzu),DocStore/MemoryStore/FactStore(SQLite). Embedded by default, swappable for hosted providers. - Boundary-clean state. Mutate Pydantic state freely inside a node. On exit, annotated fields mirror into CLIPS, rules fire, checkpoint persists. Predictable, testable, transactional.
- Two authoring modes. Python with full Pydantic typing, or YAML with a compiled subset for non-Python contributors. One runtime truth.
- Headless serving.
harbor serveexposes HTTP + WebSocket triggers (manual,cron,webhook) over FastAPI with OpenAPI 3.1.
Architecture
harbor serve triggers, scheduler, HTTP/WS, run history
│
harbor.Graph orchestration, streaming, checkpointing
│
harbor.skills agents-as-subgraphs, tool registry, plugins
│
Bosun rule packs budgets, retries, safety, audit (Fathom rules)
│
Fathom (CLIPS) routing and governance inference
│
Nodes: DSPy │ ML models │ tools │ retrieval │ memory ops
Install
uv add harbor # core
uv add 'harbor[ml]' # + sklearn / xgboost / onnxruntime
uv add 'harbor[stores]' # + lancedb / kuzu / pyarrow
uv add 'harbor[skills-rag]' # + sentence-transformers
Requires Python 3.13.
Quick taste
A graph that runs a cheap intent classifier first and only falls back to an LLM when confidence is low:
nodes:
classify_intent: ml:intent_clf@v3 # XGBoost
fallback_llm: dspy:intent_predict
act: tool:do_thing
rules:
- when: { classify_intent.confidence: { lt: 0.7 } }
then: { goto: fallback_llm }
- when: { last: classify_intent, classify_intent.confidence: { gte: 0.7 } }
then: { goto: act }
governance: [bosun:budgets, bosun:audit]
Run it:
harbor run path/to/graph.yaml
harbor serve # FastAPI on :8000
Counterfactual replay from Python:
run = harbor.load_run("r-7af2")
alt = run.counterfactual(step=4, mutate={"facts.intent": "research"})
diff = harbor.compare(run, alt)
Concepts at a glance
| Term | Meaning |
|---|---|
| Graph | Static blueprint: nodes, state schema, rules, governance. |
| Run | One execution of a graph, addressable by run_id, fully resumable. |
| Node | A unit of work: DSPy module, ML model, tool call, retrieval, sub-graph. |
| State | The Pydantic-typed bundle of values flowing through a run. |
| Fact | A CLIPS tuple — mirrored from annotated state, emitted by the runtime, or asserted by rules. |
| Rule | A Fathom production. Matches facts, emits a routing action (goto, parallel, halt). |
| Pack | A versioned named collection of rules — mounted onto a graph declaratively. |
| Skill | A bundle of tools, optional sub-graph, optional prompt fragment. The unit of capability composition. |
| Plugin | A pip-installable package shipping skills, tools, nodes, or stores via entry points. |
| Store | The data tier abstraction (vector/graph/doc/memory/fact); concrete impls are Providers. |
| Checkpoint | Per-transition snapshot: state, facts, last node, next action, graph hash. |
The full glossary, including disambiguations like node vs tool and
state vs facts, lives in
design-docs/harbor-concepts.md.
What Harbor is not
- Not a prompt-optimization framework — that's DSPy, which Harbor uses.
- Not an inference engine — that's Fathom/CLIPS, which Harbor uses.
- Not a vector or graph DB — Stores wrap real ones (LanceDB, Kuzu, …).
- Not a workflow UI —
harbor serveis headless. UI is a future product. - Not chasing LangGraph or n8n on mindshare. It competes on correctness, inspectability, and ability to run where those tools can't.
Project layout
src/harbor/
graph/ Graph, Run, transitions, streaming
runtime/ Engine, scheduler, concurrency
nodes/ DSPy, ML, retrieval, memory, tool-call nodes
fathom/ Adapter to the Fathom CLIPS engine
bosun/ Reference governance rule packs
skills/ RAG, autoresearch, wiki, ReAct
stores/ Vector/Graph/Doc/Memory/Fact protocols + providers
tools/ Tool registry + Nautilus broker tool
triggers/ manual / cron / webhook
serve/ FastAPI HTTP + WebSocket API
checkpoint/ Per-transition persistence (SQLite default, Postgres adapter)
replay/ Counterfactual replay engine
cli/ harbor run / serve / inspect / replay / counterfactual
ir/ YAML → IR compiler
ml/ Classical-ML node integrations
demos/ End-to-end reference graphs (PR review, SOC triage, …)
design-docs/ Concepts, design, ADRs, plugin API, roadmap
docs/ User-facing docs site (mkdocs)
tests/ unit · integration · property · replay · migration
Documentation
- Getting Started
- Concepts & Glossary
- Design Document
- Architecture Decision Records
- Plugin API
- Roadmap
Full site: https://harbor.krakn.ai
Sister projects
Harbor is part of the Kraken Networks stack:
- Fathom — CLIPS rules engine Harbor delegates routing and governance to.
- Bosun — reference rule packs (budgets, retries, audit, safety) shipped
in
harbor.bosun.*. - Nautilus — knowledge broker;
ships an in-tree Harbor tool (
harbor.tools.nautilus.broker_request). - Railyard — Harbor's Go predecessor. Harbor is the Python cousin and may supersede it.
Development
make install # uv sync --group dev --group docs
make lint # ruff
make typecheck # pyright (strict)
make test # unit
make test-all # everything (needs Fathom + integration deps)
make docs-serve # local docs site
Contributions: see CONTRIBUTING.md and CODE_OF_CONDUCT.md. Security disclosures: SECURITY.md.
License
Apache-2.0. See LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file stargraph-0.2.2.tar.gz.
File metadata
- Download URL: stargraph-0.2.2.tar.gz
- Upload date:
- Size: 767.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f5dcae4bf1b71c9dc4d8ee92c6bb74bf7d52af01eaaf26b634207b749d04bd35
|
|
| MD5 |
5609dd12099ffc3713597d2e83293357
|
|
| BLAKE2b-256 |
e6aa7f6b206cad84a4a0a46d52a5e3bb51632a34cf53b50e30ebada1ea770281
|
Provenance
The following attestation bundles were made for stargraph-0.2.2.tar.gz:
Publisher:
release.yml on KrakenNet/harbor
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
stargraph-0.2.2.tar.gz -
Subject digest:
f5dcae4bf1b71c9dc4d8ee92c6bb74bf7d52af01eaaf26b634207b749d04bd35 - Sigstore transparency entry: 1423157820
- Sigstore integration time:
-
Permalink:
KrakenNet/harbor@24cfa92ebb5544b0555f3595974cf699d3c17a85 -
Branch / Tag:
refs/tags/v0.2.2 - Owner: https://github.com/KrakenNet
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@24cfa92ebb5544b0555f3595974cf699d3c17a85 -
Trigger Event:
push
-
Statement type:
File details
Details for the file stargraph-0.2.2-py3-none-any.whl.
File metadata
- Download URL: stargraph-0.2.2-py3-none-any.whl
- Upload date:
- Size: 433.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c1c65e3641474dc3e52fecf7b86a1c748caaef0e80d34481c95fcbffbda055d8
|
|
| MD5 |
bd27fe385406b8b8ce2230415cdcdcd8
|
|
| BLAKE2b-256 |
88cb6079af14c8c55d8e8006551a45654064f17fab74b50d928cc8d42cce16cd
|
Provenance
The following attestation bundles were made for stargraph-0.2.2-py3-none-any.whl:
Publisher:
release.yml on KrakenNet/harbor
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
stargraph-0.2.2-py3-none-any.whl -
Subject digest:
c1c65e3641474dc3e52fecf7b86a1c748caaef0e80d34481c95fcbffbda055d8 - Sigstore transparency entry: 1423157880
- Sigstore integration time:
-
Permalink:
KrakenNet/harbor@24cfa92ebb5544b0555f3595974cf699d3c17a85 -
Branch / Tag:
refs/tags/v0.2.2 - Owner: https://github.com/KrakenNet
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@24cfa92ebb5544b0555f3595974cf699d3c17a85 -
Trigger Event:
push
-
Statement type: