Skip to main content

Agentic Runtime Core (ARC): a production-grade framework for orchestrating AI agents in multi-step workflows.

Project description

Nexus Core

Production-grade framework for orchestrating AI agents in multi-step workflows

License Python 3.11+


What is Nexus Core?

Nexus Core is the Git-native AI orchestration framework. Unlike other frameworks that log agent actions to ephemeral files, Nexus creates permanent, traceable artifacts in your Git platform (GitHub, GitLab, Bitbucket).

Why Git-Native?

Every agent action becomes part of your development history:

  • ๐ŸŽฏ Issues track what was requested and decided
  • ๐Ÿ’ฌ Comments preserve agent reasoning and handoffs
  • ๐Ÿ”€ Pull Requests contain actual code changes
  • โœ… Reviews create approval gates with full context
  • ๐Ÿ“Š Git History provides permanent audit trail

The result: Complete traceability, searchability, and accountability for AI workflows.

Production-Ready Features

  • โœ… Reliability: Auto-retry, timeout detection, graceful failure handling
  • โœ… State Management: Persistent workflow state with audit trails
  • โœ… AI Orchestration: Route work to the best AI tool (Copilot, Gemini, soon Claude and Codex)
  • โœ… Fallback Support: Automatic failover when tools are rate-limited or unavailable
  • โœ… Pluggable Architecture: Bring your own storage, git platform, notification system

Think of it as Temporal meets GitHub Actions for AI agents โ€” workflows that integrate seamlessly with your development process.

๐Ÿ“– Documentation:


Quick Start

Installation

# Coming soon to PyPI!
# pip install nexus-core

# For now, install from source:
git clone https://github.com/Ghabs95/nexus-core
cd nexus-core
pip install -e .

With optional adapters

pip install nexus-core[telegram,postgres,openai]


### Your First Workflow

```python
from nexus.core import WorkflowEngine, YamlWorkflowLoader
from nexus.adapters.storage.file import FileStorage

# Configure storage
storage = FileStorage(base_path="./data")

# Create workflow engine
engine = WorkflowEngine(storage=storage)

# Load workflow definition using the new YAML loader
workflow = YamlWorkflowLoader.load("./workflows/feature_dev.yaml")

# Create and execute
await engine.create_workflow(workflow)
result = await engine.start_workflow(workflow.id)

Define a Workflow (YAML)

name: "Feature Development"
version: "1.0"

steps:
  - name: triage
    agent_type: triage
    prompt: "Analyze this feature request and determine complexity"
    timeout: 300
    retry: 3
    
  - name: design
    agent_type: designer
    prompt: "Create technical design for this feature"
    condition: "triage.complexity == 'high'"
    timeout: 600
    retry: 2
    
  - name: implement
    agent: developer
    prompt: "Implement the feature according to spec"
    timeout: 1800
    retry: 3

Features

๐Ÿ”„ Workflow State Machine

Track multi-step processes with automatic state persistence:

# Workflows can be paused, resumed, or stopped
await engine.pause_workflow(workflow_id)
await engine.resume_workflow(workflow_id)

# Full audit trail
history = await engine.get_audit_log(workflow_id)

๐Ÿค– AI Provider Orchestration

Intelligent routing with automatic fallback:

from nexus.adapters.ai import CopilotCLI, OpenAIProvider, GeminiCLI

orchestrator = AIOrchestrator(
    providers=[
        CopilotCLI(preference="code_generation"),
        AnthropicProvider(preference="reasoning", model="claude-3"), # Coming soon
        GeminiCLI(preference="fast_analysis"),
    ],
    fallback_enabled=True
)

# Automatically picks best provider & falls back if rate-limited
result = await orchestrator.execute(agent="Architect", context=ctx)

๐Ÿ”Œ Pluggable Adapters

Swap any component via configuration:

Storage Backends:

  • FileStorage - JSON files (great for dev)
  • PostgreSQLStorage - Production database
  • RedisStorage - Fast, ephemeral workflows
  • S3Storage - Serverless deployments

Git Platforms:

  • GitHubPlatform - Issues, PRs, comments
  • GitLabPlatform - Issues, MRs, notes
  • BitbucketPlatform - Issues, PRs

Notification Channels:

  • TelegramNotifier - Push notifications to chats
  • SlackNotifier - Thread-based updates
  • EmailNotifier - Digest & alerts
  • WebhookNotifier - Custom integrations

Interactive Clients:

  • TelegramInteractivePlugin - Two-way chat bot polling apps
  • DiscordInteractivePlugin - Two-way chat bot via HTTP app commands

๐Ÿ›ก๏ธ Production-Ready Error Handling

  • Exponential backoff with jitter
  • Configurable retry limits per step
  • Timeout detection & auto-kill
  • User-friendly error messages
  • Dead letter queue for failed workflows

๐Ÿ“Š Monitoring & Metrics

Built-in observability:

from nexus.monitoring import PrometheusExporter

# Export metrics
exporter = PrometheusExporter(port=9090)
engine.add_observer(exporter)

# Track:
# - Workflow success/failure rates
# - Step execution time
# - AI provider latency & costs
# - Retry & timeout counts

Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                  Input Adapters                         โ”‚
โ”‚  (Telegram, Slack, Webhook, CLI, GitHub Issues)         โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                     โ”‚
                     โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                Workflow Engine                       โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚
โ”‚  โ”‚  Step Manager โ†’ State Machine โ†’ Audit Logger  โ”‚  โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
             โ”‚                      โ”‚
    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
    โ”‚ AI Orchestrator โ”‚    โ”‚ Storage Backendโ”‚
    โ”‚  - Provider     โ”‚    โ”‚  - State       โ”‚
    โ”‚    Selection    โ”‚    โ”‚  - Audit Log   โ”‚
    โ”‚  - Retry Logic  โ”‚    โ”‚  - Metrics     โ”‚
    โ”‚  - Fallback     โ”‚    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
             โ”‚
    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
    โ”‚     AI Providers             โ”‚
    โ”‚  (Copilot, Gemini, soon      โ”‚
    โ”‚   Claude & Codex)            โ”‚
    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
             โ”‚
    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
    โ”‚ Output Adapters โ”‚
    โ”‚  (Git Platform, โ”‚
    โ”‚   Notifications)โ”‚
    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Use Cases

Feature Development Workflow

Multi-agent workflow that creates traceable artifacts at each step:

workflow: feature_development
trigger: issue_created (label: feature)
steps:
  - triage: Triage & scope
    โ†’ Adds comment with complexity analysis
  - designer: Technical design
    โ†’ Creates design doc, updates issue
  - code_reviewer: Implementation review
    โ†’ Reviews PR, comments with feedback
  - debug: Root cause analysis (if needed)
    โ†’ Investigates issues, suggests fixes
  - docs: Documentation update
    โ†’ Updates docs based on changes

All agent decisions preserved in GitHub for future reference.

Code Review Automation

AI-powered review with full traceability:

workflow: automated_review
trigger: pull_request_opened
steps:
  - SecurityAgent: Scan for vulnerabilities
    โ†’ Posts review comments on specific lines
  - PerformanceAgent: Check efficiency
    โ†’ Suggests optimizations in PR thread
  - StyleAgent: Enforce standards
    โ†’ Requests changes with explanations

Every suggestion is a PR comment, not lost in logs.

Bug Fix Pipeline

End-to-end bug resolution with audit trail:

workflow: bug_fix
trigger: issue_created (label: bug)
steps:
  - TriageAgent: Assess severity
    โ†’ Labels issue, sets priority
  - DiagnosticAgent: Root cause analysis
    โ†’ Comments with findings
  - FixAgent: Implement solution
    โ†’ Creates PR with fix
  - VerificationAgent: Test fix
    โ†’ Validates and approves PR

Complete history from bug report to fix, all in GitHub.


Examples

See examples/ directory:

  • basic_workflow.py - Simple 3-step workflow
  • github_ci.py - Automated code review on PRs
  • support_router.py - Support ticket classification & routing
  • doc_generator.py - Auto-generate docs from code

Configuration

YAML Config (nexus.yaml)

version: "1.0"

adapters:
  storage:
    type: postgres # options: file, postgres
    storage_config:
      connection_string: ${DATABASE_URL}
      # storage_dir: ./data # required for type: file
  
  git:
    type: github
    repo: yourorg/yourrepo
    token: ${GITHUB_TOKEN}

Environment Variables

# Required
DATABASE_URL=postgresql://user:pass@localhost/nexus
GITHUB_TOKEN=ghp_your_token

# Storage Configuration (Alternative to YAML)
NEXUS_STORAGE_BACKEND=postgres
NEXUS_STORAGE_DSN=postgresql://user:pass@localhost/nexus
NEXUS_STORAGE_DIR=./data

# Optional
NEXUS_LOG_LEVEL=INFO
NEXUS_HEALTH_CHECK_PORT=8080
NEXUS_METRICS_PORT=9090

Development

Setup

git clone https://github.com/Ghabs95/nexus-core
cd nexus-core
python -m venv venv
source venv/bin/activate
pip install -e ".[dev]"

Run Tests

pytest                    # Run all tests
pytest --cov             # With coverage
pytest -k test_workflow  # Specific test

Code Quality

black .         # Format
ruff check .    # Lint
mypy nexus/     # Type check

Roadmap

v0.1 (Current)

  • Core workflow engine
  • File, Postgres, Redis storage
  • GitHub, GitLab git platforms
  • Copilot CLI, Gemini CLI, OpenAI providers
  • Telegram, Slack notifiers

v0.2 (Next)

  • GraphQL API for workflow management
  • Web dashboard for monitoring
  • Workflow versioning & rollback
  • Distributed execution (Celery/RQ)
  • Workflow marketplace

v1.0

  • SLA guarantees
  • Multi-tenancy
  • RBAC & audit compliance
  • Cloud-hosted offering

Contributing

We welcome contributions! See CONTRIBUTING.md for guidelines.

Good first issues:

  • Implement new adapters (Notion, Jira, Slack)
  • Add example workflows
  • Improve documentation
  • Write integration tests

License

Apache License 2.0 - see LICENSE for details.


Support


Acknowledgments

Built with inspiration from:

  • Temporal - Workflow orchestration patterns
  • Langchain - AI tool composition
  • Prefect - Developer experience
  • Original Nexus - Real-world production validation

Star โญ this repo if you find it useful!

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

nexus_arc-0.1.0.tar.gz (243.9 kB view details)

Uploaded Source

Built Distribution

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

nexus_arc-0.1.0-py3-none-any.whl (227.6 kB view details)

Uploaded Python 3

File details

Details for the file nexus_arc-0.1.0.tar.gz.

File metadata

  • Download URL: nexus_arc-0.1.0.tar.gz
  • Upload date:
  • Size: 243.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for nexus_arc-0.1.0.tar.gz
Algorithm Hash digest
SHA256 850a05dede341b699c95e6a0ab1ec606e87b46e1e9e6ca3464b97f9ebce21afb
MD5 c9b699068c8295270b8a672a3f3b3fb0
BLAKE2b-256 43c4b14eb4511c66a897f1969e5b76772f7e1f461b293b8b8d16cc1c417db1f5

See more details on using hashes here.

File details

Details for the file nexus_arc-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: nexus_arc-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 227.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for nexus_arc-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c3089143b401a9a19a9a78d295a1c6173932a59cbabd958314d95f712cd2892f
MD5 9bad2b9ffc5ee60d126d44d2d92b412c
BLAKE2b-256 e5d02e67d6595e01885cf2121e893ec050035ff23959a87d6a60e4f3f60677f2

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