-
Notifications
You must be signed in to change notification settings - Fork 52
Open
Description
Describe your use case
Java developers need a simple, practical client example to integrate PowerMem's intelligent memory capabilities into their Java applications. This example will demonstrate how to interact with the PowerMem HTTP API Server using Java's standard HTTP libraries or popular HTTP clients, enabling Java applications to leverage PowerMem's memory management features.
Describe the solution you'd like
Create a simple Java client example that demonstrates:
-
Basic HTTP client setup:
- Configuration for API base URL and API key
- HTTP client initialization (using
java.net.http.HttpClientor similar) - Request/response handling with proper JSON serialization/deserialization
-
Core memory operations:
- Create memory (
POST /api/v1/memories) - Search memories (
POST /api/v1/memories/search) - List memories (
GET /api/v1/memories) - Update memory (
PUT /api/v1/memories/{memory_id}) - Delete memory (
DELETE /api/v1/memories/{memory_id})
- Create memory (
-
Project structure:
- Maven or Gradle project structure
- Main class with example usage
- PowerMem client class
- Request/response model classes (POJOs)
- Configuration management
- Error handling examples
-
Deliverables:
examples/java/directory with:src/main/java/com/powermem/example/- Main example classesPowerMemClient.java- Client wrapper classPowerMemExample.java- Main example demonstrating all operationsmodels/- Request/response model classespom.xmlorbuild.gradle- Build configurationREADME.md- Usage instructions and examples
- Basic error handling
- Example output showing successful operations
The solution should:
- Use Java 11+ (LTS versions)
- Minimize dependencies (prefer standard library, optionally Jackson/Gson for JSON)
- Follow Java best practices and conventions
- Include clear comments and JavaDoc
- Handle 64-bit integer IDs properly (memory_id as String to avoid precision loss)
- Support both JSON request/response handling
- Include example usage in README
Describe alternatives you've considered
- Using Spring Boot or other frameworks - but we want to keep it simple and demonstrate core concepts
- Creating a complete SDK - but that's too complex for a 2-hour coding session
Additional context
- The PowerMem HTTP API Server is already available and documented at
docs/api/0005-api_server.md - Base URL:
http://localhost:8000/api/v1 - API Key authentication via
X-API-Keyheader - All endpoints return JSON responses
- Memory IDs are 64-bit integers that should be handled as strings in JSON to avoid precision loss
Reactions are currently unavailable
Metadata
Metadata
Assignees
Type
Projects
Status
Todo