Skip to main content

NOMARK Engine — open-core agent outcome quality resolver

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nomark_engine-0.2.0.tar.gz (20.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nomark_engine-0.2.0-py3-none-any.whl (18.0 kB view details)

Uploaded Python 3

File details

Details for the file nomark_engine-0.2.0.tar.gz.

File metadata

  • Download URL: nomark_engine-0.2.0.tar.gz
  • Upload date:
  • Size: 20.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for nomark_engine-0.2.0.tar.gz
Algorithm Hash digest
SHA256 0883010dab9d1ddc3145e7692b99455d36d7340cd8a0ccc153e4dd9041620b00
MD5 07ce9065e48d937a026c16b93bfd6cb7
BLAKE2b-256 6103994baf00f79eb7c65fa3c2a4a7cd06e6d44eb2a4cb321e5352341812df6a

See more details on using hashes here.

Provenance

The following attestation bundles were made for nomark_engine-0.2.0.tar.gz:

Publisher: publish.yml on NOMARJ/nomark-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nomark_engine-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: nomark_engine-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 18.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for nomark_engine-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bada12d714dcbe4b0c6a4eb963c4afbe0bbacb44ee7cbece0f84e0a1ac666cbe
MD5 e8578d74c021c2d63bb64515ff972f5c
BLAKE2b-256 b4bbdd24e1b0b6d80a4e129e38f0becd571f70c4e710b0c7cc76c7b3d744bf6e

See more details on using hashes here.

Provenance

The following attestation bundles were made for nomark_engine-0.2.0-py3-none-any.whl:

Publisher: publish.yml on NOMARJ/nomark-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page