CleverActors — pure Python library for declarative actor definitions: YAML schema, Jinja2 preprocessing, validation, and LangGraph compilation. Extracted from cleveragents-core.
  • Python 81%
  • Gherkin 16.5%
  • RobotFramework 2.2%
  • Shell 0.3%
Find a file
Luis Mendes e8d41cc200
Some checks failed
CI / lint (pull_request) Successful in 1m29s
CI / typecheck (pull_request) Successful in 1m58s
CI / security (pull_request) Successful in 1m49s
CI / quality (pull_request) Successful in 2m12s
CI / build (pull_request) Successful in 2m18s
CI / integration_tests (pull_request) Successful in 3m41s
CI / unit_tests (pull_request) Successful in 6m32s
CI / coverage (pull_request) Failing after 13m0s
CI / benchmark (pull_request) Failing after 19m42s
CI / status-check (pull_request) Failing after 6s
CI / lint (push) Failing after 1m13s
CI / typecheck (push) Failing after 1m42s
CI / security (push) Failing after 1m34s
CI / quality (push) Failing after 1m42s
CI / unit_tests (push) Failing after 1m42s
CI / coverage (push) Has been skipped
CI / integration_tests (push) Failing after 1m47s
CI / benchmark (push) Failing after 2m31s
CI / build (push) Failing after 2m36s
CI / status-check (push) Failing after 13s
test(registry): add failing regression for prefix-vs-type-name resolve path (#131)
_RegistryReferenceStrategy in reference_resolver.py maps a package_type
through _TEMPLATE_TYPE_TO_PACKAGE_TYPE (e.g. "agent" -> "agt") before
calling RegistryClient.resolve_package, so a registry reference resolved
via PackageContentResolver.resolve(ref, package_type="agent") (as used by
AgentReferenceResolver, ADR-2037) requests GET /agt/{ns}/{name} instead of
GET /agent/{ns}/{name}. Per the Package Registry Standard §8.2.2, the
{package_type} URL segment is the full type name, not the pkg_agt_-style
Package ID prefix defined in §3.2 — a compliant registry answers 404 for
/agt/....

Adds a new scenario to features/registry_http_client.feature (extending
the existing shared registry_http_client_steps.py rather than a new step
file) that drives PackageContentResolver.resolve() for an "agent" registry
reference against a mocked httpx transport and asserts the requested path
is "/agent/acme/assistant", not "/agt/acme/assistant". Confirmed locally
that the assertion fails with AssertionError when @tdd_expected_fail is
removed, proving the bug is genuinely reproduced; with the tag present,
TddExpectedFailPolicy inverts the failure so nox -s unit_tests stays green.

ISSUES CLOSED: #132
2026-08-10 17:55:36 +00:00
.gitea/workflows fix(ci): make benchmark_regression job fast and correctly fail on regressions 2026-07-31 14:12:50 +00:00
benchmarks # This is a combination of 4 commits. 2026-08-07 16:56:18 +01:00
docs feat(application): support credential injection in ReactiveCleverAgentsApp 2026-08-10 11:32:52 +01:00
features test(registry): add failing regression for prefix-vs-type-name resolve path (#131) 2026-08-10 17:55:36 +00:00
hooks chore: apply end-of-file and trailing-whitespace fixes to config files 2026-05-27 21:41:39 +00:00
robot feat(agents): resolve agent- and route-type registry package references in agents.<name> and routes.<name> 2026-08-10 10:57:02 +01:00
scripts chore: Base repo structure commit 2026-05-26 21:45:54 +01:00
src/cleveractors feat(application): support credential injection in ReactiveCleverAgentsApp 2026-08-10 11:32:52 +01:00
tests fix(agents): restrict inline-code sandbox to a json-only __import__ 2026-08-07 14:24:18 +00:00
.bumpversion.cfg chore: Update some repo configurations and documents 2026-05-26 22:12:25 +01:00
.copier-answers.base-oss.yml chore: Update some repo configurations and documents 2026-05-26 22:12:25 +01:00
.copier-answers.base-python.yml chore: Update some repo configurations and documents 2026-05-26 22:12:25 +01:00
.editorconfig chore: Update some repo configurations and documents 2026-05-26 22:12:25 +01:00
.gitignore feat(registry): implement RegistryCache with LRU eviction and TTL 2026-06-11 19:26:04 +01:00
.pre-commit-config.yaml chore: fix pre-commit hooks — update paths and lint/format issues 2026-05-27 21:27:36 +00:00
.semgrep.yml chore: Update some repo configurations and documents 2026-05-26 22:12:25 +01:00
asv.conf.json fix(ci): make benchmark_regression job fast and correctly fail on regressions 2026-07-31 14:12:50 +00:00
ATTRIBUTIONS.md chore: Update some repo configurations and documents 2026-05-26 22:12:25 +01:00
behave.ini chore: Base repo structure commit 2026-05-26 21:45:54 +01:00
CHANGELOG.md feat(application): support credential injection in ReactiveCleverAgentsApp 2026-08-10 11:32:52 +01:00
CODE_OF_CONDUCT.md chore: Update some repo configurations and documents 2026-05-26 22:12:25 +01:00
CONTRIBUTING.md chore: apply end-of-file and trailing-whitespace fixes to config files 2026-05-27 21:41:39 +00:00
CONTRIBUTORS.md feat(merge_configs): expose public merge_configs(*dicts) API per §3.1 deep-merge algorithm 2026-06-03 14:44:18 +00:00
LICENSE chore: Base repo structure commit 2026-05-26 21:45:54 +01:00
mkdocs.yml feat(llm): route reasoning models to reasoning-aware provider clients 2026-08-05 22:00:08 +00:00
NOTICE chore: Update some repo configurations and documents 2026-05-26 22:12:25 +01:00
noxfile.py fix(ci): make benchmark_regression job fast and correctly fail on regressions 2026-07-31 14:12:50 +00:00
pyproject.toml feat(llm): route reasoning models to reasoning-aware provider clients 2026-08-05 22:00:08 +00:00
pyrightconfig.json chore: apply end-of-file and trailing-whitespace fixes to config files 2026-05-27 21:41:39 +00:00
README.md feat(application): support credential injection in ReactiveCleverAgentsApp 2026-08-10 11:32:52 +01:00
SECURITY.md chore: Base repo structure commit 2026-05-26 21:45:54 +01:00
vulture_whitelist.py feat(registry): implement ReferenceResolver with version alias resolution 2026-06-10 12:04:00 +01:00

CleverActors

CleverActors is the reactive agent framework used by CleverAgents and CleverRouter.

It provides a Python library that lets a host application:

  • Parse CleverAgents v2 YAML configuration files (with Jinja2 templates and ${ENV_VAR} interpolation).
  • Validate configuration against the built-in schema validator.
  • Create reactive agent networks with RxPy streams, LangGraph graphs, or hybrid pipelines of both.
  • Run single-shot prompts, interactive CLI sessions, or stream-based processing via the ReactiveCleverAgentsApp orchestrator.

Install

pip install "cleveractors @ git+https://git.cleverthis.com/cleverlibre/cleveractors@master"

Quick start

from cleveractors import ReactiveCleverAgentsApp

app = ReactiveCleverAgentsApp(config_files=["config.yaml"])
result = await app.run_single_shot("Hello, agents!")
print(result)

For an agent using a non-native provider (anything outside openai/ anthropic/google, e.g. openai_compatible pointed at a custom base_url), supply credentials so the provider resolves without relying on environment variables:

app = ReactiveCleverAgentsApp(
    config_files=["config.yaml"],
    credentials={"openai_compatible": {"api_key": "...", "base_url": "https://..."}},
)

Using agents directly

from cleveractors import Agent
from cleveractors.agents.llm import LLMAgent

agent = LLMAgent(
    name="assistant",
    config={"provider": "openai", "model": "gpt-4o", "system_prompt": "Be helpful."},
)
response = await agent.process_message("What is 2+2?")
print(response)

LangGraph workflows

from cleveractors.langgraph import LangGraph, Node, NodeType, GraphState

graph = LangGraph(name="my_workflow", config={})
graph.add_node(Node(name="start", node_type=NodeType.AGENT, agent="assistant"))
graph.add_node(Node(name="end", node_type=NodeType.END))
graph.add_edge("start", "end")
result = await graph.execute({"message": "Hello"})

Reactive stream routing

from cleveractors.reactive.stream_router import ReactiveStreamRouter, StreamType

router = ReactiveStreamRouter()
stream = router.create_stream({"name": "pipeline", "type": StreamType.HOT})
router.send_message("pipeline", "Process this message")

Package structure

Module Purpose
cleveractors Top-level exports: Agent, ContextManager, ReactiveCleverAgentsApp, CleverAgentsException
cleveractors.agents Agent implementations: LLMAgent, ToolAgent, CompositeAgent, ChainAgent, AgentFactory
cleveractors.core Core framework: ReactiveCleverAgentsApp, ConfigurationManager, ProgressBarManager, exceptions
cleveractors.langgraph LangGraph integration: LangGraph, PureLangGraph, Node, GraphState, StateManager, RxPyLangGraphBridge
cleveractors.reactive RxPy streams: ReactiveStreamRouter, StreamMessage, RouteConfig, ReactiveConfigParser
cleveractors.templates Jinja2+YAML template system: BaseTemplate, TemplateRegistry, AgentTemplate, GraphTemplate, StreamTemplate

Key exports

from cleveractors import Agent, ContextManager, ReactiveCleverAgentsApp, CleverAgentsException
from cleveractors.core.exceptions import ConfigurationError, TemplateError, RoutingError, ExecutionError
from cleveractors.core.config import ConfigurationManager
from cleveractors.agents.factory import AgentFactory
from cleveractors.langgraph import LangGraph, Node, NodeType, GraphState, StateManager
from cleveractors.langgraph.pure_graph import PureLangGraph, create_pure_langgraph
from cleveractors.reactive.stream_router import ReactiveStreamRouter, StreamType, StreamMessage
from cleveractors.templates import BaseTemplate, TemplateType, TemplateParameter, TemplateRegistry

License

MIT — see LICENSE.

See also CleverAgents Operations Code (CONTRIBUTING) for commit, PR, and testing conventions.