NeoSyntropy

NEOSYNTROPY FRAMEWORK / DECLARATIVE AI

Declare the function.
Grow the model.

Add a decorator to a typed Python function. Start with foundation-model intelligence, collect evaluated examples, and tune a small specialist model—without changing the function your application calls.

A ROUTER OVER YOUR FUNCTIONS

Pass the options.
Keep the boundary.

Give SemanticRouter a labeled list of decorated functions. It chooses only from that list, and every unmatched request follows your explicit fallback.

pip install neosyntropy
PYTHON / SEMANTIC ROUTER3 LINES
router = SemanticRouter(routes={
    "refund": quote_refund, "tracking": track_order,
}, fallback_node=human_handoff)
REQUESTWhere is order ORD-204?SELECTEDtrack_order()

DECLARATIVE TUNING / SMALL MODELS

Your function becomes
its own intelligence.

The decorator is the contract—not a black box. Start with a foundation model, collect evaluated examples, then tune a small model for that exact function. Your Python call stays the same.

How model-backed nodes work ↗
TRAINING DATASET / REVIEWED RUNS COLLECTING
TUNING TARGET1,000evaluated runs

Only executions that pass the schema, critic, and review gates enter the task-specific dataset.

01 SCHEMA VALID02 CRITIC APPROVED03 REVIEWED
WHEN 1,000 QUALIFYDATASET READYSTART TUNE →
MODEL LIFECYCLEFOUNDATION → SPECIALIST
01

Declare

A typed function or API schema defines one narrow responsibility.

02

Collect 1,000 runs

Schema checks and critics turn evaluated executions into a reviewed training set.

03

Tune

NeoSyntropy trains a lightweight adapter on a compact base model.

04

Serve

The same contract runs on your specialized model inside the controlled runtime.

STARTFoundation modelGeneral intelligence supplies the first high-quality runs.
LEARNReviewed examplesSchema checks, traces, and critics keep only useful supervision.
DEPLOYSmall specialist modelA versioned adapter serves one job with lower cost and latency.

You keep the contract, the execution path, and the audit trail. The model behind the node can improve without rewriting the application around it.

RUNTIME MODELS / YOUR PROGRAM

Models that grow
with your program.

Each node starts with general intelligence, learns from evaluated runs, and becomes a small specialist for one responsibility. Your graph, schemas, functions, and policies remain the contract.

ACCURACYEvaluatedMeasured on the examples your node actually sees.
POLICYValidatedDeterministic guards run before side effects commit.
LATENCYSuper fastCompact models serve one narrow task without general-model overhead.
01 / STRUCTURED OUTPUT

SchemaNode

Extract typed values that must match your application schema.

extract = SchemaNode("ExtractRefund",
    input_schema=OpenInput,
    output_schema=RefundTicket,
    prompt="Extract the refund request.",
)
02 / BOUNDED REASONING

ReasoningNode

Reason with only the context and tools you explicitly allow.

reason = ReasoningNode("CheckPolicy",
    input_schema=OpenInput,
    prompt="Check the refund policy.",
    tools=("lookup_order",),
)
03 / CONTROLLED ROUTING

SemanticRouter

Choose one labeled function and fall back when nothing fits.

router = SemanticRouter(id="SupportIntent",
    input_schema=OpenInput,
    routes={"refund": refund,
            "tracking": track_order},
    fallback_node=human_handoff,
)
04 / FAIL-CLOSED GUARD

Policy validation

Run deterministic business policy before an action can commit.

@functional_validation_node(output_key="policy_ok")
def validate(ctx):
    return ctx.state["amount"] <= 100
05 / MEASURED QUALITY

Accuracy KPI

Score useful outcomes and feed evaluated runs back into tuning.

@functional_kpi_node(output_key="accuracy")
def accuracy(ctx):
    return 1.0 if ctx.state["accepted"] else 0.0

FROM DECLARATION TO EXECUTION

Build. Run.
Inspect. Refine.

Compose nodes into a Workflow or FSM. Define permitted edges and guards, execute with your project client, and inspect runs in the console. Schema validation checks structure; application policy checks whether an action should proceed.

01

Define typed inputs and outputs

02

Connect nodes and allowed transitions

03

Configure the project client and models

04

Run the workflow and inspect its trace

Start with one
useful AI node.