Spaces:
Sleeping
Sleeping
metadata
title: CosmoPedia - Space Knowledge Hub
emoji: π
colorFrom: blue
colorTo: purple
sdk: docker
app_port: 7860
pinned: false
license: apache-2.0
tags:
- space
- astronomy
- knowledge-base
- flask
- vector-search
CosmoPedia π - Space Knowledge Hub
An interactive space knowledge platform powered by Flask, featuring comprehensive information about space exploration, astronomy, and cosmic discoveries. This application combines traditional web interfaces with advanced vector search capabilities for intelligent space-related queries.
Features
- π Comprehensive Space Database: Information about planets, astronauts, rockets, space agencies, telescopes, and more
- π Vector Search: Advanced semantic search using FAISS and sentence transformers
- π€ AI Chat Interface: Interactive chat with space knowledge using Mistral AI
- π Multiple Views: Browse data through organized categories
- π¨ Space-themed UI: Beautiful cosmic interface with preloader animations
- ποΈ Space Museums: Information about space museums worldwide
- π‘ Space Terminology: Comprehensive glossary of space terms
Live Demo
Try the app on Hugging Face Spaces: CosmoPedia Space Hub
Screenshots
Installation
Local Development
git clone https://huggingface.co/spaces/your-username/cosmopedia
cd cosmopedia
pip install -r requirements.txt
python app.py
Docker
docker build -t cosmopedia .
docker run -p 7860:7860 cosmopedia
Usage
- Browse Categories: Navigate through different space-related categories
- Search: Use the vector search to find specific information
- Chat Interface: Ask questions about space using the AI chat feature
- Explore Data: View detailed information about space missions, astronauts, and more
API Endpoints
GET /- Main interfaceGET /chat- AI chat interfaceGET /astronauts- Astronaut informationGET /planets- Planetary dataGET /rockets- Rocket specificationsGET /agencies- Space agency detailsGET /telescopes- Telescope informationGET /museums- Space museum locationsGET /terminologies- Space terminologyPOST /api/search- Vector search endpointPOST /api/chat- Chat API endpoint
Data Sources
The application includes comprehensive datasets covering:
- Astronauts: Notable space explorers and their missions
- Planets: Detailed planetary information
- Rockets: Launch vehicles and specifications
- Space Agencies: Global space organizations
- Telescopes: Ground and space-based observatories
- Museums: Space museums worldwide
- Terminology: Space and astronomy glossary
Technology Stack
- Backend: Flask (Python 3.11)
- Vector Search: FAISS, Sentence Transformers
- AI Integration: Mistral AI API
- Frontend: HTML, CSS, JavaScript
- Data Processing: JSON, NumPy, Scikit-learn
- Deployment: Docker, Hugging Face Spaces
Configuration
Environment Variables
MISTRAL_API_KEY=your_mistral_api_key
MISTRAL_API_URL=https://api.mistral.ai/v1/chat/completions
PORT=7860
Required Files
knowledge_base_docs.pkl- Preprocessed documents for vector searchknowledge_base_index.faiss- FAISS index for semantic searchdata/- JSON files containing space-related datasets
File Structure
CosmoPedia/
βββ app.py # Main Flask application
βββ vector_search.py # Vector search implementation
βββ requirements.txt # Python dependencies
βββ Dockerfile # Docker configuration
βββ data/ # JSON datasets
β βββ astronauts.json
β βββ planets.json
β βββ rockets.json
β βββ ...
βββ templates/ # HTML templates
βββ static/ # CSS, JS, and assets
βββ Swagger_Api/ # API documentation
Development
Adding New Data
- Add JSON files to the
data/directory - Update the knowledge base initialization
- Rebuild the vector search index
Customizing the Interface
- Modify templates in
templates/ - Update styles in
static/css/ - Add functionality in
static/js/
Performance Features
- Lazy loading of vector search components
- Efficient FAISS indexing
- Rate limiting for API calls
- Optimized static asset loading
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
License
This project is licensed under the Apache 2.0 License - see the LICENSE file for details.
Acknowledgments
- Space data sourced from NASA, ESA, and other space agencies
- Vector search powered by Hugging Face Transformers
- UI inspired by cosmic themes and space exploration
Support
For questions or issues, please open an issue on the repository or contact the maintainers.
Built with β€οΈ for space enthusiasts and cosmic explorers π
