Integrate self-hosted Supabase with mem0 system
- Configure mem0 to use self-hosted Supabase instead of Qdrant for vector storage - Update docker-compose to connect containers to localai network - Install vecs library for Supabase pgvector integration - Create comprehensive test suite for Supabase + mem0 integration - Update documentation to reflect Supabase configuration - All containers now connected to shared localai network - Successful vector storage and retrieval tests completed 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
243
DOCUMENTATION_DEPLOYMENT.md
Normal file
243
DOCUMENTATION_DEPLOYMENT.md
Normal file
@@ -0,0 +1,243 @@
|
||||
# Mem0 Documentation Deployment Guide
|
||||
|
||||
## 📋 Current Status
|
||||
|
||||
✅ **Mintlify CLI Installed**: Global installation complete
|
||||
✅ **Documentation Structure Created**: Complete docs hierarchy with navigation
|
||||
✅ **Core Documentation Written**: Introduction, quickstart, architecture, API reference
|
||||
✅ **Mintlify Server Running**: Available on localhost:3003
|
||||
⚠️ **Caddy Configuration**: Requires manual update for proxy
|
||||
|
||||
## 🌐 Accessing Documentation
|
||||
|
||||
### Local Development
|
||||
```bash
|
||||
cd /home/klas/mem0
|
||||
./start_docs_server.sh
|
||||
```
|
||||
- **Local URL**: http://localhost:3003
|
||||
- **Features**: Live reload, development mode
|
||||
|
||||
### Production Deployment (docs.klas.chat)
|
||||
|
||||
#### Step 1: Update Caddy Configuration
|
||||
|
||||
The Caddy configuration needs to be updated to proxy docs.klas.chat to localhost:3003.
|
||||
|
||||
**Manual steps required:**
|
||||
|
||||
1. **Backup current Caddyfile:**
|
||||
```bash
|
||||
sudo cp /etc/caddy/Caddyfile /etc/caddy/Caddyfile.backup.$(date +%Y%m%d_%H%M%S)
|
||||
```
|
||||
|
||||
2. **Edit Caddyfile:**
|
||||
```bash
|
||||
sudo nano /etc/caddy/Caddyfile
|
||||
```
|
||||
|
||||
3. **Replace the docs.klas.chat section with:**
|
||||
```caddy
|
||||
docs.klas.chat {
|
||||
tls /certs/klas.chat/fullchain.cer /certs/klas.chat/klas.chat.key
|
||||
|
||||
# Basic Authentication
|
||||
basicauth * {
|
||||
langmem $2a$14$.1fx02QwkkmfezhZMLE4Iu2N/ub5vwDSAtcH9lAa5z11ChjiYy1PG
|
||||
}
|
||||
|
||||
# Security headers
|
||||
header {
|
||||
X-Frame-Options "DENY"
|
||||
X-Content-Type-Options "nosniff"
|
||||
X-XSS-Protection "1; mode=block"
|
||||
Referrer-Policy "strict-origin-when-cross-origin"
|
||||
Strict-Transport-Security "max-age=31536000; includeSubDomains"
|
||||
Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval' https://cdn.jsdelivr.net https://unpkg.com; style-src 'self' 'unsafe-inline' https://cdn.jsdelivr.net https://unpkg.com; img-src 'self' data: https:; font-src 'self' data: https:; connect-src 'self' ws: wss:;"
|
||||
}
|
||||
|
||||
# Proxy to Mintlify development server
|
||||
reverse_proxy localhost:3003
|
||||
|
||||
# Enable compression
|
||||
encode gzip
|
||||
}
|
||||
```
|
||||
|
||||
4. **Reload Caddy:**
|
||||
```bash
|
||||
sudo systemctl reload caddy
|
||||
```
|
||||
|
||||
#### Step 2: Start Documentation Server
|
||||
|
||||
```bash
|
||||
cd /home/klas/mem0
|
||||
./start_docs_server.sh
|
||||
```
|
||||
|
||||
#### Step 3: Access Documentation
|
||||
|
||||
- **URL**: https://docs.klas.chat
|
||||
- **Authentication**: Username `langmem` / Password configured in Caddy
|
||||
- **Features**: SSL, password protection, full documentation
|
||||
|
||||
## 📚 Documentation Structure
|
||||
|
||||
```
|
||||
docs/
|
||||
├── mint.json # Mintlify configuration
|
||||
├── introduction.mdx # Homepage and overview
|
||||
├── quickstart.mdx # Quick setup guide
|
||||
├── development.mdx # Development environment
|
||||
├── essentials/
|
||||
│ └── architecture.mdx # System architecture
|
||||
├── database/ # Database integration docs
|
||||
├── llm/ # LLM provider docs
|
||||
├── api-reference/
|
||||
│ └── introduction.mdx # API documentation
|
||||
└── guides/ # Implementation guides
|
||||
```
|
||||
|
||||
## 🔧 Service Management
|
||||
|
||||
### Background Service (Optional)
|
||||
|
||||
To run the documentation server as a background service, create a systemd service:
|
||||
|
||||
```bash
|
||||
sudo nano /etc/systemd/system/mem0-docs.service
|
||||
```
|
||||
|
||||
```ini
|
||||
[Unit]
|
||||
Description=Mem0 Documentation Server
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=klas
|
||||
WorkingDirectory=/home/klas/mem0/docs
|
||||
ExecStart=/usr/local/bin/mint dev --port 3003
|
||||
Restart=always
|
||||
RestartSec=5
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
```
|
||||
|
||||
Enable and start the service:
|
||||
```bash
|
||||
sudo systemctl enable mem0-docs
|
||||
sudo systemctl start mem0-docs
|
||||
sudo systemctl status mem0-docs
|
||||
```
|
||||
|
||||
## 📝 Documentation Content
|
||||
|
||||
### Completed Pages ✅
|
||||
|
||||
1. **Introduction** (`introduction.mdx`)
|
||||
- Project overview
|
||||
- Key features
|
||||
- Architecture diagram
|
||||
- Current status
|
||||
|
||||
2. **Quickstart** (`quickstart.mdx`)
|
||||
- Prerequisites
|
||||
- Installation steps
|
||||
- Basic testing
|
||||
|
||||
3. **Development Guide** (`development.mdx`)
|
||||
- Project structure
|
||||
- Development workflow
|
||||
- Next phases
|
||||
|
||||
4. **Architecture** (`essentials/architecture.mdx`)
|
||||
- System components
|
||||
- Data flow
|
||||
- Configuration
|
||||
- Security
|
||||
|
||||
5. **API Reference** (`api-reference/introduction.mdx`)
|
||||
- API overview
|
||||
- Authentication
|
||||
- Endpoints
|
||||
- Error codes
|
||||
|
||||
### Missing Pages (Referenced in Navigation) ⚠️
|
||||
|
||||
These pages are referenced in `mint.json` but need to be created:
|
||||
|
||||
- `essentials/memory-types.mdx`
|
||||
- `essentials/configuration.mdx`
|
||||
- `database/neo4j.mdx`
|
||||
- `database/qdrant.mdx`
|
||||
- `database/supabase.mdx`
|
||||
- `llm/ollama.mdx`
|
||||
- `llm/openai.mdx`
|
||||
- `llm/configuration.mdx`
|
||||
- `api-reference/add-memory.mdx`
|
||||
- `api-reference/search-memory.mdx`
|
||||
- `api-reference/get-memory.mdx`
|
||||
- `api-reference/update-memory.mdx`
|
||||
- `api-reference/delete-memory.mdx`
|
||||
- `guides/getting-started.mdx`
|
||||
- `guides/local-development.mdx`
|
||||
- `guides/production-deployment.mdx`
|
||||
- `guides/mcp-integration.mdx`
|
||||
|
||||
## 🎯 Deployment Checklist
|
||||
|
||||
- [x] Install Mintlify CLI
|
||||
- [x] Create documentation structure
|
||||
- [x] Write core documentation pages
|
||||
- [x] Configure Mintlify (mint.json)
|
||||
- [x] Test local development server
|
||||
- [x] Create deployment scripts
|
||||
- [ ] Update Caddy configuration (manual step required)
|
||||
- [ ] Start production documentation server
|
||||
- [ ] Verify HTTPS access at docs.klas.chat
|
||||
- [ ] Complete remaining documentation pages
|
||||
- [ ] Set up monitoring and backup
|
||||
|
||||
## 🚀 Next Steps
|
||||
|
||||
1. **Complete Caddy Configuration** (manual step required)
|
||||
2. **Start Documentation Server** (`./start_docs_server.sh`)
|
||||
3. **Verify Deployment** (access https://docs.klas.chat)
|
||||
4. **Complete Missing Documentation Pages**
|
||||
5. **Set up Production Service** (systemd service)
|
||||
|
||||
## 🔍 Troubleshooting
|
||||
|
||||
### Common Issues
|
||||
|
||||
**Port Already in Use**
|
||||
- Mintlify will automatically try ports 3001, 3002, 3003, etc.
|
||||
- Current configuration expects port 3003
|
||||
|
||||
**Caddy Configuration Issues**
|
||||
- Validate configuration: `sudo caddy validate --config /etc/caddy/Caddyfile`
|
||||
- Check Caddy logs: `sudo journalctl -u caddy -f`
|
||||
|
||||
**Documentation Not Loading**
|
||||
- Ensure Mintlify server is running: `netstat -tlnp | grep 3003`
|
||||
- Check Caddy proxy is working: `curl -H "Host: docs.klas.chat" http://localhost:3003`
|
||||
|
||||
**Missing Files Warnings**
|
||||
- These are expected for pages referenced in navigation but not yet created
|
||||
- Documentation will work with available pages
|
||||
|
||||
## 📞 Support
|
||||
|
||||
For deployment assistance or issues:
|
||||
- Check logs: `./start_docs_server.sh` (console output)
|
||||
- Verify setup: Visit http://localhost:3003 directly
|
||||
- Test proxy: Check Caddy configuration and reload
|
||||
|
||||
---
|
||||
|
||||
**Status**: Ready for production deployment with manual Caddy configuration step
|
||||
**Last Updated**: 2025-07-30
|
||||
**Version**: 1.0
|
||||
Reference in New Issue
Block a user