CoolFace
Apppublic

Kirtan001/satellite-rag

sourceHugging Faceupdated 8mo agoView on Hugging Face
0likes
App README

๐Ÿ›ฐ๏ธ Space Satellite Assistant: Intelligent Data Expert

![Hugging Face Spaces](https://huggingface.co/spaces/Kirtan001/satellite-rag) ![Python](https://www.python.org/) ![RAG](https://python.langchain.com/) ![Docker](https://www.docker.com/)

Space Satellite Assistant is a Retrieval-Augmented Generation (RAG) system designed to democratize access to complex satellite specifications. It transforms unstructured technical data from Gunter's Space Page into a structured, queryable knowledge base, allowing users to ask natural language questions about satellite orbits, operators, and technical payloads.


๐Ÿ“Œ Problem Statement

Satellite data is often fragmented across nested web directories, PDF datasheets, and inconsistent HTML tables. For researchers and enthusiasts, finding specific technical details (e.g., "What is the resolution of Gaofen-1?") requires navigating deep page hierarchies and manually parsing unstructured text.

The Solution: An end-to-end data engineering pipeline that scrapes, structures, and indexes this data into a semantic search engine, powered by a Large Language Model (LLM) for accurate, grounded answers.


๐Ÿ—๏ธ System Architecture

The system follows a modern ETL + RAG architecture:

mermaid
graph LR
    A[Web Source] -->|BeautifulSoup Scraper| B(Structured JSON)
    B -->|Recursive Splitting| C[Markdown Chunks]
    C -->|BGE-Small Embeddings| D[ChromaDB Vector Store]
    E[User Query] -->|Similarity Search| D
    D -->|Retrieved Context| F[Llama-3 LLM]
    F -->|Grounded Answer| G[Streamlit UI]

๐Ÿ› ๏ธ Tech Stack & Methodology

1. Data Acquisition (The Scraper)

  • โ€”Tools: BeautifulSoup4, Requests
  • โ€”Challenge: The source site has a 4-level deep hierarchy (Country -> Category -> Satellite List -> Detail Page).
  • โ€”Strategy: Implemented a robust crawler that traverses the tree, handling varying table structures for specifications and launch history.
  • โ€”Output: A clean, unified satellites_detailed.json serving as the ground truth.

2. Knowledge Base (The Index)

  • โ€”Vector Store: ChromaDB (Local, persistent).
  • โ€”Embeddings: BAAI/bge-small-en-v1.5 (Optimized for retrieval performance vs. latency).
  • โ€”Chunking:
  • โ€”Converted raw JSON to Markdown to preserve structural semantics (Headers, Lists).
  • โ€”Used RecursiveCharacterTextSplitter with chunk_size=1000 to maintain context window integrity.
  • โ€”Enrichment: Injected satellite names into every chunk to prevent "context drifting" during retrieval.

3. Inference Engine (The Brain)

  • โ€”Model: Llama-3.3-70b (via Groq API).
  • โ€”Reasoning: Selected for its high reasoning capability and fast inference speed on the Groq LPU.
  • โ€”Prompt Engineering: Strict system prompts enforce "answer only from context" to minimize hallucinations, critical for technical data.

4. Deployment (DevOps)

  • โ€”Containerization: Fully Dockerized application ensuring reproducibility.
  • โ€”Self-Healing: Implemented a "lazy-build" mechanism. On a fresh cloud instance (stateless), the system detects a missing index and automatically rebuilds it from the source JSON on startup.

๐Ÿš€ Live Demo

Experience the agent in action on Hugging Face Spaces:

๐Ÿ‘‰ [Kirtan001/satellite-rag](https://huggingface.co/spaces/Kirtan001/satellite-rag)


Created by Kirtan

test

test