Skip to main content

KAIROS-ARK: A deterministic multi-threaded scheduler for agentic AI workflows

Project description

KAIROS-ARK

KAIROS-ARK Logo

The Operating System for Agentic AI

Rust Python License

Overview

KAIROS-ARK is a high-performance, deterministic execution kernel designed for mission-critical agentic AI workflows. Unlike traditional frameworks that prioritize prompt engineering, KAIROS-ARK prioritizes system integrity, reproducibility, and industrial-grade governance.

It provides a specialized "Operating System" for agents, handling:

  • Scheduling: Deterministic, multi-threaded task execution.
  • Memory: Zero-copy shared memory for large datasets.
  • Security: Kernel-level policy enforcement and sandboxing.
  • Time: Logical clocks for bit-for-bit identical replay debugging.
  • Governance: Human-in-the-Loop (HITL) approvals and cryptographic audit logs.

KAIROS-ARK Architecture


Key Features

Feature Description
⚡ High Throughput Process 720,000+ nodes/second with Rust-native execution.
🔒 Policy Engine Restrict agent capabilities (Network, FS, Exec) at the kernel level.
⏱️ Time-Travel Replay any execution from a ledger with 100% determinism.
🚀 Zero-Copy Pass GB-sized payloads between tasks in microseconds.
🤝 Interoperability Native adapters for LangGraph, CrewAI, and MCP tools.
🛡️ Governance Cryptographically signed audit logs and enforced HITL protocols.

Installation

pip install kairos-ark

Or build from source for maximum performance:

git clone https://github.com/YASSERRMD/KAIROS-ARK.git
cd KAIROS-ARK
pip install maturin
maturin develop

Quick Start

1. Hello World Agent

from kairos_ark import Agent

# Create a deterministic agent
agent = Agent(seed=42)

# Add tasks (nodes)
agent.add_node("fetch", lambda: {"data": "raw data"})
agent.add_node("process", lambda: {"status": "processed"})

# Connect workflow
agent.connect("fetch", "process")

# Execute
results = agent.execute("fetch")
print(f"Executed {len(results)} nodes")

2. Parallel Execution

KAIROS-ARK uses a Rayon-backed thread pool for true parallelism:

# Fork execution into parallel branches
agent.add_fork("start_parallel", ["scrape_web", "query_db", "check_cache"])

# Join results
agent.add_join("sync_results", ["scrape_web", "query_db", "check_cache"])

agent.execute("start_parallel")

Core Capabilities

🛡️ Security & Policy Engine

Prevent "excessive agency" by sandboxing tools at the kernel level.

from kairos_ark import Agent, Policy, Cap

# Define a restrictive policy
policy = Policy(
    allowed_capabilities=[Cap.LLM_CALL],       # Only allow LLM calls
    max_tool_calls={"web_search": 5},          # Rate limit specific tools
    forbidden_content=["password", "api_key"]  # Automatic redaction
)

# Run agent with policy
agent.run("start", policy=policy)

💾 Persistence & Time-Travel Debugging

Debug "Heisenbugs" by replaying execution logs exactly as they happened.

# 1. Save execution ledger
agent.save_ledger("run_001.jsonl")

# 2. Replay later (reconstructs state without re-running side effects)
state = agent.replay("run_001.jsonl")
print(f"Final State: {state['node_outputs']}")

# 3. Create Snapshots for fast recovery
agent.create_snapshot("checkpoint.json", "run_001")

🚀 Zero-Copy Shared Memory

Pass large objects (images, embeddings, codebases) between Python/Rust without serialization overhead.

# Write 1GB data once (~5µs latency)
handle = agent.kernel.write_shared(large_data_list)

# Pass unique handle to other nodes
result = agent.kernel.read_shared(handle)

🤝 Interoperability & Ecosystem

KAIROS-ARK acts as a native backend for other frameworks, with built-in adapters.

# 1. LangGraph Adapter (Native Checkpointer)
from kairos_ark.integrations.langgraph import ArkNativeCheckpointer
checkpointer = ArkNativeCheckpointer(agent)

# 2. Universal Connectors
from kairos_ark.connectors import (
    ArkGeminiConnector,
    ArkOpenAIConnector,
    ArkClaudeConnector,
    ArkOllamaConnector,
    ArkCohereConnector
)

# Gemini (Google)
llm = ArkGeminiConnector(model_name="gemini-2.0-flash-lite")

# Cohere (Enterprise)
cohere = ArkCohereConnector(model="command-r-plus")

# OpenAI / Groq / DeepSeek
groq = ArkOpenAIConnector(
    base_url="https://api.groq.com/openai/v1",
    api_key="gsk_...",
    model="llama3-70b-8192"
)

# Local (Ollama)
local_llm = ArkOllamaConnector(model="llama3")

# 3. Native Tools (Zero-Copy Ready)
from kairos_ark.tools import ArkTools
results = ArkTools.tavily_search("KAIROS-ARK Architecture")

Kernel-Level Support

# State Store (~4µs access)
agent.kernel.state_set("messages", json.dumps(history))

# MCP Tool Registry
agent.kernel.mcp_register_tool("search", "Search tool")

⚖️ Governance & HITL

Industrial-grade compliance features built-in.

# 1. Human-in-the-Loop (HITL) Interrupts
req_id = agent.kernel.request_approval("run_1", "deploy", "Deploy to prod?")
# Execution suspends until approved
agent.kernel.approve(req_id, "admin_user")

# 2. Cryptographic Verification
ledger = agent.get_audit_log_json()
signed = agent.kernel.sign_ledger(ledger, "run_1")
is_valid = agent.kernel.verify_ledger(signed)

Documentation


Benchmarks

KAIROS-ARK is built for speed.

[!NOTE] All benchmarks were executed with native execution only. Python was not present in the hot path.

Category Metric Performance Verdict
Core Kernel Overhead 8.37 µs / node 🚀 10x Faster than Frameworks
Core Tool Chaining 0.45 ms (Total) ⚡ Instant
Core Determinism Byte-for-Byte Match ✅ Exact Replay
Core Parallelism 206ms (4x 200ms) 🧵 True Parallel Fan-out
Throughput Node Throughput 720,000+ nodes/sec High Frequency
Latency Task Dispatch ~1.4 µs Real-time
Latency Policy Check ~3.0 µs Zero-Cost Security
Latency State Store ~4.0 µs Fast IPC

License

MIT License - see LICENSE for details.

Author

YASSERRMD

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

kairos_ark-0.1.8.tar.gz (1.3 MB view details)

Uploaded Source

Built Distributions

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

kairos_ark-0.1.8-pp311-pypy311_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (590.9 kB view details)

Uploaded PyPymanylinux: glibc 2.17+ x86-64

kairos_ark-0.1.8-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (589.4 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

kairos_ark-0.1.8-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (589.5 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

kairos_ark-0.1.8-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (591.9 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

kairos_ark-0.1.8-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (595.6 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

kairos_ark-0.1.8-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (595.6 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

kairos_ark-0.1.8-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (594.9 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

File details

Details for the file kairos_ark-0.1.8.tar.gz.

File metadata

  • Download URL: kairos_ark-0.1.8.tar.gz
  • Upload date:
  • Size: 1.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for kairos_ark-0.1.8.tar.gz
Algorithm Hash digest
SHA256 9ae10814d11e629f0d753f2b299dbbdf637b8a392ad2d69504ee94dd30aac439
MD5 436602fb45e2d788945337a13a8e253b
BLAKE2b-256 d98d8f0b2ae8a7f3228bd6c3bff63bbfe9523b4e256cb3c93a6ef2a30838449c

See more details on using hashes here.

File details

Details for the file kairos_ark-0.1.8-pp311-pypy311_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for kairos_ark-0.1.8-pp311-pypy311_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1cc1d11357b39713f16841d810f998bf98b598f8f7641a3c440a757df7b6aabd
MD5 35aa99fc894b4ee06036f36d83bd01d4
BLAKE2b-256 9df42eadc91b43cab88888394528c8ada9465adc764fe3a9c6a659b2555d3fb6

See more details on using hashes here.

File details

Details for the file kairos_ark-0.1.8-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for kairos_ark-0.1.8-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c1d4120fc72de5120f596eec083d3c5e642383c5b19ae463d48aaa169c2f9db9
MD5 0367501c82cd0e61a85ed402900b15f3
BLAKE2b-256 506e9e633c0e059e79f1974dcc824959125045a0cd321070e46d214af5aaefd5

See more details on using hashes here.

File details

Details for the file kairos_ark-0.1.8-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for kairos_ark-0.1.8-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 add9678fd11d61e04498df2391345461d8289fede3d4d200685c591d9ae99c47
MD5 fd38528b97b59dd7af5a6ebd5c4a53d3
BLAKE2b-256 7504be82153a8d335b97aa5cfbae84ac2c96d0abc8b11f0049f66f7290873c0d

See more details on using hashes here.

File details

Details for the file kairos_ark-0.1.8-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for kairos_ark-0.1.8-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 5a1dc499d33c1f34c9ee8c05f329814ec6babf8cd83fb9593e93684ba006602d
MD5 00bba744fb7851ca64a81da9e12f48e8
BLAKE2b-256 3f3a9c4bb86c5ee231d52551af2865043d8fd962ab78017562358151246b077d

See more details on using hashes here.

File details

Details for the file kairos_ark-0.1.8-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for kairos_ark-0.1.8-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1599a6803fcfec1b74c084ebf1ffa0162a72c890df96f5f6f47ab5ac8d8140cb
MD5 27397e7b721b8ed04ec5f3589820b8fc
BLAKE2b-256 c654e1aecf9d50afefbea96453415cec5285cccf2bcdb3d398156fe884c38bf7

See more details on using hashes here.

File details

Details for the file kairos_ark-0.1.8-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for kairos_ark-0.1.8-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1c235d3cf48c75a75018f646cf002d983b7302a20e968daf8f09dbc5afc3393f
MD5 5dafd7d1f0539fcf9387f3f9cc2068a1
BLAKE2b-256 d29ee5a039cda33fde2ecb8f97e4bb1e81dec584511dd8fd02c131537418fde7

See more details on using hashes here.

File details

Details for the file kairos_ark-0.1.8-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for kairos_ark-0.1.8-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a508dcc5a23d6f14a58abe30e2ad2b4322e51b07aab8b6ccd7f79e504f2f1fb3
MD5 5b59cb4bd99a4126e6c2c34f762b2964
BLAKE2b-256 0df84d4a26b850f6b326def50a3f5a6a1f570a771a558cdc377f7f515b89cfa6

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