An intelligent agriculture advisory system powered by AI agents that provides personalized farming advice based on soil conditions, climate, and crop requirements.
-
Multi-Agent AI System: Utilizes three specialized AI agents:
- 🌱 Soil Expert: Analyzes soil composition and health
- 🌾 Crop Advisor: Recommends suitable crops based on conditions
- 📊 Agricultural Analyst: Provides comprehensive farming strategies
-
Modern Web Interface: Beautiful, responsive chat interface with:
- Dark theme with glassmorphism effects
- Real-time loading indicators
- Example queries for quick start
- Smooth animations and transitions
-
RESTful API: FastAPI backend with:
- CORS support for cross-origin requests
- Error handling and logging
- Health check endpoints
latest_ai_development/
├── src/latest_ai_development/ # CrewAI implementation
│ ├── config/
│ │ ├── agents.yaml # Agent configurations
│ │ └── tasks.yaml # Task definitions
│ ├── crew.py # Crew orchestration
│ └── main.py # CLI entry point
├── api/ # FastAPI backend
│ ├── main.py # API server
│ └── requirements.txt # API dependencies
└── frontend/ # Web interface
├── index.html # Main HTML
├── styles.css # Styling
└── app.js # Frontend logic
- Python >= 3.10, < 3.14
- Node.js (for serving the frontend)
- Google Gemini API key (get it from Google AI Studio)
-
Clone and navigate to the project:
cd latest_ai_development -
Set up environment variables: Create a
.envfile in the root directory:GEMINI_API_KEY=your_gemini_api_key_here
📝 See GEMINI_SETUP.md for detailed instructions on getting your API key.
-
Install CrewAI dependencies:
pip install uv crewai install
-
Install API dependencies:
cd api pip3 install -r requirements.txt cd ..
cd api
python main.pyThe API will be available at http://localhost:8000
You can test the API:
- Health check:
http://localhost:8000/health - API docs:
http://localhost:8000/docs
In a new terminal, serve the frontend:
cd frontend
python -m http.server 3000The frontend will be available at http://localhost:3000
- Open your browser and navigate to
http://localhost:3000 - Type your farming question or click on an example query
- Wait for the AI agents to analyze and provide advice
- View the comprehensive farming strategy
- "I have a 2-acre farm in a tropical region with clay-loam soil. What crops should I plant this season?"
- "My soil is sandy and I'm in a dry climate. What vegetables can I grow?"
- "I want to start organic farming. What are the best practices for soil preparation?"
- "What crops are best for monsoon season in South Asia?"
- "How can I improve soil fertility naturally?"
You can test the CrewAI agents directly without the API:
crewai runThis will run the crew with the default query defined in src/latest_ai_development/main.py.
Edit src/latest_ai_development/config/agents.yaml to customize agent roles, goals, and backstories.
Edit src/latest_ai_development/config/tasks.yaml to customize task descriptions and expected outputs.
By default, the system uses the LLM configured in your environment. You can modify the LLM settings in the .env file or in the agent configurations.
- CrewAI Layer: Handles the multi-agent AI system
- API Layer: Provides RESTful endpoints for the frontend
- Frontend Layer: User interface for interacting with the system
- New Agent: Add configuration to
agents.yamland create agent method increw.py - New Task: Add configuration to
tasks.yamland create task method increw.py - New API Endpoint: Add route in
api/main.py - Frontend Updates: Modify
frontend/files as needed
- Ensure the FastAPI backend is running on port 8000
- Check CORS settings if accessing from a different origin
- This is a temporary API issue from the LLM provider
- Wait a few moments and try again
- Consider using a different model or API key
- Verify your API key is correctly set in
.env - Check the API logs for error messages
- Ensure all dependencies are installed
This project is built using CrewAI framework and follows its licensing terms.
Contributions are welcome! Please feel free to submit issues or pull requests.
Built with ❤️ using CrewAI, FastAPI, and modern web technologies