executing-plans
executing-plans
Use when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available
agent-orchestrationInitialize, configure, and safely exercise the MedRAX LangGraph agent with a selected tool registry, prompt sections, OpenAI-compatible chat model, checkpointed threads, and tool-call logs.
Independent GitHub snapshot · Automated classification · Original documentation governs
Use this skill when a Researcher needs the MedRAX control plane rather than the
implementation details of a particular chest-X-ray model. It covers building an
Agent, selecting tools without accidentally loading optional weights, choosing
an OpenAI-compatible endpoint, loading the medical system prompt, invoking a
checkpointed thread, and inspecting tool-call logs.
Do not use this skill to explain a model's input/output semantics. Route those
questions to chest-xray-analysis. Route DICOM and visualization work to
image-data-utilities, UI/demo launch to web-interface, and benchmark cases
or metrics to benchmark-evaluation.
resources/system_prompts.txt is a portable template; do not require
a source checkout or hard-coded checkout path.python scripts/check_medrax_import.py --project-root ..
It parses signatures and performs only lightweight imports; it does not create
a ChatOpenAI, initialize a tool, download weights, or make a network call.[MEDICAL_ASSISTANT] (or choose
another explicit section) and a writable temp_dir if a selected utility
needs temporary files.tools_to_use list. The exact registry in
main.initialize_agent is documented in api-reference.md.
Start with ImageVisualizerTool and DicomProcessorTool for orchestration
smoke tests; add model-backed tools only after their own sibling skill and
backend are ready.openai_kwargs from the process environment. Pass api_key and,
when needed, base_url; never print either value. A local OpenAI-compatible
service commonly uses OPENAI_BASE_URL=http://localhost:11434/v1 and a
provider-specific placeholder key. See workflows.md.scripts/medrax_agent_factory.py function
build_agent(prompt_file, tools_to_use=..., model_dir=..., temp_dir=..., device=..., model=..., temperature=..., top_p=..., openai_kwargs=...);
it returns (agent, tools_dict) and refuses an implicit all-tools selection.
When integrating with the original application, the equivalent
main.initialize_agent signature is recorded in api-reference.md.agent.workflow.invoke({"messages": [HumanMessage(content="...")]}, {"configurable": {"thread_id": "smoke-001"}}).
Keep the same thread_id to continue a conversation; use a new one for an
isolated run. Exact invocation and fake-model examples are in the workflow
reference.tools_to_use=None selects every registered tool. In this implementation,
an empty list is also replaced by every tool because selection uses
tools_to_use or all_tools.keys(); use a non-empty explicit list when
excluding model-backed tools.initialize_agent. Compare
set(requested) - set(tools_dict) after initialization and fail closed in a
wrapper if any were omitted.LlavaMedTool, XRayPhraseGroundingTool,
ChestXRayGeneratorTool, XRayVQATool, ChestXRayReportGeneratorTool, or
other weight-backed tools merely to test graph wiring. Their constructors may
download or load large models. The two utility tools are the safe default.Agent binds every constructed tool through model.bind_tools(tools). A
model that cannot bind LangChain tool schemas is not a compatible backend.MemorySaver() as the in-memory checkpointer for a process-local test.
It is not a durable or multi-process store; do not present it as persistence.Agent stores messages as an append-only AgentState field. The compiled
LangGraph starts at process, invokes the bound model, routes to execute if
the last response has tool calls, executes each call by registered name, then
returns to process. An unknown call name yields a ToolMessage containing
invalid tool, please retry; it is not executed. A response with no tool calls
ends the graph.
With log_tools=True (the initialize_agent default), log_dir defaults to
logs; the agent creates that directory and writes timestamped
tool_calls_YYYYMMDD_HHMMSS.json files containing tool_call_id, name,
args, content, and an ISO timestamp. Set log_tools=False for a no-log
synthetic test. Ensure log_dir exists or its parent is writable; avoid
sensitive arguments in logs and treat log files as sensitive operational data.
For API details, tool registry entries, prompt parsing, and failure recovery,
use the linked references rather than guessing parameter names. For a
source-independent construction path, import build_agent from
scripts/medrax_agent_factory.py; importing that module alone performs no model,
tool, or network operation. Its command-line default only prints safe help.