>cogtrix v0.3.0

Agent core

Public Python surface for the agent runtime — the entry point, tool registry, and safety enforcement layer.

Python API note. Imports currently resolve as src.agent.* due to a packaging quirk. A future release will rename the namespace to cogtrix.agent.* (tracked as change request 0001).

src.agent.core

The agent’s main entry point. Builds the LangGraph runtime, loads tools from the registry, applies the active memory mode, and runs the turn loop.

Key callables:

  • run_agent_loop(...) — primary entry for interactive sessions.
  • run_single_turn(...) — single-prompt-then-exit mode, used by --prompt.
  • Agent — the top-level orchestrator class.

Source ↗

src.agent.registry

Loads tools from src/tools/ on startup, registers MCP-server tools at connect time, and exposes the active tool catalogue to the agent.

Key callables:

  • ToolRegistry.register_tool(func, config) — declarative tool registration.
  • ToolRegistry.list_active() — currently-loaded tools.
  • ToolRegistry.activate(name) / deactivate(name) — pin / unpin tools.

Source ↗

src.agent.safety

Tool-confirmation gate. Wraps every sensitive tool with a SafeTool decorator that requires explicit user approval before each invocation. See Tool safety.

Key callables:

  • SafeToolStructuredTool subclass with a requires_confirmation flag.
  • apply_safety_wrappers(tools, approvals) — bulk-wraps tools per the active approval set.

Source ↗