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.
  • 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.

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.

Release files for amrita-sense 0.8.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 amrita-sense 0.8.0
File Size Uploaded
amrita_sense-0.8.0.tar.gz 122.3 kB Details

Built distribution (wheel)

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

Total release size: 233.8 kB

Release files / amrita_sense-0.8.0.tar.gz

Download URL amrita_sense-0.8.0.tar.gz
Size 122.3 kB
Tags Source
SHA-256 checksum
How to use checksums
45527e1c43c0ea1956e7de43bb027448e58cb8ef5cc129641b98fa3e4c07c43a
BLAKE2b-256 checksum
How to use checksums
64df9a8a3ad13da2fe7c9b95f5571ce74107bd03dfce7cfe11ab2ee6ea204591
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.19 {"installer":{"name":"uv","version":"0.12.19","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}

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

Download URL amrita_sense-0.8.0-py3-none-any.whl
Size 111.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b1ac81a2c320d5e00138623ba8527ec7f3e7ac0117ef896033e43d15217a1b09
BLAKE2b-256 checksum
How to use checksums
2caab7900e7a18de5bb1414018dd66d2368a4daf1e1bd35dee1b5df4f72553d1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.19 {"installer":{"name":"uv","version":"0.12.19","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}
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