What are Hooks?
Hooks are capabilities the AI model can call from within a chain. Instead of limiting the model to text generation, hooks let it take actions: read files, run scripts, query databases, or call external APIs.

Hook Types
Contenox supports three types of hooks:
local_shell— Execute bash commands on the host machine.local_fs— Read and write files to the local filesystem.- Remote Hooks — Any external HTTP service that exposes an OpenAPI v3 spec.
How the model uses them
In your chain JSON, you specify which hooks are available to the task:
json
"execute_config": {
"model": "qwen2.5:7b",
"provider": "ollama",
"hooks": ["nws", "local_shell"]
}Behind the scenes:
- The engine fetches the tools from those hooks (reading the local definitions or the remote
/openapi.json). - It translates them into OpenAI-compatible tool schemas.
- It passes them to the model alongside your prompt.
- If the model chooses to call a tool, your chain's
execute_tool_callstask runs it and feeds the result back.
Adding Custom Capabilities
The easiest way to add custom capabilities to your agent is to write a small HTTP service (e.g. in Python FastAPI or Express) that serves an OpenAPI spec, then register it as a Remote Hook. See Remote Hooks for a full example.
