KAIROS-ARK: A deterministic multi-threaded scheduler for agentic AI workflows
Project description
KAIROS-ARK
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.
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
- Getting Started Guide: Build your first agent in 5 minutes.
- The Scheduler: Deep dive into logical clocks and determinism.
- Policy Engine: Configuring capabilities and sandboxes.
- Zero-Copy Memory: Optimizing for large-scale data.
- Time-Travel Debugging: Mastering the Replay Engine.
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file kairos_ark-0.1.0.tar.gz.
File metadata
- Download URL: kairos_ark-0.1.0.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5e10cb8a7a3660f3c4f838ac7bce598d3cd838483f80783d503a8622813f9a5e
|
|
| MD5 |
d216e4775656e0326370dc270d010bd6
|
|
| BLAKE2b-256 |
af1407439aed3d925fcbed3cebfea4ff6770c7e856486e6c29b70d0120f5277f
|
File details
Details for the file kairos_ark-0.1.0-pp311-pypy311_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: kairos_ark-0.1.0-pp311-pypy311_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 588.3 kB
- Tags: PyPy, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3bdfb8400028cd0210926f7482c80dac60eeb2519d7b777bb5b3254e07ae3296
|
|
| MD5 |
e9b647ec2207f8aca9f704d6a0835fc0
|
|
| BLAKE2b-256 |
08e0d1caf0a0681ee072bda4d5fa1ce3f5e136f5602f92d7ce730cbc1221f278
|
File details
Details for the file kairos_ark-0.1.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: kairos_ark-0.1.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 586.8 kB
- Tags: CPython 3.13, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
747b06d0c2516c4e280a882ee88a0ae74115e999c0a03a3ba52b5e57b3d5e5a3
|
|
| MD5 |
4cb84e37f5144a3efba01663b4c50c7d
|
|
| BLAKE2b-256 |
79dbb4899995e826c22925db9c2426878ce2159763cb39a3b3f7e2aca1315ee5
|
File details
Details for the file kairos_ark-0.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: kairos_ark-0.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 586.9 kB
- Tags: CPython 3.12, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4fea74d78e50fc21ce45ab57bebe51702a8d390d2c3f6e4940d38739c7c4d35c
|
|
| MD5 |
e8b09ae3e9221565887f4633fb4c8762
|
|
| BLAKE2b-256 |
213890580eb42bb298143eb0945e24d1460d3f073fc1188552b31fc6d70f72f7
|
File details
Details for the file kairos_ark-0.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: kairos_ark-0.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 589.4 kB
- Tags: CPython 3.11, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ccfa8468679632ef0714a24f58cd221463f22504e9dc832797774df4f23d8ca8
|
|
| MD5 |
e136509314b65b8383bb835c09e40c8f
|
|
| BLAKE2b-256 |
42bb9f23c6c62e2988b3c08a81667f5552243e0ded7db04b40f7524ba1ac69d0
|
File details
Details for the file kairos_ark-0.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: kairos_ark-0.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 592.0 kB
- Tags: CPython 3.10, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e38db82f5fcc7916e88e1ba4bf16a88cfd24bf59f81149c1be7215f985950278
|
|
| MD5 |
fcad83fbf08d4259486241da2966d8e1
|
|
| BLAKE2b-256 |
8d96bf1e7dc7b23ee73648db968b4726bf38b21069404e6916681983dac49249
|
File details
Details for the file kairos_ark-0.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: kairos_ark-0.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 591.7 kB
- Tags: CPython 3.9, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f4ac7b7a55724531dac9330495eb0f73d17c0ddfb274b7520976460d09674e44
|
|
| MD5 |
b6935ae0d692e21579590c61f55b8e71
|
|
| BLAKE2b-256 |
ae7881b397d01171636fad1d8aef2cb0d46865449d0c8093747bf1597776ffb3
|
File details
Details for the file kairos_ark-0.1.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: kairos_ark-0.1.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 591.1 kB
- Tags: CPython 3.8, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b9fe188d7801f57fa37c637fb824ef910b0e3c3fa112bca75c0fbfec6591cd94
|
|
| MD5 |
c42b6e209429ee01dca63e1e0969d17c
|
|
| BLAKE2b-256 |
6946b4ee7d732b6c939aecbb1a82aad118852faea4b8adab7f635d2aa23c26fb
|