Skip to content

ryanzone/SpaceGENAI

Repository files navigation

Space GenAI Assistant

A conversational AI assistant powered by Retrieval-Augmented Generation (RAG) that provides intelligent answers about space, astronomy, and NASA missions.

image alt

📋 Problem Statement

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

🛠️ Tech Stack

Core Technologies

  • Python 3.8+ - Programming language
  • Streamlit - Web application framework
  • LangChain - RAG framework and orchestration

AI/ML Components

  • Groq API - LLM inference (LLaMA 3.3 70B)
  • HuggingFace Embeddings - Text embeddings (all-MiniLM-L6-v2)
  • FAISS - Vector database for similarity search

APIs & Integrations

  • NASA API - Astronomy Picture of the Day (APOD)
  • Requests - HTTP library for API calls

Additional Libraries

  • python-dotenv - Environment variable management
  • sentence-transformers - Embedding model

🚀 Features

  • 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

📦 Installation

Prerequisites

  • Python 3.8 or higher
  • pip package manager
  • Git

Step 1: Clone the Repository

git clone https://github.com/ryanzone/SpaceGENAI.git
cd SpaceGENAI

Step 2: Create Virtual Environment

python -m venv venv

# On Windows
venv\Scripts\activate

# On macOS/Linux
source venv/bin/activate

Step 3: Install Dependencies

pip install -r requirements.txt

Step 4: Set Up API Keys

Create a .env file in the root directory:

GROQ_API_KEY=your_groq_api_key_here
NASA_API_KEY=your_nasa_api_key_here

Getting API Keys:

Step 5: Prepare Knowledge Base

Ensure you have the FAISS index in the correct location:

embeddings/
  └── faiss_index/
      ├── index.faiss
      └── index.pkl

▶️ Running the Project

Start the Application

streamlit run stream_app.py

The app will open in your default browser at http://localhost:8501

Using the Assistant

  1. Chat Interface: Type your space and physics related questions in the chat input
  2. APOD Feature: Click "Show Today's APOD" in the sidebar to view NASA's daily image
  3. Clear Chat: Use the "Clear Chat" button to start a new conversation

image alt

🧪 Example Queries

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"

Troubleshooting

APOD Not Loading

  • Check if NASA API is operational
  • Verify your NASA API key in .env

** ⚠️⚠️ The US Government shutdown may temporarily affect NASA APIs ⚠️⚠️**

📝 Dependencies

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

Acknowledgments

  • NASA for providing the APOD API
  • Groq for fast LLM inference
  • LangChain community for RAG framework
  • HuggingFace for embedding models

Releases

No releases published

Packages

 
 
 

Contributors

Languages