AI სამუშაო პროცესები და აგენტებიName
როლური ავტონომიური ხელოვნური ინტელექტის აგენტების ორგანიზების სტრუქტურა, რომ ერთად იმუშაონ რთული დავალებები
Create specialized AI agents with distinct roles, goals, backstories, and capabilities that work autonomously
Run tasks sequentially for ordered workflows or hierarchically with manager agents delegating to workers
Equip agents with custom tools for web search, API calls, database queries, file operations, and any Python function
Built-in memory systems allow agents to remember previous interactions and maintain context across executions
Use OpenAI, Claude, Gemini, Ollama, or any OpenAI-compatible API with different models for different agents
Error handling, retry logic, callbacks, output validation, and comprehensive logging for reliable deployments
sudo apt update && sudo apt upgrade -y
sudo apt install python3.11 python3.11-venv python3-pip -y2. Create Virtual Environment:mkdir ~/crewai-projects
cd ~/crewai-projects
python3.11 -m venv venv
source venv/bin/activate3. Install CrewAI:# Install CrewAI and extra tools
pip install crewai crewai-tools
# Or install with specific LLM support
pip install 'crewai[anthropic]' # For Claude
pip install 'crewai[google]' # For Gemini4. Set Up API Keys:# Create .env file for API credentials
nano .envAdd your API keys:OPENAI_API_KEY=sk-your-openai-key-here
ANTHROPIC_API_KEY=sk-ant-your-anthropic-key-here
GOOGLE_API_KEY=your-google-api-key-here5. Create Your First Research Crew:nano research_crew.pyAdd this code:from crewai import Agent, Task, Crew, Process
researcher = Agent(
role='Senior Research Analyst',
goal='Conduct thorough research on given topics',
backstory='Expert researcher with 10 years experience',
verbose=True
)
writer = Agent(
role='Content Writer',
goal='Create comprehensive reports',
backstory='Professional writer specializing in research',
verbose=True
)
research_task = Task(
description='Research latest trends in AI',
agent=researcher,
expected_output='Detailed research findings'
)
writing_task = Task(
description='Write comprehensive report from research',
agent=writer,
expected_output='Professional research report'
)
crew = Crew(
agents=[researcher, writer],
tasks=[research_task, writing_task],
process=Process.sequential,
verbose=2
)
result = crew.kickoff()
print(result)6. Run Your First Crew:python research_crew.py7. Verify Installation:python -c "import crewai; print(f'CrewAI version: {crewai.__version__}')"
from crewai import Agent
agent = Agent(
role='Data Analyst',
goal='Analyze data and provide insights',
backstory='Expert analyst with strong statistical background',
llm='gpt-4-turbo',
verbose=True,
allow_delegation=False,
max_iter=15,
memory=True,
tools=[search_tool, calculator_tool]
)2. Task Configuration:from crewai import Task
task = Task(
description='Analyze sales data for Q4 2024',
agent=data_analyst,
expected_output='Detailed analysis report',
async_execution=False,
context=[previous_task]
)3. Sequential Process:from crewai import Crew, Process
crew = Crew(
agents=[researcher, analyst, writer],
tasks=[research_task, analysis_task, writing_task],
process=Process.sequential
)
result = crew.kickoff()4. Hierarchical Process:crew = Crew(
agents=[researcher, analyst, writer],
tasks=[research_task, analysis_task, writing_task],
process=Process.hierarchical,
manager_llm='gpt-4'
)5. Memory Configuration:crew = Crew(
agents=[agent1, agent2],
tasks=[task1, task2],
memory=True,
long_term_memory={
'provider': 'mem0',
'config': {'api_key': 'your-mem0-api-key'}
}
)6. Different LLM Providers:# OpenAI
openai_agent = Agent(role='Researcher', llm='gpt-4-turbo')
# Claude
from langchain_anthropic import ChatAnthropic
claude_llm = ChatAnthropic(model='claude-3-opus-20240229')
claude_agent = Agent(role='Writer', llm=claude_llm)
# Ollama (local)
from langchain_community.llms import Ollama
local_llm = Ollama(model='llama2')
local_agent = Agent(role='Analyst', llm=local_llm)Best Practices:დაწყება რამდენიმე წუთში ჩვენი მარტივი VPS განთავსების პროცესით
Deploy in about 2 minutes • Full root access • Support by ticket and email