feat: add Tavily as configurable internet search backend#1357
Open
Tavily-FDE-Bot wants to merge 1 commit intoMemTensor:mainfrom
Open
feat: add Tavily as configurable internet search backend#1357Tavily-FDE-Bot wants to merge 1 commit intoMemTensor:mainfrom
Tavily-FDE-Bot wants to merge 1 commit intoMemTensor:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
INTERNET_SEARCH_BACKENDenv var (defaults tobocha)Files Changed
src/memos/configs/internet_retriever.py— AddedTavilySearchConfigdataclass and registered'tavily'inInternetRetrieverConfigFactory.backend_to_classsrc/memos/memories/textual/tree_text_memory/retrieve/tavilysearch.py— New file:InternetTavilyRetrieverimplementation usingtavily-pythonSDK, mirroringbochasearch.pypatternssrc/memos/memories/textual/tree_text_memory/retrieve/internet_retriever_factory.py— Registered'tavily'inbackend_to_classand added instantiation logic infrom_config()src/memos/api/config.py— Updatedget_internet_config()to support'tavily'backend viaINTERNET_SEARCH_BACKENDenv varpyproject.toml— Addedtavily-pythonas optional dependency under[tavily]extra and in[all]docker/requirements.txt— Addedtavily-python==0.5.0docker/requirements-full.txt— Addedtavily-python==0.5.0docker/.env.example— DocumentedINTERNET_SEARCH_BACKENDandTAVILY_API_KEYapps/memos-local-openclaw/.env.example— DocumentedTAVILY_API_KEYexamples/basic_modules/textual_memory_internet_search_example.py— Added Tavily example blockDependency Changes
tavily-python (>=0.5.0,<1.0.0)topyproject.tomloptional extras ([tavily]and[all])tavily-python==0.5.0todocker/requirements.txttavily-python==0.5.0todocker/requirements-full.txtEnvironment Variable Changes
INTERNET_SEARCH_BACKEND(default:bocha) to select the search backendTAVILY_API_KEY— required whenINTERNET_SEARCH_BACKEND=tavilyTAVILY_SEARCH_DEPTH(optional, default:basic)TAVILY_INCLUDE_ANSWER(optional, default:false)Notes for Reviewers
require_python_packagedecorator ensurestavily-pythonandjiebaare installed at runtimeAutomated Review