Skip to main content

Directed-graph Agent Orchestration Engine

Project description

AgenArc

Directed-Graph Agent Orchestration Engine

PyPI - Version Python License Tests Coverage


Philosophy

"Mechanism and Strategy Separation"

Layer Role
Kernel Ultra-stable scheduler — secure execution, resource validation, VFS sandbox
Self-repair Built by users within the graph flow — evolve agents without touching the engine
Asset boundary agrc:// virtual protocol — files, scripts, and prompts live in isolated bundles

Architecture

 ┌──────────────────────────────────────────────────────────┐
 │                      AgenArc v0.5                        │
 ├──────────────────────────────────────────────────────────┤
 │                                                           │
 │  ┌──────────┐    ┌──────────┐    ┌──────────────────┐    │
 │  │ Protocol │───▶│  Engine  │───▶│  Visualization   │    │
 │  │   (DSL)  │    │ (Runtime)│    │   (Web IDE)      │    │
 │  └──────────┘    └──────────┘    └──────────────────┘    │
 │        │               │                  │               │
 │  ┌─────▼─────┐  ┌──────▼──────┐  ┌───────▼────────┐     │
 │  │JSON Schema│  │  Scheduler  │  │  Graph Editor   │     │
 │  │+ Templates│  │  + Router   │  │  + Live Preview │     │
 │  │+ Conditions│ │  + Join     │  │  + Context Panel│     │
 │  └───────────┘  │  + Checkpoint│ │  + Status LEDs  │     │
 │                 │  + Plugins   │  └────────────────┘     │
 │                 └─────────────┘                          │
 └──────────────────────────────────────────────────────────┘

Features

Category Highlights
Execution Linear & parallel & async modes, Router (conditional branching), Join (branch sync), CheckpointManager
LLM Streaming responses, multi-provider fallback, structured error classification
Scripting Script_Node with AST-safe evaluator (3 trust levels), gas & memory limits
Packaging .agrc self-contained bundles — JSON protocol + prompts + scripts + plugins in one ZIP
VFS agrc:// virtual filesystem with rwx permissions, path-traversal protection
Plugins Python / C++ / External loaders, hot-reload (file watching), event plugins
Visualization Web IDE — drag-and-drop graph editor, real-time execution preview, YAML context panel
CLI run / shell / serve / validate / info / pack / visualize

Node Types

Node Description Input → Output
Trigger Entry point payload → graph
LLM_Task LLM inference (streaming + fallback) messagesresponse, usage, error
Router Conditional branching (all matches execute in parallel) input → dynamic output ports
Join Synchronize parallel branches (merge / concat / first) dynamic → output
Memory_I/O Persistent key-value storage (transactional + checkpoint) key, valuevalue, success
Script_Node Inline Python with AST safety (3 trust levels) arbitrary → result
Prompt_Builder Multi-turn conversation history management user / assistantmessages
Log Log and pass-through messagemessage
Context_Set Set global context values key, valuesuccess
Context_Get Read global context values keyvalue
Asset_Reader Read files from bundle via VFS pathcontent, success
Asset_Writer Write files with atomic operations path, contentsuccess
Runtime_Reload Hot reload scripts and plugins at runtime targetsuccess

Quick Start

pip install agenarc
# Run a chat agent
agenarc run examples/my_first_agent.agrc --input '{"payload":"Hello!"}'

# Interactive REPL
agenarc shell examples/my_first_agent.agrc

# Background service with plugins
agenarc serve examples/euchea.agrc

# Web-based graph editor
agenarc visualize examples/my_first_agent.agrc

Examples

Agent Description
my_first_agent.agrc Multi-turn chat — Trigger → Prompt_Builder → LLM_Task
qq_bot_agent.agrc QQ bot with event plugin (serve mode)
euchea.agrc PDF → C++ code generation via Alt+A hotkey (serve mode)

.agrc Bundle

my_agent.agrc/
├── manifest.json          # Metadata, permissions, hot_reload
├── flow.json              # Graph definition (nodes + edges)
├── prompts/
│   └── system.pt          # {{template}} prompt files
├── scripts/
│   └── tool.py            # Custom scripts (optional)
├── plugins/                # Embedded plugins (auto-discovered)
│   └── my_plugin/
│       ├── agenarc.json
│       └── plugin.py
└── assets/                 # Static assets (optional)
Example flow.json
{
  "version": "1.0.0",
  "nodes": [
    { "id": "trigger_1", "type": "Trigger", "label": "Start" },
    {
      "id": "llm_1",
      "type": "LLM_Task",
      "label": "Chat",
      "config": {
        "model": "deepseek-chat",
        "system_prompt": "agrc://prompts/system.pt",
        "stream": true,
        "providers": ["deepseek", "openrouter"]
      }
    },
    { "id": "log_1", "type": "Log", "label": "Output" }
  ],
  "edges": [
    { "source": "trigger_1", "sourcePort": "payload", "target": "llm_1", "targetPort": "messages" },
    { "source": "llm_1", "sourcePort": "response", "target": "log_1", "targetPort": "message" }
  ]
}

Configuration

# ~/.agenarc/config.yaml

providers:
  deepseek:
    api_key: sk-your-key
    base_url: https://api.deepseek.com
    default_model: deepseek-chat
    temperature: 0.7

  openrouter:
    api_key: sk-your-key
    base_url: https://openrouter.ai/api/v1
    default_model: openrouter/free

agent:
  checkpoint_dir: ~/.agenarc
Provider base_url
DeepSeek https://api.deepseek.com
OpenAI https://api.openai.com/v1
OpenRouter https://openrouter.ai/api/v1
Ollama http://localhost:11434/v1

Environment variables override config: AGENARC_OPENAI_API_KEY, AGENARC_OPENAI_BASE_URL, AGENARC_OPENAI_MODEL, AGENARC_ANTHROPIC_API_KEY, AGENARC_ANTHROPIC_MODEL, AGENARC_CHECKPOINT_DIR


Development

agenarc/
├── protocol/           # JSON Schema + protocol loader
├── engine/             # Executor, state manager, AST evaluator
├── operators/          # 13 built-in operators
├── vfs/                # agrc:// virtual filesystem
├── plugins/            # Plugin loader (Python/C++/External)
├── graph/              # Graph data structures + traversal
├── visualization/      # Web IDE server + static frontend
└── cli/                # Command-line interface
# Install dev dependencies
pip install -e ".[dev]"

# Run tests
pytest tests/                          # All (742 passed)
pytest tests/ --cov=agenarc            # With coverage (~62%)
pytest tests/unit/test_builtin_operators.py -v  # Single file

# Lint & type check
ruff check agenarc/
ruff format --check agenarc/
mypy agenarc/

Roadmap

Version Phase Status
v0.1 MVP Engine
v0.2 Execution Engine — Router, Join, Checkpoint
v0.3 Self-Evolution — Bundle, VFS, Hot Reload
v0.4 Plugin System — Python / C++ / External
v0.5 Visualization Platform — Web IDE, Live Preview

Documentation

Document Description
CHANGELOG.md Release history and change log
CONTRIBUTING.md Development setup, PR process, commit style
docs/agents.md User-facing agent creation guide (Chinese)
docs/plugins/README.md Plugin development guide

License

MIT © Rycbartbad

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

agenarc-0.6.1.tar.gz (202.2 kB view details)

Uploaded Source

Built Distribution

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

agenarc-0.6.1-py3-none-any.whl (143.9 kB view details)

Uploaded Python 3

File details

Details for the file agenarc-0.6.1.tar.gz.

File metadata

  • Download URL: agenarc-0.6.1.tar.gz
  • Upload date:
  • Size: 202.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for agenarc-0.6.1.tar.gz
Algorithm Hash digest
SHA256 1f7a280426bceba00cfbfe5bd5e9c39a048ccaebb9f879de79b58d0933a1cc9c
MD5 6a7295bee926c2609e01c62a50c95a0b
BLAKE2b-256 2d1f2b07a72c6b7a5685e7bf7fc3b45683c16075bf7f9ad11651c25d81da7d4f

See more details on using hashes here.

Provenance

The following attestation bundles were made for agenarc-0.6.1.tar.gz:

Publisher: publish.yml on Rycbartbad/AgenArc

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file agenarc-0.6.1-py3-none-any.whl.

File metadata

  • Download URL: agenarc-0.6.1-py3-none-any.whl
  • Upload date:
  • Size: 143.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for agenarc-0.6.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e94afa80a9d52943a75c1303515f03fb743bfb64a143d9970b02e553e2028c62
MD5 6fe8b616dd1eeb55723b28cb9383fbf3
BLAKE2b-256 8a1a59854ef7e9bc5a5f95602608e017c3882c66c8c7f8aaada58d3def89eb38

See more details on using hashes here.

Provenance

The following attestation bundles were made for agenarc-0.6.1-py3-none-any.whl:

Publisher: publish.yml on Rycbartbad/AgenArc

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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