Skip to main content

nomark-engine

PyPI PyPI downloads License

The open-core preference resolution engine for AI agents. Python port of @nomark-ai/engine — identical resolution logic, Pydantic v2 models.

Install

pip install nomark-engine

Requires Python 3.10+.

Quick Start

from nomark_engine import create_resolver, parse_ledger, ResolverConfig

# Parse a NOMARK ledger (JSONL format)
entries = parse_ledger(open("nomark-ledger.jsonl").read())

# Create a resolver
resolver = create_resolver(ResolverConfig(entries=entries))

# Resolve all preference dimensions
result = resolver.resolve_all()
for dim, res in result.dimensions.items():
    if res.winner:
        print(f"{dim}: {res.winner.pref.target} (score: {res.winner.score})")

# Resolve intent from natural language
result = resolver.resolve_input("make it shorter")
for match in result.meaning_maps:
    print(f"Matched: {match.trigger} -> {match.intent}")

Modules

Schema

Pydantic v2 models for all five signal types: SigPref, SigMap, SigAsn, SigMeta, SigRub. Discriminated unions via LedgerEntry.

Ledger

JSONL parser and writer with per-type capacity constraints and token estimation.

Classifier

Input tier classification: pass-through, routing, or extraction.

Resolver

Five-factor weighted scoring engine:

  • Specificity (0.30) — compound scope > single scope > global
  • Evidence (0.25) — signal count normalized to 20
  • Recency (0.20) — linear decay over 180 days
  • Stability (0.15) — contradiction ratio penalty
  • Portability (0.10) — cross-context usage

Unstable dimensions (winner score < 0.4) recommend asking instead of guessing.

Decay

Time-based weight decay with contradiction acceleration.

Utility

Multi-factor utility scoring and capacity-bounded pruning.

API Reference

Core

Export Description
create_resolver(config) Create a resolver instance
parse_ledger(content) Parse JSONL ledger content
write_ledger(entries) Serialize entries to JSONL
classify(input) Classify input tier
compute_decay(weight, decay) Compute decayed weight
utility_score(entry) Score entry utility
prune_to_capacity(entries) Prune entries within capacity

Types

Type Description
ResolverConfig Resolver configuration
ResolverResult Full resolution output
DimensionResult Single dimension with winner/runner-up
LedgerEntry Discriminated union of signal entries
SigPref / SigMap / SigAsn / SigMeta / SigRub Pydantic signal models

Parity

This package produces identical results to @nomark-ai/engine for identical inputs. The test suites validate cross-language consistency.

License

Apache 2.0

Metadata

Release files for nomark-engine 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nomark-engine 0.2.0
File Size Uploaded
nomark_engine-0.2.0.tar.gz 20.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for nomark-engine 0.2.0
File Interpreter ABI Platform
nomark_engine-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 39.0 kB

Release files / nomark_engine-0.2.0.tar.gz

Download URL nomark_engine-0.2.0.tar.gz
Size 20.9 kB
Tags Source
SHA-256 checksum
How to use checksums
0883010dab9d1ddc3145e7692b99455d36d7340cd8a0ccc153e4dd9041620b00
BLAKE2b-256 checksum
How to use checksums
6103994baf00f79eb7c65fa3c2a4a7cd06e6d44eb2a4cb321e5352341812df6a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 11, 2026.

Transparency log

Release files / nomark_engine-0.2.0-py3-none-any.whl

Download URL nomark_engine-0.2.0-py3-none-any.whl
Size 18.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bada12d714dcbe4b0c6a4eb963c4afbe0bbacb44ee7cbece0f84e0a1ac666cbe
BLAKE2b-256 checksum
How to use checksums
b4bbdd24e1b0b6d80a4e129e38f0becd571f70c4e710b0c7cc76c7b3d744bf6e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 11, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page