[PR #1774] [MERGED] fix(docs): Use @tool decorator for retriever in agentic RAG tutorial #1844

Closed
opened 2026-02-17 17:22:47 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/langchain-ai/docs/pull/1774
Author: @Shrey327
Created: 12/7/2025
Status: Merged
Merged: 12/8/2025
Merged by: @lnhsingh

Base: mainHead: shrey327/fix-agentic-rag-retriever-tool


📝 Commits (4)

  • 2597c7c fix(docs): Use @tool decorator for retriever in agentic RAG tutorial
  • 864b10f fix(docs): Use @tool decorator for retriever in agentic RAG tutorial
  • a1e1c14 Merge branch 'main' into shrey327/fix-agentic-rag-retriever-tool
  • 86e1ca1 Merge branch 'main' into shrey327/fix-agentic-rag-retriever-tool

📊 Changes

1 file changed (+9 additions, -7 deletions)

View changed files

📝 src/oss/langgraph/agentic-rag.mdx (+9 -7)

📄 Description

Overview

Fixed the agentic RAG tutorial to use the @tool decorator instead of create_retriever_tool. The previous approach caused a TypeError when used with LangGraph's ToolNode because create_retriever_tool returns a functools.partial object, which is incompatible with typing.get_type_hints().

Type of change

Type: Fix typo/bug/link/formatting

Related issues/PRs

  • GitHub issue: N/A
  • Feature PR: N/A

Checklist

  • I have read the contributing guidelines
  • I have tested my changes locally using docs dev
  • All code examples have been tested and work correctly
  • I have used root relative paths for internal links
  • I have updated navigation in src/docs.json if needed

Additional notes

The issue manifests as: TypeError: functools.partial(...) is not a module, class, method, or function during graph compilation/execution. The @tool decorator creates a proper StructuredTool that ToolNode can correctly inspect.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/langchain-ai/docs/pull/1774 **Author:** [@Shrey327](https://github.com/Shrey327) **Created:** 12/7/2025 **Status:** ✅ Merged **Merged:** 12/8/2025 **Merged by:** [@lnhsingh](https://github.com/lnhsingh) **Base:** `main` ← **Head:** `shrey327/fix-agentic-rag-retriever-tool` --- ### 📝 Commits (4) - [`2597c7c`](https://github.com/langchain-ai/docs/commit/2597c7c4235bcd45f2ed4c918ca66530258c7523) fix(docs): Use @tool decorator for retriever in agentic RAG tutorial - [`864b10f`](https://github.com/langchain-ai/docs/commit/864b10ffe0dc464cf319630b023be63378e1fb66) fix(docs): Use @tool decorator for retriever in agentic RAG tutorial - [`a1e1c14`](https://github.com/langchain-ai/docs/commit/a1e1c143ba0ff24d0cb8f3e277d1e0a01e6bcdb9) Merge branch 'main' into shrey327/fix-agentic-rag-retriever-tool - [`86e1ca1`](https://github.com/langchain-ai/docs/commit/86e1ca1d1eec3321d1d8ec9dbe0efdf756b8bf94) Merge branch 'main' into shrey327/fix-agentic-rag-retriever-tool ### 📊 Changes **1 file changed** (+9 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `src/oss/langgraph/agentic-rag.mdx` (+9 -7) </details> ### 📄 Description ## Overview Fixed the agentic RAG tutorial to use the `@tool` decorator instead of `create_retriever_tool`. The previous approach caused a `TypeError` when used with LangGraph's `ToolNode` because `create_retriever_tool` returns a `functools.partial` object, which is incompatible with `typing.get_type_hints()`. ## Type of change **Type:** Fix typo/bug/link/formatting ## Related issues/PRs - GitHub issue: N/A - Feature PR: N/A ## Checklist - [x] I have read the [contributing guidelines](README.md) - [ ] I have tested my changes locally using `docs dev` - [x] All code examples have been tested and work correctly - [x] I have used **root relative** paths for internal links - [ ] I have updated navigation in `src/docs.json` if needed ## Additional notes The issue manifests as: `TypeError: functools.partial(...) is not a module, class, method, or function` during graph compilation/execution. The `@tool` decorator creates a proper `StructuredTool` that `ToolNode` can correctly inspect. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-17 17:22:47 -05:00
yindo closed this issue 2026-02-17 17:22:47 -05:00
yindo changed title from [PR #1774] fix(docs): Use @tool decorator for retriever in agentic RAG tutorial to [PR #1774] [MERGED] fix(docs): Use @tool decorator for retriever in agentic RAG tutorial 2026-06-05 18:15:12 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/docs#1844