A conversational AI assistant powered by Retrieval-Augmented Generation (RAG) that provides intelligent answers about space, astronomy, and NASA missions.
Space enthusiasts, students, and researchers often need quick, accurate information about astronomy, space missions, and celestial phenomena. Traditional search engines provide fragmented information, while chatbots lack domain-specific knowledge.
This project solves this by creating an AI assistant that:
- Provides accurate, context-aware answers about space topics
- Retrieves information from a curated knowledge base using RAG
- Integrates real-time NASA data (APOD - Astronomy Picture of the Day)
- Offers a conversational interface for easy interaction
- Python 3.8+ - Programming language
- Streamlit - Web application framework
- LangChain - RAG framework and orchestration
- Groq API - LLM inference (LLaMA 3.3 70B)
- HuggingFace Embeddings - Text embeddings (all-MiniLM-L6-v2)
- FAISS - Vector database for similarity search
- NASA API - Astronomy Picture of the Day (APOD)
- Requests - HTTP library for API calls
- python-dotenv - Environment variable management
- sentence-transformers - Embedding model
- Intelligent Q&A - Ask anything about space, astronomy, NASA missions
- RAG-Powered Search - Retrieves relevant context from knowledge base
- NASA APOD Integration - Daily astronomy pictures with explanations
- Conversational UI - Natural chat interface
- Modern Design - Sleek space-themed interface with animations
- Fast Responses - Powered by Groq's high-speed inference
- Python 3.8 or higher
- pip package manager
- Git
git clone https://github.com/ryanzone/SpaceGENAI.git
cd SpaceGENAIpython -m venv venv
# On Windows
venv\Scripts\activate
# On macOS/Linux
source venv/bin/activatepip install -r requirements.txtCreate a .env file in the root directory:
GROQ_API_KEY=your_groq_api_key_here
NASA_API_KEY=your_nasa_api_key_hereGetting API Keys:
- Groq API: Sign up at console.groq.com
- NASA API: Get free key at api.nasa.gov
Ensure you have the FAISS index in the correct location:
embeddings/
└── faiss_index/
├── index.faiss
└── index.pkl
streamlit run stream_app.pyThe app will open in your default browser at http://localhost:8501
- Chat Interface: Type your space and physics related questions in the chat input
- APOD Feature: Click "Show Today's APOD" in the sidebar to view NASA's daily image
- Clear Chat: Use the "Clear Chat" button to start a new conversation
Try asking:
- "What is a black hole?"
- "Tell me about the James Webb Space Telescope"
- "How do rockets work?"
- "What are exoplanets?"
- "Explain the Mars rover missions"
- Check if NASA API is operational
- Verify your NASA API key in
.env
- The Last APOD was on 1/10/2025
- https://www.nasa.gov/shutdown/.
Requirements.txt
streamlit>=1.50.0
langchain>=0.3.10
langchain-community>=0.3.10
sentence-transformers>=3.3.0
faiss-cpu>=1.9.0
groq>=0.12.0
python-dotenv>=1.0.1
requests>=2.32.0- NASA for providing the APOD API
- Groq for fast LLM inference
- LangChain community for RAG framework
- HuggingFace for embedding models

