make_openai_tools wraps a CodebaseMemory instance and an optional ImportGraph in @function_tool-decorated callables for the openai-agents SDK. Pass the returned list directly to Agent(tools=[...]).
Installation
make_openai_tools
@function_tool-decorated callables (recall_findings, store_finding, impact_analysis) depending on which arguments and flags you provide.
Parameters
CodebaseMemory | None
default:"None"
The
CodebaseMemory instance the tools read from and write to. When None, both recall_findings and store_finding are omitted regardless of the enable flags.ImportGraph | None
default:"None"
Optional
ImportGraph. When provided and enable_impact=True, an impact_analysis tool is added.int
default:"5"
Maximum number of findings per
recall_findings call.float
default:"0.25"
Minimum similarity score for recall results.
bool
default:"true"
Include
recall_findings. Has no effect when memory is None.bool
default:"true"
Include
store_finding. Has no effect when memory is None.bool
default:"true"
Include
impact_analysis when a graph is provided.Returns
list
A list of
@function_tool-decorated callables. Spread into the Agent tool list: tools=[*rb_tools, *your_tools].Tools
recall_findings(query)
Searches CodebaseMemory and returns the formatted recall string.
store_finding(content, file_path, finding_type)
Persists a finding. Returns "stored (id=<fid>)" on success or "store failed" on transport error.
impact_analysis(file_path)
Calls ImportGraph.format_impact() and returns the rendered string.
impact_analysis is only present when you pass a non-None graph and enable_impact=True. Check len(rb_tools) rather than assuming a fixed index if you build the list conditionally.Complete example
Telemetry: openai_hooks
make_openai_tools handles tool wiring only. Run telemetry — run_start, per-step events, and run_finish — is provided separately by rb.openai_hooks(), which returns a RunHooks adapter you pass to Runner.run(hooks=...).
For the full openai_hooks reference and lifecycle details, see the OpenAI Agents integration guide.
