Skip to main content
Logo

AmritaSense

PyPI Version Python Version License Discord QQ Group

"Sense is all you need."

AmritaSense is a general-purpose workflow orchestration engine that replaces traditional graph-based models with an instruction set architecture—treating workflows not as nodes-and-edges diagrams, but as programmable execution streams driven by a lightweight virtual machine.

Why AmritaSense?

Most workflow engines force you into a graph mindset: define nodes, connect edges, manage state objects. AmritaSense takes a different path. You compose nodes and control flow just like writing ordinary code—the engine compiles them into a linear instruction sequence, then executes them step by step. The result: zero scheduling overhead, native interrupt support, and the expressive power of assembly-level control flow.

Core Features

  • Complete Instruction Set—IF/ELIF/ELSE, WHILE/DO-WHILE, GOTO/CALL, TRY/CATCH/THEN/FIN, NOP, INTERRUPT. All control flow is first-class, not simulated through graph routing.
  • VM-Style Execution—A program counter (PointerVector) and call stack drive execution. Jumps are integer operations, not graph traversals.
  • Native REPL Debugger—from amrita_sense.debugger import * gives you breakpoints, stepping, and state inspection. Sync API for interactive REPL use (step, cont); async API (step_async, cont_async) for scripted debugging. Built atop the engine's Panic/Recover mechanism and composite middleware injection. Enable _unsafe.__flags__.RESCUE_ON_PANIC to keep the scene on a panic: an interactive terminal drops into a GDB-style (sdb) with a py escape hatch, while headless runs attach a PanicReport and re-raise immediately.
  • Async-Native Suspend/Resume—Two Future callbacks enable full workflow interruption at any node boundary. Built for debuggers and human-in-the-loop systems.
  • Declarative Dependency Injection—Nodes declare dependencies via function signatures. The engine resolves them at runtime with type matching and concurrent resolution.
  • Ultra Lightweight— Compiles 100,000 nodes in ~200ms. Runs anywhere from Raspberry Pi to cloud.
  • Self-Compile Instructions—Extend the instruction set with SelfCompileInstruction. Compile-time expansion, zero runtime overhead.

Installation

pip install amrita-sense

Quick Look

import asyncio
from amrita_sense import Node, WorkflowInterpreter as WorkflowPC, IF


@Node()
def condition() -> bool:
    return True


@Node()
def action():
    print("Done")


@Node()
def end():
    print("End of workflow")


flow = IF(condition, action) >> end
pc = WorkflowPC(flow.render())

if __name__ == "__main__":
    asyncio.run(pc.run())

See more demos in demos/

Documentation

Full guides, concept explanations, and API reference at sense.amritabot.com.

Benchmarks

benchmark.py is a self-contained suite covering control flow, jump/call, interrupt, exception, event-dispatch, dependency-injection, composition, concurrency and memory scenarios.

uv run benchmark.py              # 5 measured runs per scenario, prints a table
uv run benchmark.py --runs 20    # more samples, tighter error bars
uv run benchmark.py --list       # list registered scenarios
uv run benchmark.py --no-json    # skip the JSON export

Each scenario is reported as mean ± 1 stdev, and the whole run is written to benchmark-results.json (raw samples plus host metadata), so two revisions can be diffed mechanically instead of eyeballed. CI runs the suite on every supported Python version and uploads the JSON as an artifact.

Contributing

Contributions are welcome. See CONTRIBUTING.md and our Code of Conduct.

License

Apache V2. See LICENSE.

AIGC Content Licensing Policy

AACLP V1. See POLICY_OF_AIGC (Official Link) for details.

Metadata

Release files for amrita-sense 1.2.1

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

Source distribution (sdist)

Source distribution for amrita-sense 1.2.1
File Size Uploaded Provenance Actions
amrita_sense-1.2.1.tar.gz 180.0 kB Without provenance Details for amrita_sense-1.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for amrita-sense 1.2.1
File Interpreter ABI Platform Actions
amrita_sense-1.2.1-py3-none-any.whl Python 3 none any Details for amrita_sense-1.2.1-py3-none-any.whl

Total release size: 334.8 kB

Release files / amrita_sense-1.2.1.tar.gz

Download URL amrita_sense-1.2.1.tar.gz
Size 180.0 kB
Tags Source
SHA-256 checksum
How to use checksums
f4b493147d7d8c23d860d31c0e581d0c58299e93118ea749e9373c8c5782f41d
BLAKE2b-256 checksum
How to use checksums
42fde4610d240bd93addabffd292fa6d5f154bcf4ef8bae6acc6c697d870f9a9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / amrita_sense-1.2.1-py3-none-any.whl

Download URL amrita_sense-1.2.1-py3-none-any.whl
Size 154.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c58da7f43c4d21145d0d9e303f7167ca5c3c612131eb434c8f6ab2121839d98c
BLAKE2b-256 checksum
How to use checksums
e74ca90587a17e3c47d5ef92378da6b3f8043ca890c2a192ad9d5cd385b9a5a0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for amrita-sense 1.2.1

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.2.1 This release

2 release files No provenance

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