A modern Python-first expert system runtime built on CLIPS. Define rules in YAML. Evaluate in microseconds. Zero hallucinations.
PyPI Docs License: MIT Python 3.12+ CI Downloads codecov Discord
Part of the Kraken stack: Fathom (reasoning engine) · Nautilus (policy data broker) · Stargraph (agent-graph framework).
Current version: 0.7.0
License: MIT
Language: Python 3.12+ (primary), Go and TypeScript SDKs in progress
Package Manager: uv
Maintained by: Kraken Networks
Every AI agent framework lets agents decide what to do by guessing. For most tasks, that's fine.
For some tasks, guessing is unacceptable:
- Policy enforcement — "Is this agent allowed to do this?" can't be a maybe.
- Data routing — "Which databases should this query hit?" can't hallucinate a source.
- Compliance — "Did this fleet operate within NIST 800-53 controls?" needs a provable answer.
- Classification — "What clearance level does this data require?" is not a prompt engineering problem.
Fathom provides deterministic, explainable, auditable reasoning using CLIPS — a battle-tested expert system — wrapped in a modern Python library with YAML-first rule authoring.
uv add fathom-rules
from fathom import Engine # Loads templates/, modules/, functions/, and rules/ from a project directory engine = Engine.from_rules("policy/") engine.assert_fact("agent", { "id": "agent-alpha", "clearance": "secret", "purpose": "threat-analysis", "session_id": "sess-001", }) engine.assert_fact("data_request", { "agent_id": "agent-alpha", "target": "hr_records", "classification": "top-secret", "action": "read", }) result = engine.evaluate() print(result.decision) # "deny" print(result.reason) # "Agent clearance is below the data classification (no read up)" print(result.duration_us) # ~90 (microseconds; varies by machine)
See the Getting Started guide for a full walkthrough.
Core runtime (Python)
- YAML compiler for templates, rules, modules, and functions
- Forward-chaining evaluation with rule + module traces
- Working memory persistence across evaluations within a session
- Classification-aware operators (
below,meets_or_exceeds,dominates, compartments) - Temporal operators (
count_exceeds,rate_exceeds,changed_within,last_n,distinct_count,sequence_detected) - Rule-assertion actions (
then.assert+bind) and user-defined Python functions (Engine.register_function) - Structured JSON audit log with append-only sinks
- Ed25519 attestation service for signed evaluation results
- Fleet reasoning with Redis and Postgres backends for shared working memory
Integrations
- FastAPI REST server with bearer-token auth and rule-path jailing
- gRPC server with bearer-token auth (see
protos/fathom.proto) - MCP tool server (
FathomMCPServer) for agent discovery - LangChain adapter callback handler
- CLI —
fathom validate,fathom compile,fathom test,fathom bench,fathom info,fathom status,fathom verify-artifact,fathom verify-chain,fathom repl - Docker sidecar (Debian slim + uv)
- Prometheus metrics export (
/metricsendpoint) - Policy Studio — FastAPI + HTMX UI that mounts the REST engine in-process under
/api(python -m fathom.studio.app)
Rule packs
fathom-owasp-agentic— OWASP Agentic Top 10 mitigationsfathom-nist-800-53— Access control, audit, information flowfathom-hipaa— PHI handling, minimum necessary, breach triggersfathom-cmmc— CMMC Level 2+ controls
SDKs (in progress)
fathom-go— REST + gRPC client (packages/fathom-go/)fathom-ts—@fathom-rules/sdkv0.1.0 (packages/fathom-ts/); OpenAPI-generated client pendingfathom-editor— React visual rule editor (packages/fathom-editor/); stub
| Primitive | Purpose | CLIPS Construct |
|---|---|---|
| Templates | Define fact schemas with typed slots | deftemplate |
| Facts | Typed instances asserted into working memory | working memory |
| Rules | Pattern-matching logic with conditions and actions | defrule |
| Modules | Namespace rules with controlled execution order | defmodule |
| Functions | Reusable logic for conditions and actions | deffunction |
Unlike stateless policy engines (OPA, Cedar), Fathom maintains working memory across evaluations within a session:
- Cumulative reasoning — "This agent accessed PII from 3 sources — deny the 4th."
- Temporal patterns — "Denial rate spiked 400% in 10 minutes — escalate."
- Cross-fact inference — "Agent A passed data to Agent B, who is requesting external access — violation."
As a library
from fathom import Engine engine = Engine.from_rules("rules/") result = engine.evaluate()
As a REST sidecar
docker run -p 8080:8080 -v ./rules:/rules kraken/fathom:latest curl -H "Authorization: Bearer $TOKEN" -X POST localhost:8080/v1/evaluate \ -d '{"facts": [...], "ruleset": "access-control"}'
As a gRPC sidecar
# protos/fathom.proto — regenerate Go/TS clients from the proto grpcurl -H "authorization: Bearer $TOKEN" \ -d '{"facts": [...]}' localhost:50051 fathom.v1.Fathom/Evaluate
As an MCP tool
from fathom.integrations.mcp_server import FathomMCPServer server = FathomMCPServer(engine) server.serve()
Docs live under docs/ and build with MkDocs Material (Diátaxis information architecture).
Entry points:
| Operation | Target |
|---|---|
| Single rule evaluation | < 100μs |
| 100-rule evaluation | < 500μs |
| Fact assertion | < 10μs |
| YAML compilation | < 50ms |
- Bosun: Agent governance built on Fathom (fleet analysis, compliance attestation)
- Nautilus: Intelligent data broker built on Fathom (multi-source routing, classification-aware scoping)
- Stargraph: Workgraph, AI orchestration framework built on Fathom
git clone https://github.com/KrakenNet/fathom.git cd fathom uv sync --all-extras # --all-extras is required for the full test suite uv run pytest # 1695 tests uv run ruff check src/ tests/ # lint uv run mypy src/ # type check uv run pytest --cov=fathom # coverage report uv run mkdocs serve # docs preview
Run the live REST server locally:
uv run uvicorn fathom.integrations.rest:app --reload
See CONTRIBUTING.md for full development guidelines and CHANGELOG.md for release notes.
Star History ChartMIT — see LICENSE for details.
Maintained by Kraken Networks · krakennetworks.com · krakn.ai