Rulence v0.3 launch build pip install rulence ->

Open source • Local-first policy layer

Rulence

One machine. Consistency across all agents.

Value in Consistency.

Rulence classifies task difficulty first, then applies local policy files that decide when agents check memory, spend tokens, call tools, escalate, or stop.

PyPI version npm version License: MIT GitHub stars
rulence preflight local
incoming task migrate the database this week
classification Tier 4 / complex

~/.rulence/policies/tier-4-complex.md

verdict warn

release freeze conflicts with migration

context budget 18.4k4.9k
memory_check consistency_check context_budget tool_preflight counterexample_search
Python

CLI and local policy engine

pip install rulence
Node.js / MCP

Run as an MCP server

npx -y @rulence/mcp
Docker

Pull the container image

docker pull ghcr.io/rulence/rulence:latest

One-line runner setup

Put the same local policy layer in front of each agent.

Claude Code

PreToolUse gate

rulence install claude-code
Cursor

Project rule

rulence install cursor --dir .
n8n

MCP server config

rulence install n8n

Demo artifacts

Same task, same verdict, same trace.

Public demo artifacts live in the repository: the trace, the runnable script, and the recording script for the launch video.

Policy-firstAgents do not choose their own safety checks.
Memory-firstAsk local context before burning model context.
Audit-firstEvery decision cites the policy that produced it.
Local-firstMarkdown rules, local files, optional cloud.

The Rulence philosophy

Your machine is the source of truth.

Your memory belongs to you.

Agents should ask your memory before wasting tokens.

Reasoning should be inspectable, not hidden.

Rules should travel across agents.

Local first. Cloud optional. No lock-in.

Rulence turns local memory and project rules into a reasoning layer agents can use across tools, models, and runtimes.

First call every agent makes

Task triage decides how much reasoning the job deserves.

Tier 0Direct

No tool use. No policy overhead beyond current instruction.

Tier 1Trivial

Answer from current context or local memory.

Tier 2Mild

One lookup, one file, or one memory check.

Tier 3Moderate

Multi-step work with budget and consistency checks.

Tier 4Complex

Tool chains, code edits, migrations, research, or synthesis.

Tier 5High-risk

Credentials, destructive actions, sensitive data, or unclear intent.

What users gain

Cheaper agents, safer actions, more consistent decisions.

01

Cheaper agents

Budget context before execution, retrieve only relevant memory, and reduce repeated rediscovery.

02

Safer agents

Check contradictions, stale assumptions, risky tool chains, and high-impact actions before execution.

03

Consistent agents

Keep rules, preferences, constraints, and prior decisions available across agents and model providers.

Policy files travel

One local rulebook can govern Maru, Hermes, Claude, Cursor, Codex, and future agents.

---
tier: 3
required:
  - memory_check
  - consistency_check
  - context_budget
  - tool_preflight
block_if:
  contradictions_found: true
  sensitive_action: true
---

Use this tier for multi-step work
that may call tools or rely on memory.

Memory before tokens

Rulence does not replace memory. It governs how agents reason over it.

HonchoInternal memory: user preferences, identity, behavior patterns.
MemPalaceExternal memory: project facts, notes, documents, decisions.
RulenceReasoning layer: conflicts, constraints, budgets, evidence, actions.

What Rulence checks

Rules before action. Evidence before confidence.

Task Triage

Classify difficulty, risk, ambiguity, and required checks before the agent starts.

Policy Router

Load the right local policy file and compose only the checks that tier requires.

Context Budgeter

Predict input, output, memory, tool-call, cost, and latency budget before the agent starts.

Logic Checker

Extract claims, premises, assumptions, conclusions, and contradictions from agent plans.

Memory Arbiter

Compare current instruction, Honcho, MemPalace, local files, freshness, and confidence.

Counterexample Finder

Look for a case where the agent plan fails before it spends tokens or calls tools.

Constraint Solver

Use deterministic checks first, then optional Z3 or Prolog when a claim can be formalized.

Tool-Call Preflight

Warn, shrink, route, or block when an action chain relies on weak reasoning.

Audit Log

Record policy version, tier, checks run, warnings, overrides, and final verdict.

Canonical links

Install packages, inspect the source, and read the docs from the registry of record.

Benchmarks coming

No fake numbers. Rulence will measure the savings it claims.

TokensEstimated vs actual context reduction per task.
RoutingWhen to use memory, solver, local model, or escalation.
ReliabilityJSON validity, contradiction detection, latency overhead.