A Comprehensive LangChain AI Agent for Learning and Practical Applications
Agent Binod is a powerful, feature-rich AI assistant built with LangChain that demonstrates modern AI agent capabilities. Named after the legendary "Binod" meme, this agent brings intelligence, versatility, and a touch of humor to your AI learning journey.
Agent Binod is a comprehensive LangChain-powered AI agent that showcases the full spectrum of modern AI capabilities:
- ๐ค๏ธ Real-time Weather Information - Get current weather for any city worldwide
- ๐งฎ Smart Calculator - Perform complex mathematical calculations
- ๐ Web Search - Search the internet for current information
- ๐ Wikipedia Integration - Access detailed encyclopedia information
- ๐ง Knowledge Base Search - Semantic search through LangChain documentation
- ๐ฏ Expert Analysis - Get specialized responses from science, history, and technology experts
- ๐ Learning Plans - Generate comprehensive study plans for any topic
- ๐ก Topic Analysis - Get summaries and thought-provoking questions simultaneously
- ๐ CSV Data Analysis - Load, analyze, and get insights from CSV files
- Python 3.8 or higher
- OpenAI API key
- OpenWeatherMap API key (optional for weather features)
git clone https://github.com/farhapartex/agent-binod-008
cd agent-binodpip install -r requirements.txt
source venv/bin/activateCreate a .env file in the project root:
OPENAI_API_KEY=your_openai_api_key_here
WEATHER_API_KEY=your_openweathermap_api_key_hereGetting API Keys:
OpenAI API Key:
- Visit OpenAI Platform
OpenWeatherMap API Key (Optional):
- Visit OpenWeatherMap
- Note: Without this key, weather tool will use mock data
agent-binod/
โโโ agent
โ โโโ __init__.py
| โโโ core.py # Main file which have agent details
โโโ agent_libs/
โ โโโ tools.py # Calculator and custom output parser
โ โโโ weather.py # Weather tool implementation
โโโ .dockerignore # docker ignore items file
โโโ .env # Environment variables
โโโ .gitignore # git ignore items file
โโโ Dockerfile # Main dockerfile file
โโโ requirements.txt # Dependencies
โโโ main.py
โโโ README.md # This file
python main.pydocker build -t agent-binod:latest . # one time build
docker run -it --rm --env-file .env agent-binod:latestOnce running, you can use these special commands:
quit- Exit the agentdemo- Run comprehensive feature demonstrationmemory- View conversation history
If you want to feed agent with your own data, you can mention any pdf file in .env file. The pdf file will be takes automatically during first loading. That's it. Next time you will ask anything, Agent Binod will first look at vector db, if not find any resource then will go for other tools.
You: Load the CSV file at /home/user/data/sales.csv
Agent: โ
CSV Loaded Successfully!
๐ File: sales.csv
๐ Shape: 1,000 rows ร 8 columns
๐ Columns: date, product, sales, region, price...
๐ง Delimiter: ',' | Encoding: utf-8
You: Do a general analysis of the data
Agent: ๐ General Data Analysis
- Total Records: 1,000
- Numeric Columns: 3
- Categorical Columns: 4
- Missing Data: 25 cells
- Complete Rows: 975 (97.5%)
...
You: Show correlation analysis
Agent: ๐ Correlation Analysis
Strong Correlations (|r| > 0.7):
- sales โ price: 0.823 (positive)
- region โ sales: -0.745 (negative)
...
You: What's the weather in London?
Agent: ๐ค๏ธ Weather for London
Current: 15.3ยฐC (feels like 14.1ยฐC)
Condition: Light Rain
Humidity: 78% | Wind: 4.2 m/s
...
You: Calculate the area of a circle with radius 7.5
Agent: โ
Result: 3.14159 * 7.5 * 7.5 = 176.71
You: Explain photosynthesis scientifically
Agent: *Uses science expert chain*
As a science expert, photosynthesis is the complex biochemical process...
You: I want to learn machine learning completely
Agent: ๐ Learning Plan for Machine Learning
๐ Summary:
Machine learning is a subset of artificial intelligence...
โ Key Questions to Explore:
1. What are the different types of ML algorithms?
2. How do neural networks learn from data?
3. What are common real-world applications?
๐ฏ Next Steps:
1. Start with Python and key libraries (NumPy, Pandas, Scikit-learn)
2. Take an online course covering supervised/unsupervised learning
3. Practice with real datasets on Kaggle
# Run individual chain demos
agent.run_simple_chain("artificial intelligence")
agent.run_parallel_chain("quantum computing")
agent.run_sequential_chain("blockchain")
agent.run_router_chain("How does DNA work?")# Search internal knowledge base
agent.vector_search_demo("What are LangChain agents?")- LCEL (LangChain Expression Language) with pipe operators
- Tool-calling agents with automatic tool selection
- Vector stores with semantic search capabilities
- Memory management for conversation context
- Multiple chain types for different use cases
- Simple Chain - Basic prompt โ LLM โ response
- Structured Chain - Parsed output with metadata
- Parallel Chain - Simultaneous processing of multiple tasks
- Sequential Chain - Multi-step workflows
- Routing Chain - Intelligent expert selection
| Tool | Description | Example Usage |
|---|---|---|
| Weather | Real-time weather data | "Weather in Tokyo?" |
| Calculator | Mathematical calculations | "Calculate 15 * 23 + 100" |
| Search | Internet search | "Recent news about AI" |
| Wikipedia | Encyclopedia lookup | "Tell me about Python language" |
| Knowledge Search | LangChain documentation | "What are agents in LangChain?" |
| Expert Analysis | Specialized expert responses | "Explain quantum physics scientifically" |
| Learning Plan | Complete study plans | "I want to learn blockchain" |
| Topic Analysis | Summary + questions | "Analyze machine learning" |
- Learn LangChain concepts through hands-on experience
- Understand modern AI agent architecture
- Study prompt engineering and chain composition
- Template for building production AI agents
- Reference implementation for LangChain best practices
- Starting point for custom AI applications
- Get weather updates for travel planning
- Perform quick calculations and research
- Generate learning plans for new topics
- Get expert-level explanations on various subjects
This project is open source and available under the MIT License.
- Built with LangChain
- Weather data from OpenWeatherMap
- Search capabilities powered by DuckDuckGo
- Encyclopedia data from Wikipedia
Happy Learning with Agent Binod! ๐คโจ
"Just like the legendary Binod comment that took the internet by storm, Agent Binod is here to make AI learning simple, powerful, and memorable!"