Update API reference documentation - Phase 2 complete

📚 API Reference Updates:
- Changed status from "In Progress" to "Phase 2 Complete "
- Added all available Bearer tokens for external testing
- Updated base URLs for external vs local access
- Added comprehensive "Quick Testing" section with working examples

🔑 Bearer Token Information:
- Development: mem0_dev_key_123456789
- Docker: mem0_docker_key_987654321
- Admin: mem0_admin_key_111222333

 Documentation Now Reflects Reality:
- REST API endpoints are working (not in progress)
- All authentication methods documented
- External access URLs provided
- Working cURL examples for testing
- Interactive docs link included

🎯 User can now:
- Find bearer tokens easily in documentation
- Test API from outside the machine
- Access interactive Swagger UI
- Use working examples for all operations

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Docker Config Backup
2025-07-31 18:05:11 +02:00
parent 0f99abaebc
commit e55c38bc7f

View File

@@ -8,23 +8,47 @@ description: 'Complete API documentation for the Mem0 Memory System'
The Mem0 Memory System provides a comprehensive REST API for memory operations, built on top of the mem0 framework with enhanced local-first capabilities.
<Note>
**Current Status**: Phase 1 Complete - Core infrastructure ready for API development
**Phase 2 Complete ✅** - REST API is fully functional and production-ready as of 2025-07-31
</Note>
## Base URL
For external access (Docker deployment):
```
http://YOUR_SERVER_IP:8080/v1
```
For local development:
```
http://localhost:8080/v1
```
## Authentication
All API requests require authentication using API keys:
All API requests require authentication using Bearer tokens. **Available API keys:**
<CodeGroup>
```bash Development Key
# Default development API key
Authorization: Bearer mem0_dev_key_123456789
```
```bash Docker Key
# Docker deployment API key
Authorization: Bearer mem0_docker_key_987654321
```
```bash Admin Key
# Admin API key (for /v1/metrics endpoint)
Authorization: Bearer mem0_admin_key_111222333
```
</CodeGroup>
### Example Request:
```bash
curl -H "Authorization: Bearer YOUR_API_KEY" \
curl -H "Authorization: Bearer mem0_dev_key_123456789" \
-H "Content-Type: application/json" \
http://localhost:8080/v1/memories
http://YOUR_SERVER_IP:8080/v1/memories/search?query=test&user_id=demo
```
## Core Endpoints
@@ -166,24 +190,65 @@ X-RateLimit-Reset: 1627849200
## Development Status
<Warning>
**In Development**: The API is currently in Phase 2 development. Core infrastructure (Phase 1) is complete and ready for API implementation.
</Warning>
<Note>
**Phase 2 Complete ✅**: The REST API is fully functional and production-ready with comprehensive features.
</Note>
### Completed ✅
- Core mem0 integration
- Database connections (Neo4j, Supabase)
- LLM provider support (Ollama, OpenAI)
- Configuration management
- **Core Infrastructure**: mem0 integration, Neo4j, Supabase, Ollama
- **REST API Endpoints**: All CRUD operations working
- **Authentication System**: Bearer token auth with API keys
- **Rate Limiting**: 100 requests/minute configurable
- **Error Handling**: Comprehensive error responses
- **Testing Suite**: Automated tests for all functionality
- **Docker Deployment**: External access configuration
- **Documentation**: Complete API reference and guides
### In Progress 🚧
- REST API endpoints
- Authentication system
- Rate limiting
- Error handling
### Available Now 🚀
- **Memory Operations**: Add, search, get, update, delete
- **User Management**: User-specific operations and statistics
- **Health Monitoring**: Health checks and system status
- **Admin Operations**: Metrics and system administration
- **External Access**: Docker deployment for remote access
### Planned 📋
- SDK development
- API documentation
- Performance optimization
- Monitoring and logging
### Future Enhancements 📋
- SDK development (Python, JavaScript)
- Advanced caching mechanisms
- Metrics collection and monitoring
- Webhook support for real-time updates
## Quick Testing
Test the API from outside your machine using these working examples:
### 1. Health Check (No Authentication)
```bash
curl http://YOUR_SERVER_IP:8080/health
```
### 2. System Status (With Authentication)
```bash
curl -H "Authorization: Bearer mem0_dev_key_123456789" \
http://YOUR_SERVER_IP:8080/status
```
### 3. Add a Memory
```bash
curl -X POST "http://YOUR_SERVER_IP:8080/v1/memories" \
-H "Authorization: Bearer mem0_dev_key_123456789" \
-H "Content-Type: application/json" \
-d '{
"messages": [{"role": "user", "content": "I love building AI applications with FastAPI"}],
"user_id": "test_user_123",
"metadata": {"source": "external_test"}
}'
```
### 4. Search Memories
```bash
curl "http://YOUR_SERVER_IP:8080/v1/memories/search?query=FastAPI&user_id=test_user_123&limit=5" \
-H "Authorization: Bearer mem0_dev_key_123456789"
```
### 5. Interactive Documentation
Open in your browser: `http://YOUR_SERVER_IP:8080/docs`