π Deploying KnowledgeBridge to Hugging Face Spaces
π€ Track 3: Agentic Demo Showcase
This guide will help you deploy KnowledgeBridge to Hugging Face Spaces for the Agents-MCP-Hackathon Track 3: Agentic Demo Showcase - demonstrating the incredible power of AI agents working together!
π― Prerequisites
- Hugging Face Account: Sign up at huggingface.co
- API Keys: Get your Nebius AI API key from studio.nebius.ai
- Git: Ensure git is installed on your system
π¦ Step-by-Step Deployment
1. Create a New Hugging Face Space
- Go to Hugging Face Spaces
- Click "Create new Space"
- Fill in the details:
- Space name:
KnowledgeBridge
- License:
MIT
- Space SDK:
Docker
- Visibility:
Public
- Space name:
- Click "Create Space"
2. Clone Your New Space Repository
# Clone the empty space repository
git clone https://huggingface.co/spaces/YOUR_USERNAME/KnowledgeBridge
cd KnowledgeBridge
3. Copy KnowledgeBridge Files
# Copy all files from your local KnowledgeBridge project
cp -r /path/to/your/KnowledgeBridge/* .
cp -r /path/to/your/KnowledgeBridge/.* . 2>/dev/null || true
# Make sure you have these key files:
ls -la
# Should see: Dockerfile, package.json, .env.example, README.md, etc.
4. Configure Environment Variables
- Go to your Space settings on Hugging Face
- Navigate to "Variables and secrets"
- Add these environment variables:
# Required
NEBIUS_API_KEY=your_actual_nebius_api_key_here
NODE_ENV=production
PORT=7860
# Optional but recommended
GITHUB_TOKEN=your_github_token_here
MODAL_TOKEN_ID=your_modal_token_id
MODAL_TOKEN_SECRET=your_modal_token_secret
5. Update README.md
Replace YOUR_USERNAME
in the README.md with your actual Hugging Face username:
**Live Demo**: [Try KnowledgeBridge on Hugging Face Spaces](https://huggingface.co/spaces/YOUR_USERNAME/KnowledgeBridge)
6. Commit and Push
# Add all files
git add .
# Commit with a descriptive message
git commit -m "π Deploy KnowledgeBridge to Hugging Face Spaces
- AI-enhanced knowledge discovery platform
- Multi-source search (GitHub, Wikipedia, ArXiv)
- Interactive knowledge graphs and visualizations
- Enterprise-grade security and performance
- Built for Agents-MCP-Hackathon"
# Push to deploy
git push origin main
7. Monitor Deployment
- Go to your Space page:
https://huggingface.co/spaces/YOUR_USERNAME/KnowledgeBridge
- You'll see the build logs in real-time
- The deployment typically takes 3-5 minutes
- Once complete, your app will be available at the Space URL
β Verification Steps
After deployment, verify these features work:
- Health Check: Visit
/api/health
- should show all services healthy - Search: Try searching for "machine learning"
- AI Assistant: Click the π€ button and test explanations
- Knowledge Graph: Navigate to the Knowledge Graph tab
- Document Analysis: Test with sample content
π§ Troubleshooting
Common Issues:
Build Fails:
- Check the build logs in your Space
- Ensure all dependencies are in
package.json
- Verify Dockerfile syntax
App Doesn't Start:
- Check environment variables are set correctly
- Ensure PORT=7860 is configured
- Verify the start script in package.json
API Errors:
- Ensure NEBIUS_API_KEY is valid and has credits
- Check the logs for specific error messages
- Verify network connectivity to external APIs
Debug Commands:
If you need to debug, you can check logs:
# View recent logs (if you have CLI access)
docker logs <container_id>
π Success!
Once deployed successfully, your KnowledgeBridge app will be live at:
https://huggingface.co/spaces/YOUR_USERNAME/KnowledgeBridge
Share this URL in your hackathon submission!
π Hackathon Submission Checklist
- β App deployed and accessible on Hugging Face Spaces
- β All core features working (search, AI assistant, knowledge graph)
- β Environment variables configured securely
- β README updated with live demo link
- β Submission includes Space URL
- β All APIs responding correctly
π Useful Links
- Hugging Face Spaces Documentation
- Docker for Spaces Guide
- Agents-MCP-Hackathon
- Nebius AI Documentation
Good luck with your hackathon submission! π