Agui Langgraph Fastmcp Demo
No description available
Ask AI about Agui Langgraph Fastmcp Demo
Powered by Claude Β· Grounded in docs
I know everything about Agui Langgraph Fastmcp Demo. Ask me about installation, configuration, usage, or troubleshooting.
0/500
Reviews
Documentation
π NASA Space Explorer
An interactive chatbot powered by NASA APIs that lets you explore space through natural conversation. Built with LangGraph, FastMCP, and real-time NASA data.
β¨ Features
- π Astronomy Picture of the Day (APOD): Get NASA's stunning daily space images with descriptions
- π΄ Mars Rover Photos: Access photos from Curiosity, Opportunity, and Spirit rovers
- βοΈ Near Earth Objects (NEO): Track asteroids and potentially hazardous objects near Earth
- π NASA Media Library: Search through NASA's vast collection of images and videos
- π¬ Natural Language Interface: Chat naturally about space topics and get real-time data
ποΈ Architecture
This application consists of three main components:
- Frontend (Next.js): Modern chat interface with space-themed UI
- Backend (FastAPI + LangGraph): Orchestrates LLM and tool calls using LangGraph
- Tools (FastMCP): MCP server providing NASA API tools
βββββββββββββββ ββββββββββββββββ ββββββββββββββ
β Frontend βββββββΆβ Backend βββββββΆβ Tools β
β (Next.js) β β (FastAPI) β β (FastMCP) β
β ββββββββ (LangGraph) ββββββββ NASA APIs β
βββββββββββββββ ββββββββββββββββ ββββββββββββββ
π Quick Start
Prerequisites
- Docker and Docker Compose
- OpenAI API key
- NASA API key (optional - defaults to DEMO_KEY)
Setup
-
Clone the repository
git clone https://github.com/NikhilBaravkarDataScientist/agui-langgraph-fastmcp-demo.git cd agui-langgraph-fastmcp-demo -
Get your NASA API key (optional but recommended)
- Visit https://api.nasa.gov/
- Sign up for a free API key (takes 30 seconds)
- Free tier: 1,000 requests per hour
- Demo key (DEMO_KEY): 30 requests per hour per IP
-
Configure environment variables
cp .env.example .envEdit
.envand add your keys:OPENAI_API_KEY=your_openai_api_key_here NASA_API_KEY=your_nasa_api_key_here # or use DEMO_KEY -
Start the application
docker-compose up --build -
Access the application
- Frontend: http://localhost:3000
- Backend API: http://localhost:8000
- Tools MCP Server: http://localhost:9000
π‘ Usage Examples
Once the application is running, try these queries:
- "Show me today's astronomy picture" - Get APOD
- "Get photos from Mars Curiosity rover sol 1000" - Mars rover images
- "Are there any asteroids near Earth right now?" - NEO data
- "Search for images of the Hubble Space Telescope" - NASA media search
- "Show me pictures from Mars rover's NAVCAM camera" - Specific camera photos
- "What near earth objects were detected this week?" - Recent NEO activity
π οΈ NASA API Tools
The chatbot has access to these NASA API tools:
1. APOD (Astronomy Picture of the Day)
Get NASA's daily featured space image with explanation.
Parameters:
date(optional): Date in YYYY-MM-DD format
2. Mars Rover Photos
Fetch photos from Mars rovers.
Parameters:
sol: Martian sol (day) number (default: 1000)camera: Camera name - FHAZ, RHAZ, MAST, NAVCAM, etc. (default: "all")rover: Rover name - curiosity, opportunity, spirit (default: "curiosity")
3. Near Earth Objects (NEO)
Get data about asteroids near Earth.
Parameters:
start_date(optional): Start date in YYYY-MM-DD formatend_date(optional): End date in YYYY-MM-DD format (max 7 days)
4. NASA Image Search
Search NASA's media library.
Parameters:
query: Search keywordsmedia_type: image, video, or audio (default: "image")
π Development
Running Individual Components
Backend only:
cd backend
pip install -r requirements.txt
uvicorn app.main:app --reload
Tools server only:
cd tools
pip install -r requirements.txt
python server.py
Frontend only:
cd frontend
npm install
npm run dev
Environment Variables
Backend:
OPENAI_API_KEY: Your OpenAI API key (required)NASA_API_KEY: Your NASA API key (optional, defaults to DEMO_KEY)
Tools:
NASA_API_KEY: Your NASA API key (optional, defaults to DEMO_KEY)
Frontend:
NEXT_PUBLIC_WS_URL: WebSocket URL for backend (default: ws://localhost:8000/ws/chat)
π Project Structure
.
βββ backend/ # FastAPI backend with LangGraph
β βββ app/
β β βββ graph/ # LangGraph nodes, edges, state
β β βββ llm/ # OpenAI LLM configuration
β β βββ mcp/ # MCP client for tool calls
β β βββ utils/ # Utilities (memory, streaming)
β βββ requirements.txt
β
βββ tools/ # FastMCP server with NASA tools
β βββ server.py # MCP server setup
β βββ tools.py # NASA API tool implementations
β βββ requirements.txt
β
βββ frontend/ # Next.js frontend
β βββ app/ # Next.js app directory
β βββ components/ # React components
β βββ lib/ # WebSocket utilities
β
βββ docker-compose.yml # Docker orchestration
π Security
- Never commit API keys to the repository
- Use environment variables for sensitive data
- The
.envfile is gitignored by default - NASA's DEMO_KEY is rate-limited and should only be used for testing
π€ Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
π License
This project is open source and available under the MIT License.
π Acknowledgments
- NASA Open APIs for providing free access to space data
- FastMCP for the MCP server framework
- LangGraph for agent orchestration
- LangChain for LLM integration
π Resources
Made with β€οΈ and β for space exploration enthusiasts
