Skip to content

LangGraph runtime: give an agent the File Search stores assigned to it - #362

Merged
antiv merged 1 commit into
mainfrom
langgraph-file-search
Nov 15, 2026
Merged

antiv merged 1 commit into
mainfrom
langgraph-file-search

Conversation

@antiv

@antiv antiv commented Nov 14, 2026

Copy link
Copy Markdown
Owner

Found while re-checking the File Search guide in #361.

The bug

The dashboard's File Search dialog stores an agent's stores in agent_file_search_stores.

  • On ADK, AgentManager adds them to the agent's tool_config when it builds the agent.
  • On LangGraph (AGENT_FRAMEWORK=langgraph), the tools were built from tool_config alone. An agent with stores assigned in the dashboard therefore had no query_file_search tool there.

The fix

Both runtimes now call add_assigned_stores() in shared/utils/tools/file_search_tools.py:

  • The stores assigned to the agent become its file_search entry; other tool_config keys are kept, and the input is not changed in place.
  • With no stores assigned, tool_config is returned unchanged. If the database can't be read, the error is logged as a warning and tool_config is also returned unchanged. Both cases match ADK's behaviour before.
  • agent_manager.py now uses the helper instead of its own inline copy.

Tests

New file shared/test/test_file_search_assigned_stores.py, with 6 tests on a real temporary database:

  • the helper adds the stores, and keeps tool_config as it was with no stores or with a database error;
  • ADK and LangGraph each give an agent with an assigned store query_file_search;
  • neither does without stores.

Mutation check: with the LangGraph call removed, the LangGraph test fails.

The dev database has no assigned stores, and a store needs a real Google project, so this was not run against a live store.

Full suite: 2039 tests, 1 skipped.

Docs

The dashboard's File Search dialog assigns stores in
agent_file_search_stores. AgentManager adds them to the agent's
tool_config when it builds the agent on ADK; the LangGraph runtime built
the tools from tool_config alone, so there an agent with stores assigned
had no query_file_search tool.

Both now go through add_assigned_stores() in file_search_tools.py:
the stores assigned to the agent become its file_search entry, and with
none assigned, or the database unreadable, tool_config is left as it was.
@antiv
antiv merged commit 55fa54b into main Nov 15, 2026
2 checks passed
@antiv
antiv deleted the langgraph-file-search branch November 15, 2026 06:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant