Skip to content
CrewAI

Agent badawczy z CrewAI

Zbuduj autonomicznego agenta badawczego, który przeszukuje internet, syntetyzuje wyniki i tworzy strukturalne raporty — z CrewAI.

researchweb searchreportsautomation

Działający kod

CrewAI
from crewai import Agent, Crew, Task
from langchain_openai import ChatOpenAI
from langchain_core.tools import tool
@tool
def 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 = Agent(
role="Specialist",
goal="You are a research assistant. Search the web to gather information, then synthesize findings into a structured report with citations.",
tools=[web_search],
llm=ChatOpenAI(model="gpt-4o"),
)
task = Task(
description="Compare the latest developments in AI agent frameworks in 2025",
expected_output="Detailed response",
agent=agent,
)
crew = Crew(agents=[agent], tasks=[task])
result = crew.kickoff()
print(result.raw)

Krok po kroku

1

Zainstaluj zależności

Zainstaluj CrewAI 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 CrewAI z narzędziami, ustaw prompt systemowy i wykonaj zapytanie.

Gotowy do budowania z CrewAI?

Wygeneruj gotowy do produkcji projekt z CrewAI — FastAPI + Next.js, autoryzacja, streaming i więcej.

Rozpocznij

Gotowy, ż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.