make_langchain_tools wires a CodebaseMemory instance and an optional ImportGraph to a list of LangChain @tool-decorated callables. Pass the returned list directly into create_agent(tools=...) alongside your own tools. The factory shares the memory and graph objects you provide, so a finding stored in one step is available to the next recall in the same run.
Installation
The LangChain integration requireslangchain-core:
make_langchain_tools
@tool callables. The list contains up to three tools (recall_findings, store_finding, impact_analysis) depending on which arguments and flags you provide.
Parameters
The
CodebaseMemory instance the tools read from and write to. When None, both recall_findings and store_finding are omitted from the returned list regardless of enable_recall and enable_store.Optional
ImportGraph for the repository. When provided and enable_impact=True, an impact_analysis tool is added.Maximum number of findings returned by a single
recall_findings call.Minimum similarity score (0–1) a finding must reach to be included in recall results.
Include the
recall_findings tool. Set to False to produce a write-only or impact-only tool set. Has no effect when memory is None.Include the
store_finding tool. Set to False for read-only scenarios. Has no effect when memory is None.Include the
impact_analysis tool when a graph is provided.Returns
A list of LangChain
@tool-decorated callables. Concatenate with your own tool list and pass to create_agent.Tools
recall_findings(query)
Searches CodebaseMemory for findings relevant to query. The tool returns the same string that CodebaseMemory.format_recall() produces.
| Parameter | Type | Description |
|---|---|---|
query | str | Natural-language description of what you are looking for |
store_finding(content, file_path, finding_type)
Persists a finding to CodebaseMemory. Returns "stored (id=<fid>)" on success or "store failed" on transport error.
| Parameter | Type | Default | Description |
|---|---|---|---|
content | str | — | The finding text (truncated to 8000 chars) |
file_path | str | "" | Repo-relative path (truncated to 512 chars) |
finding_type | str | "note" | Short tag — bug, behavior, pattern, note (truncated to 64 chars) |
impact_analysis(file_path)
Calls ImportGraph.format_impact() and returns the rendered string of dependents and dependencies.
| Parameter | Type | Description |
|---|---|---|
file_path | str | Repo-relative path, e.g. "pydantic/main.py" |
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.
