Deep Agents
Agent badawczy z Deep Agents
Zbuduj autonomicznego agenta badawczego, który przeszukuje internet, syntetyzuje wyniki i tworzy strukturalne raporty — z Deep Agents.
researchweb searchreportsautomation
Działający kod
from deepagents import create_deep_agentfrom langchain_core.tools import tool
@tooldef web_search(query: str, max_results: int = 3) -> str: """Search the web for current information.""" from tavily import TavilyClient client = TavilyClient() results = client.search(query, max_results=max_results) return "\n\n".join( f"**{r['title']}**\n{r['content']}" for r in results["results"] )
agent = create_deep_agent( model="anthropic:claude-sonnet-4-5-20250929", tools=[web_search], system_prompt="You are a research assistant. Search the web to gather information, then synthesize findings into a structured report with citations.",)
result = agent.invoke({ "messages": [("user", "Compare the latest developments in AI agent frameworks in 2025")]})print(result["messages"][-1].content)Krok po kroku
1
Zainstaluj zależności
Zainstaluj Deep Agents i wymagane narzędzia do tego przypadku użycia.
2
Zdefiniuj narzędzia
Stwórz specyficzne dla domeny funkcje narzędzi, których agent będzie używał do interakcji z zewnętrznymi serwisami.
3
Stwórz agenta i uruchom
Zainicjalizuj agenta Deep Agents z narzędziami, ustaw prompt systemowy i wykonaj zapytanie.
Zbuduj z innymi frameworkami
Więcej poradników z Deep Agents
Gotowy do budowania z Deep Agents?
Wygeneruj gotowy do produkcji projekt z Deep Agents — FastAPI + Next.js, autoryzacja, streaming i więcej.
RozpocznijGotowy, żeby zbudować swojego pierwszego agenta AI?
Open-source'owe narzędzia, sprawdzone wzorce, zero boilerplate'u. Skonfiguruj swój stos i wyślij w minuty — nie miesiące.