Skip to main content

Next-Gen event stream and workflow engine.

Project description

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 SetIF/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.
  • 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—Core interpreter is ~300 lines. 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

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

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

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

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

See more demos in demos/

Documentation

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

Contributing

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

License

Apache V2. See LICENSE.

(Version <0.2.0 is LGPL V2, when 0.2.0 released, the license will be changed to Apache V2)

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

amrita_sense-0.2.2.tar.gz (52.4 kB view details)

Uploaded Source

Built Distribution

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

amrita_sense-0.2.2-py3-none-any.whl (51.3 kB view details)

Uploaded Python 3

File details

Details for the file amrita_sense-0.2.2.tar.gz.

File metadata

  • Download URL: amrita_sense-0.2.2.tar.gz
  • Upload date:
  • Size: 52.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.17 {"installer":{"name":"uv","version":"0.11.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for amrita_sense-0.2.2.tar.gz
Algorithm Hash digest
SHA256 4a53330983cab454ccf7e1b80afa6407407e24fdb6a1b85aaea193bab980acda
MD5 59474bca3f7faf44a17059dbf0de2cf8
BLAKE2b-256 053bf2d24b316530b42b04974dc5392b3615f0d1378a8da88e5d8dfc4592564d

See more details on using hashes here.

File details

Details for the file amrita_sense-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: amrita_sense-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 51.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.17 {"installer":{"name":"uv","version":"0.11.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for amrita_sense-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e4f43fbe61c8a7848640175e7f04ac0416693f0e0d9ee2fc3925327237367923
MD5 ae946838d4496c9c5827f18c76e47f21
BLAKE2b-256 1eda1239c8808c71dfd3abfaefea5b216967367fe8ea36a8b744c06c6e319fd4

See more details on using hashes here.

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