An AI-powered agent that provides intelligent summaries, recommendations, and historical data analysis using large language models, real-time APIs and MCP servers.
The agent is designed to be extensible, allowing custom tools, MCP servers and clients, and external services to be integrated with it.
It can answer user queries, interact with various systems through tool integrations, store and retrieve data via MCP servers and send automated reports on a task based on its configurations.
Nimbus Agent currently has been configured as a weather assistance system that:
- AI-Powered Analysis: Uses DeepSeek-V4-Flash model via HuggingFace for intelligent weather interpretation
- Real-Time Weather Data: Fetches current weather conditions via OpenWeatherMap API
- Historical Tracking: Stores weather data in PostgreSQL for historical analysis
- Multiple Interfaces: Available as both a CLI tool and Discord bot
- Scheduled Updates: Automated daily weather reports (Discord bot)
- Current Weather Queries: Ask about weather in any city worldwide supported by the OpenWeatherMap API
- Intelligent Summaries: AI-generated weather summaries with context-aware recommendations
- Historical Data Analysis: Query and analyze historical weather patterns
- Natural Language Interface: Interact using conversational language
- Discord Integration: Bot for automated daily weather updates and on-demand queries
- Database Persistence: All weather data stored for future reference
The project uses a modular architecture with MCP (Model Context Protocol) for database operations:
┌─────────────────┐
│ User Interface │
│ (CLI/Discord) │
└────────┬────────┘
│
┌────────▼────────┐
│ AI Agent │
│ (agent.py) │
└────────┬────────┘
│
┌────┴────┐
│ │
┌───▼───┐ ┌──▼──────┐
│ Tools │ │ MCP │
│ │ │ Servers │
└───┬───┘ └──┬──────┘
│ │
┌───▼───┐ ┌──▼──────┐
│Weather│ │PostgreSQL│
│ API │ │ Database │
└───────┘ └─────────┘
- Python 3.12 or higher
- PostgreSQL database (local or remote)
- Internet connection for API calls
All dependencies are managed via pyproject.toml:
mcp>=1.27.2- Model Context Protocolhuggingface-hub>=1.18.0- HuggingFace API clientfastmcp>=3.4.2- Fast MCP server implementationasyncpg>=0.31.0- PostgreSQL async driverdiscord.py>=2.3.0- Discord bot libraryapscheduler>=3.10.0- Task schedulingpython-dotenv>=1.0.0- Environment variable managementpytz- Timezone support
- HuggingFace Token: For AI model access (Get one here)
- OpenWeatherMap API Key: For weather data (Get one here)
- Discord Token: For Discord bot (see Discord setup below)
cd weather_agentpython -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activatepip install -e .Create a PostgreSQL database named weather_db:
CREATE DATABASE weather_db;Create the required table:
CREATE TABLE weather_data (
id SERIAL PRIMARY KEY,
date_time TIMESTAMP,
location VARCHAR(100),
temperature FLOAT,
temperature_max FLOAT,
temperature_min FLOAT,
pressure FLOAT,
humidity FLOAT,
conditions TEXT,
llm_summary TEXT,
recommendations TEXT,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);Copy the example environment file:
cp .env.example .envEdit .env and add your credentials:
# Discord Bot Configuration (required for Discord bot only)
DISCORD_TOKEN=your_discord_bot_token_here
DISCORD_CHANNEL_ID=your_discord_channel_id_here
# API Keys (required for both CLI and Discord)
HF_TOKEN=your_hugging_face_token_here
OPEN_WEATHER_API_KEY=your_openweathermap_api_key_hereNote: Database connection parameters are currently hardcoded in db_mcp_server.py and retrieval_mcp_server.py. Update these files if your PostgreSQL configuration differs:
- Host:
localhost - Port:
5432 - Database:
weather_db - User:
postgres - Password:
postgres
Start the MCP servers:
python db_mcp_server.py
python retrieval_mcp_server.pyTest the CLI interface:
python agent.pyTry asking: "What's the weather like in London?"
Run the agent interactively:
python agent.pyExample queries:
- "What's the weather like in Paris?"
- "Tell me about the weather in Tokyo"
- "Show me historical weather data for London"
Type quit or exit to stop.
For detailed Discord setup instructions, see DISCORD_SETUP.md.
Quick start:
- Create a Discord bot application
- Configure bot permissions (Message Content Intent)
- Add environment variables to
.env - Run the bot:
python discord_weather_bot.pyDiscord commands:
!weather- Get current London weather with AI summary!schedule- View scheduled jobs- Natural language queries - Ask any weather question directly
The bot sends automated daily weather updates at 7:00 AM (London timezone).
weather_agent/
├── agent.py # Main AI agent with tool calling
├── discord_weather_bot.py # Discord bot integration
├── db_mcp_server.py # MCP server for database writes
├── db_mcp_client.py # MCP client for database operations
├── retrieval_mcp_server.py # MCP server for database reads
├── retrieval_mcp_client.py # MCP client for retrieval
├── pyproject.toml # Project dependencies
├── .env.example # Environment variables template
├── DISCORD_SETUP.md # Discord setup guide
└── README.md # This file
- User Query: User asks a weather question (CLI or Discord)
- AI Processing: The agent uses DeepSeek-V4-Flash to understand the query
- Tool Calling: Based on the query, the agent calls appropriate tools:
get_weather: Fetches current weather from OpenWeatherMap APIadd_weather_to_db: Stores weather data in PostgreSQL via MCPretrieve_weather_from_db: Queries historical data via MCP
- Response Generation: AI generates intelligent summaries and recommendations
- Output: Formatted response returned to user
Database connection errors:
- Ensure PostgreSQL is running
- Verify database credentials in MCP server files
- Check that
weather_dbdatabase exists
API errors:
- Verify your API keys are correct
- Check internet connectivity
- Ensure you have API quota available
MCP Servers:
- Verify that the MCP servers are running for both CLI and Dischord based integration modes
- Check the 'Running MCP Servers' section for commands.
Discord bot issues:
- See DISCORD_SETUP.md for detailed troubleshooting
- Verify bot has proper permissions
- Check that channel ID is correct
This project is for educational and personal use.