Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

ovos-agentic-loop

PyPI License Python

Agent-loop ChatEngine plugins for OVOS. Implements seven agentic reasoning patterns (ReAct, Plan-and-Execute, Reflexion, Self-Ask, Chain-of-Thought, CRITIC, Tree-of-Thoughts), five built-in toolboxes, SKILL.md integration, and AGENTS.md context management — all as standard OPM plugins.


Features

  • 7 loop architectures — from simple Chain-of-Thought to full Reflexion and Tree-of-Thoughts beam search
  • 5 built-in toolboxes — filesystem, shell, web search, clock, math (calculator + unit conversion + statistics)
  • SKILL.md toolbox — turns any installed SKILL.md file into an agent tool
  • AGENTS.md context manager — loads structured system prompts from AGENTS.md files at runtime
  • No LLM bundled — wire any OPM ChatEngine as the inner brain
  • No persona bundled — compose your own persona using the provided primitives

Installation

pip install ovos-agentic-loop

# Optional: web search support
pip install 'ovos-agentic-loop[web]'

Quick Start

Minimal ReAct agent with a calculator

from ovos_agentic_loop.react import ReActLoopEngine
from ovos_agentic_loop.tools.math import MathToolBox
from ovos_plugin_manager.templates.agents import AgentMessage, MessageRole

# Wire a local LLM as the brain (any OPM ChatEngine works)
engine = ReActLoopEngine({
    "brain": "ovos-chat-openai-plugin",
    "ovos-chat-openai-plugin": {
        "api_url": "http://localhost:11434/v1/chat/completions",
    },
    "max_iterations": 8,
})
engine.load_toolboxes([MathToolBox()])

response = engine.continue_chat([
    AgentMessage(role=MessageRole.USER, content="What is 17 * 23 + sqrt(144)?")
])
print(response.content)

Persona JSON (all-in-one config)

{
  "name": "MyAgent",
  "solvers": ["ovos-react-loop"],
  "ovos-react-loop": {
    "brain": "ovos-chat-openai-plugin",
    "ovos-chat-openai-plugin": {
      "api_url": "http://localhost:11434/v1/chat/completions"
    },
    "toolboxes": ["ovos-math-tools", "ovos-web-search-tools", "ovos-clock-tools"],
    "max_iterations": 10
  }
}

Loop Architectures

Entry point Class Best for
ovos-react-loop ReActLoopEngine General tool-using Q&A
ovos-plan-execute-loop PlanAndExecuteEngine Multi-step tasks requiring a plan
ovos-reflexion-loop ReflexionEngine Tasks requiring self-critique and retry
ovos-self-ask-loop SelfAskEngine Compositional questions needing sub-questions
ovos-chain-of-thought-loop ChainOfThoughtEngine Reasoning without tools (math, logic)
ovos-critic-loop CRITICEngine Factual tasks requiring claim verification
ovos-tree-of-thoughts-loop TreeOfThoughtsEngine Exploration-heavy problems (beam search)

Built-in Toolboxes

Entry point Class Tools
ovos-math-tools MathToolBox evaluate_expression, unit_convert, statistics_summary, solve_equation
ovos-filesystem-tools FileSystemToolBox read_file, write_file, list_directory, search_in_files, find_files
ovos-shell-tools ShellToolBox run_command (disabled by default; set allow_shell: true to enable)
ovos-web-search-tools WebSearchToolBox web_search (requires ovos-agentic-loop[web])
ovos-clock-tools ClockToolBox get_current_datetime
ovos-skill-md-toolbox SkillMDToolBox One tool per installed SKILL.md

SKILL.md Integration

Any package that ships a SKILL.md file is automatically discovered and exposed as an agent tool:

---
name: my-skill
description: Does something useful.
---
You are a helpful assistant specialised in...

The tool name is the slugified name field; the SKILL.md body becomes the system prompt for a sub-LLM call.


AGENTS.md Context Management

AgentsMDContextManager assembles system prompts from AGENTS.md files at runtime — the same files Claude Code reads at dev-time:

from ovos_agentic_loop.context.agents_md import AgentsMDContextManager

ctx = AgentsMDContextManager({
    "agents_md_sources": ["auto"],          # auto-discover from installed packages
    "include_sections": ["Rules", "Style"], # filter to specific headings
})
messages = ctx.build_conversation_context(utterance, session_id="s1")

Security Notes

  • ShellToolBoxallow_shell defaults to False. Only enable with fully-trusted LLMs; the command string is passed directly to /bin/sh.
  • FileSystemToolBox — set root_path to restrict file access to a subtree. Without it, the agent can read any world-readable file.
  • MathToolBox — uses ast.parse with an allowlist; eval() is never called.

Documentation


License

Apache 2.0 — see LICENSE.

Credits

Developed by TigreGotico for OpenVoiceOS.

Funded by NGI0 Commons Fund / NLnet under grant agreement No 101135429, through the European Commission's Next Generation Internet programme.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ovos_agentic_loop-0.2.2a1.tar.gz (72.8 kB view details)

Uploaded Source

Built Distribution

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

ovos_agentic_loop-0.2.2a1-py3-none-any.whl (70.3 kB view details)

Uploaded Python 3

File details

Details for the file ovos_agentic_loop-0.2.2a1.tar.gz.

File metadata

  • Download URL: ovos_agentic_loop-0.2.2a1.tar.gz
  • Upload date:
  • Size: 72.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for ovos_agentic_loop-0.2.2a1.tar.gz
Algorithm Hash digest
SHA256 ad7828774bc8e98dc3c6db162061cb9bc0053ac9fe96b475f56b20c85d8ba66a
MD5 90b1a87ff9681f96b5f55737263c154a
BLAKE2b-256 016c649d8638ea142072264ab36af52d1dff832a0b05e05422a8a33fa9c68993

See more details on using hashes here.

File details

Details for the file ovos_agentic_loop-0.2.2a1-py3-none-any.whl.

File metadata

File hashes

Hashes for ovos_agentic_loop-0.2.2a1-py3-none-any.whl
Algorithm Hash digest
SHA256 a38ac2aacb7596221b30e386c9739eef30a4ddc9f68408fb77f29aea67eef00f
MD5 57f3c9945fa27ed86917aeb9cdbacd7f
BLAKE2b-256 dbbe07b58d09ad0b7a3feffd045c1028a75495bb75c22e744b1004fc7cdc5d36

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 Sentry Error logging StatusPage Status page