惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Forbes - Security
Forbes - Security
The Register - Security
The Register - Security
G
Google Developers Blog
罗磊的独立博客
WordPress大学
WordPress大学
L
LangChain Blog
博客园 - 三生石上(FineUI控件)
Recorded Future
Recorded Future
Microsoft Azure Blog
Microsoft Azure Blog
Google DeepMind News
Google DeepMind News
大猫的无限游戏
大猫的无限游戏
MongoDB | Blog
MongoDB | Blog
小众软件
小众软件
Recent Announcements
Recent Announcements
T
Tailwind CSS Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
云风的 BLOG
云风的 BLOG
Apple Machine Learning Research
Apple Machine Learning Research
酷 壳 – CoolShell
酷 壳 – CoolShell
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
F
Full Disclosure
The Cloudflare Blog
B
Blog RSS Feed
S
Schneier on Security
T
Tenable Blog
人人都是产品经理
人人都是产品经理
Engineering at Meta
Engineering at Meta
T
Tor Project blog
N
Netflix TechBlog - Medium
T
Threatpost
NISL@THU
NISL@THU
Stack Overflow Blog
Stack Overflow Blog
N
News | PayPal Newsroom
N
News and Events Feed by Topic
aimingoo的专栏
aimingoo的专栏
博客园 - 叶小钗
P
Privacy & Cybersecurity Law Blog
C
CERT Recently Published Vulnerability Notes
Last Week in AI
Last Week in AI
M
MIT News - Artificial intelligence
C
CXSECURITY Database RSS Feed - CXSecurity.com
P
Privacy International News Feed
博客园 - 【当耐特】
Help Net Security
Help Net Security
The Hacker News
The Hacker News
Hugging Face - Blog
Hugging Face - Blog
TaoSecurity Blog
TaoSecurity Blog
S
Secure Thoughts
C
Cisco Blogs
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events

Show HN

GitHub - villagesql/villagesql-skills: Agent skills for VillageSQL - gemini-cli-extension; claude-code-plugin GitHub - flightdeckhq/flightdeck: Observability and control plane for AI agents. CSP Radar GitHub - Light-Heart-Labs/DreamServer: Turn your PC, Mac, or Linux box into an AI server. LLM inference, chat UI, voice, agents, workflows, RAG, and image generation. GitHub - Diplomat-ai/diplomat-agent-ts: What can your TypeScript AI agent do to the real world? Scan your code. See which tool calls have zero checks Code Block Selector - Visual Studio Marketplace Prometheus dependency graph — interactive showcase | Riftmap Show HN: I made a vi-like modal keyboard plugin for Figma GitHub - run-llama/liteparse: A fast, helpful, and open-source document parser GitHub - dalemyers/Roar: A macOS CLI tool for notifications GitHub - district-solutions/open-agent-tools-coder: Enables small-to-large self-hosted ai models to use local source code when running tool-calling agentic workloads. We actively data mine 20,900+ (2+ TB) popular github repos using large and small ai models to create reuseable: json, markdown and parquet files for local-first tool-calling models. GitHub - progapandist/stripeek: A local TUI proxy for real-time Stripe API debugging, built for navigating complex payloads fast. GitHub - sir1st/hermes-desktop: All-in-one cross-platform desktop app for Hermes Agent — bundles Python + hermes-agent + hermes-web-ui GitHub - astefanutti/shaderbang: Shebang for Shaders Show HN: Generate Claude Code Workflows using Spec Driven Development approach GitHub - nixys/nxs-universal-chart: The Helm chart you can use to install any of your applications into Kubernetes/OpenShift Show HN: AI agents for UK GDAD PCF roles and their skills The Two Pillars: Mixer Mode and Meta-Software in the Reorganization of Software Work After AI GitHub - JaiCode08/teleport-env What 1,000+ Harness Experiments Taught Me About Self-Improving Agents Show HN: Liiists, a Markdown-first, iOS and CLI list app SwiperTab – Get this Extension for 🦊 Firefox (en-US) GitHub - kouhxp/fftext: Summarize, explain, fact-check, or translate any text, URL, or file. No GPU. No cloud. One command GitHub - sweetpad-dev/sweetpad: Develop Swift/iOS projects using VSCode GitHub - dogmaticdev/IRON: IRON a.k.a. Intermediate Representation Object Notation is a Interpreter/Database that is used to create Programming Languages. GitHub - sjhalani7/vaen: Package your AI coding harness into a portable .agent file, and share it across repos, teams, & the community without ever having to copy-paste instructions, skills, MCP config, or secrets. Show HN: Gandalf the Grader Show HN: Citadeld – replay any CI failure locally from a single file GitHub - tdortman/cuSBF: High-Performance GPU Super Bloom Filter coral-ai/claude-code-token-xray at main · Coral-Bricks-AI/coral-ai GitHub - ulyssestenn/funes: Funes is a Git-based framework for LLM-managed knowledge work: an AI Librarian ingests raw sources, builds an interlinked Markdown knowledge base, and uses it to produce cited reports, analyses, and other outputs. GitHub - ThatXliner/gah: Git Add Hunk, built for agents to use GitHub - harmont-dev/harmont-cli: Command-line client for the Harmont CI platform GitHub - brooksmcmillin/mcp-authflow: OAuth 2.0 Authorization Server framework for MCP servers GitHub - javaid-codes/audit-supply-chain-agents GitHub - amorey/gochan: A small library of common channel architectures for Go, inspired by Rust GitHub - arifozgun/OpenGem: Free, Open-Source AI API Gateway with Gemini, OpenAI & Anthropic Compatibility in 1 file GitHub - Pranesh950/BioPetals: 🌸 Run BIOxAI models at home, BitTorrent-style. Fine-tuning and inference up to 10x faster than offloading GitHub - cnguyen14/bounty-doctor: Diagnose a GitHub bounty issue before you waste hours: detects honeypot scam repos, AI-bot attempt swarms, and stale contests. Show HN: CoreMCP – MCP Server for On-Prem DBs Show HN: KittyHTML – Render HTML/CSS as an inline image in your terminal GitHub - bingud/filemat: Web-based file manager Show HN: TruthLens – Free multi-signal deepfake image detector GitHub - apexlocal-jz/claude-usage-tray: Windows system-tray app showing your Claude Code rate-limit usage at a glance. Zero deps, ~300 lines of PowerShell. Cross-IDE (works regardless of VS Code, Cursor, plain terminal). Release v0.1.2.1 · kouhxp/yapsnap GitHub - noopolis/moltnet: Self-hostable chat network for AI agents. Pre-built bridges for Claude Code, Codex, and the Claws. Rooms, DMs, history. No Slack bots, no Matrix, no glue code. GitHub - tamerh/enju: Coordinating Humans, AI Agents, and Compute as Peers on a Shared Workflow Graph Show HN: Continuity-auth – Respect-weighted rate limits for the open web GitHub - luml-ai/luml: AI lifecycle platform where engineers and agents track experiments, train models, and ship to production. GitHub - mrdanielcasper/CoreTex: A UNIX-inspired, biomimetic, flat-file AI harness and knowledge engine. GitHub - clemg/pierre-github: Pierre's diffs.com and trees.software for Github GitHub - lyriks-io/unspaghettit: Behavior-driven AI development without prompt spaghetti. GitHub - sofumel/claude-handoff-revive: Resume Claude Code work after rate/usage/context limits without replaying the prior transcript. Auto-saves at 90%/95% usage. Plugin-installable, 10 languages. GitHub - dotexorg/saferpc: Typed, end-to-end encrypted RPC over any bidirectional channel. GitHub - BeeZeeAgent/beezee: Agent harness orchestration Legato Next.js Boilerplate for Internal Tools · CoreUI GitHub - clark-labs-inc/clark-hash: Clark Hash, 32x smaller searchable sketches for embeddings GitHub - ZeroPointRepo/youtube-mcp: The fastest YouTube transcript + YouTube search MCP for AI agents. Try for free. Typing Mastery — climb toward 100+ WPM, deliberately GitHub - Andebugulin/Awareen GitHub - fayzan123/claude-workflow-composer: Visual desktop app for composing multi-agent coding workflows. Drag agents, attach skills and MCPs, wire handoffs, export to .claude/ GitHub - harshaneel/humanize: Best static AI text humanizer. Two research-grounded skills that work in any LLM (Claude, ChatGPT, Gemini, Codex): humanize beats perplexity-based detectors, ai-check produces forensic scoring with evidence-quoted flags. Nine levers, 50+ peer-reviewed sources, 2024-2026 detection literature. GitHub - StackOneHQ/stack-nudge GitHub - nodes-app/swift-markdown-engine: A native AppKit Markdown editor for macOS, built on TextKit 2 and bridged to SwiftUI. We hardened an LLM agent. Each defense we added made it more exploitable. GitHub - alkait/WhatsKept: Agent-queryable WhatsApp history from an iOS backup — a single Go binary. GitHub - octelium/cordium: Open-source, general-purpose sandbox platform for devs and AI agents that provides identity-based secure access to infrastructure without credentials. WAR.GOV/UFO Microfilm5 GitHub - scosman/videowright: Build animated explainer videos with your coding agent GitHub - dipankar/dscode: The code editor you can take apart. GitHub - zoharbabin/web-researcher-mcp: MCP server (Go) for AI assistants: web search, content extraction, academic/patent/news research. Multi-provider routing, 4-tier scraping, search lenses. Works with Claude, Cursor, and any MCP client. GitHub - ruvnet/RuView: π RuView turns commodity WiFi signals into real-time spatial intelligence, vital sign monitoring, and presence detection — all without a single pixel of video. GitHub - scanaislop/aislop: Catch the slop AI coding agents leave in your code: narrative comments, swallowed exceptions, as-any casts, dead code, oversized functions. 50+ rules across 7 languages (TypeScript, JavaScript, Python, Go, Rust, Ruby, PHP). Sub-second, deterministic, no LLM at runtime. MIT-licensed. GitHub - kouhxp/cheap-im: CPU-only voice agent approximating Thinking Machines' Interaction Models demo GitHub - unprovable/OrchidMantis: Orchid Mantis — standalone framework for Zero-Knowledge Proofs of eXploit (ZKPoX). GitHub - MarcellM01/TinySearch: Shrink the web for your local LLMs! GitHub - TangibleResearch/Halgorithem: A Algo designed to detect AI Hallucitions GitHub - DO-SAY-GO/freelang: I love freelang GitHub - CarpseDeam/Aura-IDE: An AI coding harness that shaped itself - Planner/Worker agents, repo awareness, surgical edits, validation, recovery, and safe diff approvals. GitHub - chojs23/concord: A feature-rich TUI client for Discord GitHub - tommyjepsen/awesome-ux-skills: UX & AI Product designs skills you can use today in Claude Code GitHub - aerf-spec/aerf: Agent Evidence Receipt Format (AERF) — an open specification for tamper-evident, independently verifiable records of AI agent actions. GitHub - kklimuk/docx-cli: CLI for AI agents (Claude, Codex) to read, edit, and comment on .docx files with full format fidelity. GitHub - Jwrede/tokentoll: Catch LLM cost changes in code review. Infracost for LLM spend. GitHub - samchon/ttsc: A `typescript-go` toolchain for compiler-powered plugins and type-safe execution + 500x faster lint integrated into compiler GitHub - Higangssh/homebutler: 🏠 Manage your homelab from chat. Single binary, zero dependencies. GitHub - olalie/tapmap: See where your computer connects and what stands out on a live world map. GitHub - matisiekpl/neond: DX-focused control plane for Postgres dedicated to non-critical workloads. Your postgres:latest replacement 🐘 GitHub - Diplomat-ai/diplomat-agent: What can your AI agent do to the real world? Scan your code. See which tool calls have zero checks GitHub - Bajusz15/beacon: Open-source agent for secure remote access, monitoring, and deploys across home-lab and self-hosted machines like Raspberry Pi, N100, or any Linux server. Open web based TTY or tunnel Home Assistant and other local services securely without opening ports. BigTech AI News - Chrome 应用商店 GitHub - vinhnx/VTCode: VT Code is an open-source coding agent with LLM-native code understanding and robust shell safety. Supports multiple LLM providers with automatic failover and efficient context management. GitHub - michaelaz774/decision-engine: A decision operating system for startup founders, powered by Claude Code. Synthesizes wisdom from 25+ legendary founders and investors into interactive AI-driven decision frameworks. GitHub - Chrilleweb/dotenv-diff: Validate environment variable usage in your codebase GitHub - Lumen-Labs/brainapi2: BrainAPI is a knowledge graph–powered AI memory layer that transforms unstructured data into structured knowledge, enabling intelligent search, recommendations, and contextual memory for AI agents and applications. GitHub - familiar-software/familiar: Let AI watch you work. Familiar lets your AI update its memory, skills, and knowledge by watching your screen. GitHub - skorotkiewicz/rudo: A small, elegant dock for Wayland GitHub - muxshed/shed: One stream in, or many. Every destination, simultaneously. No cloud middleman, no per-channel fees, no limits. make sidebar/address bar rounded corner toggleable
GitHub - stateflow-dev/adaptive-runtime: Adaptive Runtime Layer for Stateful AI Systems
StateflowsLa · 2026-05-29 · via Show HN

Runtime Intelligence Layer for Long-Running Systems

CI

Part of the Stateflow Labs Runtime Intelligence Ecosystem


Not a chatbot framework. Not an LLM wrapper. Not a workflow builder.

An adaptive runtime intelligence layer — the missing piece between your application logic and production reality.


The Problem

Most frameworks solve the logic problem.
Nobody solves the runtime problem.

Your service in development:   Works perfectly.
Your service in production:    Crashes. Loses state. Retries blindly. Dies silently.

Long-running systems fail in production because of:

  • 💥 No crash recovery — state lost on restart
  • 🧠 No memory — service forgets context between sessions
  • 🔁 Retry chaos — blind retries with no back-off
  • 📉 No confidence scoring — decisions made without certainty
  • 🌊 No contextual awareness — can't adapt to changing conditions

Adaptive Runtime fixes this.


Why Adaptive Runtime Exists

Most frameworks focus on what a system should do.

Adaptive Runtime focuses on what happens when the system has already been running for hours, days, or weeks — and something goes wrong.

It provides:

  • state persistence — runtime memory that survives crashes and restarts
  • contextual awareness — understanding of current operating conditions
  • confidence-aware decisions — actions weighted by certainty, not just rules
  • recovery workflows — automatic restoration from checkpoints after failure

All of this without requiring a cloud service, LLM, or external orchestration platform.


See It Running

Adaptive Runtime Demo

[16:08:13][RUNTIME]          Event received: service_overload
[16:08:13][CONTEXT_ENGINE]   risk=high  stability=low  pressure=0.65
[16:08:13][CONFIDENCE_ENGINE] confidence=0.84
[16:08:13][DECISION_ENGINE]  ACTION: RESTART_SERVICE
[16:08:13][STATE_ENGINE]     State persisted
[16:08:13][RECOVERY_ENGINE]  Checkpoint #3 created

  → restart_service  [high]  conf=0.840

[16:08:14][RUNTIME]          Event received: anomaly_detected
[16:08:14][CONTEXT_ENGINE]   risk=low   stability=stable  pressure=0.32
[16:08:14][CONFIDENCE_ENGINE] confidence=0.62
[16:08:14][DECISION_ENGINE]  ACTION: FLAG_FOR_REVIEW
[16:08:14][STATE_ENGINE]     State persisted

  → flag_for_review  [low]   conf=0.620

The runtime evaluates conditions, selects actions, remembers state, and recovers — automatically.


How It Works

Event (CPU spike, anomaly, timeout, auth failure...)
  │
  ▼
┌─────────────────┐
│  Context Engine │  → Analyzes conditions: risk, stability, pressure score
└────────┬────────┘
         │
         ▼
┌──────────────────────┐
│  Confidence Engine   │  → Calculates adaptive confidence (with decay + history)
└────────┬─────────────┘
         │
         ▼
┌──────────────────┐
│  Decision Engine │  → Selects action: restart / throttle / rollback / recover...
└────────┬─────────┘
         │
         ▼
┌──────────────────┐
│   State Engine   │  → Persists state to SQLite (survives crashes)
└────────┬─────────┘
         │
         ▼
┌──────────────────────┐
│   Recovery Engine    │  → Creates checkpoint, handles retry with back-off
└──────────────────────┘

Quick Start

# Install from package
pip install adaptive-runtime

# Or for local development
pip install -e .
import asyncio
from adaptive_runtime import Runtime

async def main():
    runtime = Runtime(agent_id="my-agent")
    await runtime.start()

    result = await runtime.process({
        "type": "service_overload",
        "severity": 0.82,
        "cpu": 94,
        "memory": 88,
    })

    print(result.action)      # "restart_service"
    print(result.confidence)  # 0.7831
    print(result.reason)      # "high_resource_pressure"
    print(result.priority)    # "high"

    await runtime.stop()

asyncio.run(main())

That's it. No API keys. No cloud setup. No GPU. Runs on a $5 VPS.


Where Does Adaptive Runtime Fit?

Adaptive Runtime is not something you run instead of your application.

It runs alongside your application — as a runtime intelligence layer between your business logic and real-world operating conditions.

Before Adaptive Runtime — your monitoring loop runs, but has no runtime awareness:

while True:
    run_api_test_case(...)

After Adaptive Runtime — the same loop runs, now with context, confidence, and recovery:

runtime = Runtime(agent_id="api-watchdog")
await runtime.start()

# Runtime observes the signal before your logic runs
result = await runtime.process({
    "type": "timeout",
    "severity": 0.72,
    "latency_ms": 4200
})

# Your original logic remains completely unchanged
run_api_test_case(...)

The watchdog still performs API monitoring. Adaptive Runtime does not replace it — it provides runtime intelligence around it.

Your Application
        │
        ▼
Adaptive Runtime
        │
 ├─ Context Engine
 ├─ Confidence Engine
 ├─ Decision Engine
 ├─ State Engine
 └─ Recovery Engine
        │
        ▼
Runtime Actions

What it adds — without touching your application logic:

  • Contextual awareness — understands the operating environment
  • Confidence scoring — knows how certain a decision is before acting
  • State persistence — remembers across restarts and crashes
  • Recovery workflows — restores from checkpoints automatically
  • Runtime observability — structured metrics and logging built-in

Example: Adding Runtime Intelligence to API Watchdog

API Watchdog is an independent open-source project created by Jose Fondrej. The project is referenced here solely as an integration example.
GitHub: github.com/josefondrej/api-watchdog

Adaptive Runtime is not a monitoring tool. It is not a watchdog. It is a runtime intelligence layer that can be added to monitoring tools like API Watchdog — without changing any of their existing logic.

API Watchdog continuously monitors endpoints. Failures produce runtime events:

API Watchdog
      │
      ▼
API Failure Event
(timeout / degraded_service / anomaly_detected / recovery_needed)
      │
      ▼
Adaptive Runtime
      │
 ├─ Context Engine
 ├─ Confidence Engine
 ├─ Decision Engine
 ├─ State Engine
 └─ Recovery Engine
      │
      ▼
Runtime Action

Here is what the original API Watchdog loop looks like:

Before

while True:
    config = Config.from_file(config_file_path)

    for api_test_case in config.api_test_cases:
        api_test_case_record = run_api_test_case(api_test_case)
        database.insert_api_test_case_record(api_test_case_record)

        if api_test_case_record.result.status != PASSED:
            logger.error(...)

After

runtime = Runtime(agent_id="api-watchdog")
await runtime.start()

while True:
    config = Config.from_file(config_file_path)

    for api_test_case in config.api_test_cases:
        api_test_case_record = run_api_test_case(api_test_case)
        database.insert_api_test_case_record(api_test_case_record)

        if api_test_case_record.result.status != PASSED:

            result = await runtime.process({
                "type": "timeout",
                "severity": 0.72,
                "latency_ms": 4200
            })

            logger.error(
                f"Decision={result.action} "
                f"Confidence={result.confidence:.2f}"
            )

Notice what did not change:

  • API Watchdog still performs API testing
  • API Watchdog still stores results
  • API Watchdog still controls monitoring logic

Adaptive Runtime only:

  • analyzes runtime context
  • calculates confidence
  • selects recovery actions
  • persists runtime state
  • records event history

The application remains the same. The runtime becomes smarter.

Runtime output for a timeout event:

Context:     degraded_network
Confidence:  0.68
Decision:    cache_warmup
Priority:    normal

Where Adaptive Runtime Adds Value

API Monitoring Platforms

Examples: API Watchdog, uptime monitoring, health-check services, synthetic monitoring.

Adaptive Runtime adds:

  • confidence scoring on failure events
  • contextual failure classification (timeout vs degradation vs anomaly)
  • checkpoint recovery after crashes
  • runtime observability across long monitoring sessions

Long-Running Services

Examples: customer support systems, AI workers, automation daemons.

Adaptive Runtime adds:

  • persistence across restarts
  • event history for replay and debugging
  • recovery workflows that resume automatically after failure

Edge and Infrastructure Systems

Examples: Raspberry Pi monitoring, edge gateways, industrial monitoring nodes.

Adaptive Runtime adds:

  • lightweight resilience with no GPU or cloud dependency
  • SQLite persistence with minimal memory footprint
  • recovery after unexpected interruption or power loss

Example Included

See examples/agent_demo.py for a complete walkthrough of the Adaptive Runtime lifecycle.

Events enter the runtime. The Context Engine analyzes conditions. The Confidence Engine calculates certainty. The Decision Engine selects an action. The State Engine persists runtime state. The Recovery Engine manages checkpoints.

service_overload  → throttle_requests
anomaly_detected  → flag_for_review
timeout           → cache_warmup
degraded_service  → health_check
recovery_needed   → run_recovery

In a production system such as API Watchdog, these events would originate from real monitoring data rather than a demo event list.


When Should I Use Adaptive Runtime?

Use Adaptive Runtime if:

  • your application runs for hours or days
  • you need runtime resilience
  • you need checkpointing
  • you need state persistence
  • you need recovery workflows
  • you need confidence-aware decisions
  • you need runtime observability
  • you need contextual runtime behavior

Do not use Adaptive Runtime if:

  • your script runs once and exits
  • you only need automation scripts
  • you only need API calls
  • you only need lightweight workflows

For those scenarios, ALGOgent Runtime is usually the better choice.


How Adaptive Runtime Differs from LLM Frameworks

LLM frameworks focus on model orchestration — prompt chains, RAG pipelines, agent loops.

Adaptive Runtime focuses on a different layer entirely: runtime behavior, state persistence, recovery, and operational resilience. It does not use a language model internally. It does not require one to function.

LLM Frameworks Adaptive Runtime
Purpose Model orchestration Runtime behavior
Core abstraction Prompt chains Stateful events
Intelligence source Language model Probabilistic rule engine
Dependencies Heavy (model SDKs, tokenizers) Minimal (pydantic, aiosqlite)
GPU required Sometimes Never
Crash recovery ✅ Built-in
State persistence External setup required ✅ Built-in SQLite
Confidence scoring ✅ Adaptive
Runs on $5 VPS Rarely ✅ Designed for it
Use case Chat, RAG, agents Runtime resilience

They solve different layers of the stack and can be used together. Adaptive Runtime does not replace LLM frameworks — it handles the operational layer they leave unaddressed.


Runtime Philosophy

Most AI problems in production are not model problems.
They are runtime problems.

Adaptive Runtime is built around the belief that future AI systems need:

  • Memory — state that survives crashes and restarts
  • Resilience — self-healing with checkpoints and retry logic
  • Contextual behavior — decisions that adapt to real conditions
  • Confidence awareness — knowing how certain a decision is
  • Lightweight cognition — intelligence without neural dependency

Not just prompts. Not just workflows. Runtime intelligence.


The 5 Core Engines

1. State Engine

Persistent agent memory. Survives crashes. SQLite by default.

await state_engine.save_state({"health": "ok", "version": "1.2"})
state = await state_engine.load_state()          # Restored after restart
await state_engine.patch_state({"last": "ok"})   # Partial update

2. Context Engine

Transforms raw signals into contextual understanding — no ML needed.

ctx = context_engine.analyze({
    "type": "service_overload", "cpu": 94, "memory": 88, "severity": 0.82
})
# → risk="high", stability="low", context="resource_pressure", pressure=0.65

3. Confidence Engine

Adaptive probabilistic scoring with historical weighting and decay.

conf = confidence_engine.calculate(event, context_risk="high")
# → conf.final = 0.7831  (lower when risk is high, adapts from history)

confidence_engine.record_outcome(success=True, confidence=0.78, context_risk="high")

4. Decision Engine

Explainable rule-based action selection. Extensible with custom rules.

decision = decision_engine.decide(event, "resource_pressure", "high", 0.78)
# → action="restart_service", reason="high_resource_pressure", priority="high"

# Add your own rules:
custom_rules = [("my_context", "high", 0.70, "my_action", "my_reason")]
engine = DecisionEngine(custom_rules=custom_rules)

5. Recovery Engine

Crash recovery, checkpoint snapshots, exponential back-off retry.

await recovery_engine.create_checkpoint(state)    # Save checkpoint
state = await recovery_engine.restore_latest()    # Restore after crash
result = await recovery_engine.retry(fn, fallback=fallback_fn)  # Retry with back-off

Designed for Constrained Environments

✅ Raspberry Pi
✅ $5 VPS (512MB RAM)  
✅ Old laptop
✅ Edge devices
✅ Offline / air-gapped systems
✅ Serverless (cold start friendly)

No GPU. No cloud lock-in. No heavy ML frameworks.
Just Python + asyncio + SQLite.


Project Structure

adaptive_runtime/
│
├── core/
│   ├── __init__.py
│   ├── confidence_engine.py  # Adaptive probabilistic confidence
│   ├── context_engine.py     # Event → contextual classification
│   ├── decision_engine.py    # Rule-based action selection
│   ├── recovery_engine.py    # Crash recovery + retry orchestration
│   └── state_engine.py       # State persistence and memory
│
├── observability/
│   ├── __init__.py
│   ├── logger.py             # Structured color logger
│   └── metrics.py            # Lightweight in-memory metrics
│
├── runtime/
│   ├── __init__.py
│   ├── benchmark.py          # Performance benchmarking
│   ├── cache.py              # TTL-based in-memory cache
│   ├── event_bus.py          # Async pub/sub event bus
│   └── runtime_manager.py    # Main orchestrator (Runtime class)
│
├── storage/
│   ├── __init__.py
│   ├── memory_store.py       # In-process ephemeral store (testing)
│   └── sqlite_store.py       # Async SQLite persistence
│
└── __init__.py
│
examples/
├── agent_demo.py             # Basic event processing
├── automation_demo.py        # Retry + crash recovery
├── demo.yml                  # Demo configuration
├── demo_record.py            # Demo record helper
└── monitoring_demo.py        # Continuous monitoring + event bus
│
tests/
├── __init__.py
└── test_engines.py           # 12 unit tests — all engines

Run the Examples

# Clone
git clone https://github.com/stateflow-dev/adaptive-runtime.git
cd adaptive-runtime

# Install
pip install -e .

# Run demos
python examples/agent_demo.py
python examples/monitoring_demo.py
python examples/automation_demo.py

# Run tests
pip install pytest pytest-asyncio
pytest tests/ -v
# → 12 passed

Roadmap

Feature Status
5 Core Engines Tier 1 — Released
SQLite + Memory store Tier 1 — Released
Async event bus Tier 1 — Released
Retry + crash recovery Tier 1 — Released
🔜 REST API adapter (FastAPI) Tier 2
🔜 Multi-agent orchestration Tier 2
🔜 Plugin system Tier 2
🔜 Real-time dashboard Tier 2
🔜 Distributed runtime Tier 3

Benchmarks

Measured on a mid-range Windows laptop (Python 3.11, SQLite, no GPU).

Metric Result
Cold start ~0 ms (warm import)
Idle memory 30 MB
CPU idle usage <0%
SQLite save latency 81.3 ms avg (n=50)
SQLite load latency 2.7 ms avg (n=50)
Event processing 197.6 ms avg (n=50)
GPU required ❌ Never

Runs comfortably on a $5 VPS (512MB RAM). No GPU. No cloud lock-in.


Stateflow Labs Ecosystem

Adaptive Runtime is part of the Stateflow Labs runtime intelligence ecosystem.

🌐 https://stateflow-dev.github.io/stateflowlabs/

Related Project: ALGOgent Runtime

The two projects are often confused. Here is the clearest way to think about them:

ALGOgent Runtime Adaptive Runtime
Best for Scripts, automation, task execution Long-running services, stateful systems
Runtime model Run once, exit cleanly Runs for hours or days without stopping
State Lightweight, per-run Persistent across restarts and crashes
Recovery Basic retry Full checkpoint + restore workflows
Decisions Task-driven Context-aware, confidence-scored
Core abstraction Task / workflow Runtime event
Typical use AI pipelines, tool execution, automation Monitoring daemons, AI workers, edge systems

Rule of thumb:

  • Your script runs once and exits → ALGOgent Runtime
  • Your service runs continuously and must survive failure → Adaptive Runtime

Neither project is positioned as AGI, autonomous AI, or chatbot infrastructure. Both are runtime tools — reliable, observable, and production-ready.


Keywords

Adaptive Runtime is a Python runtime framework for:

  • stateful services and long-running daemons
  • fault-tolerant systems and resilience engineering
  • event-driven applications and runtime event processing
  • recovery-oriented architectures and checkpoint management
  • runtime resilience and operational observability
  • edge computing workloads and constrained environments
  • confidence-aware decision systems without ML dependencies

Contributing

Issues and PRs welcome. Please open an issue first for major changes.


License

MIT © Stateflow Labs


"The biggest AI problems in production are not model problems.
They are runtime problems."