Overview
The MemMachineClient serves as the unified API for memory management, project operations, and server health checks. It is designed to be the starting point for all interactions with the MemMachine service.
Key Features
- Hierarchical Management: Generate
MemMachineMemory and MemMachineProject instances for scoped operations.
- Resource Discovery: List all projects accessible to your API key.
- Observability: Access Prometheus metrics and perform real-time health checks on the server.
Constructor
new MemMachineClient()
Initializes a new client instance.
Properties
Methods
project()
Creates a MemMachineProject instance for managing a specific project.
getProjects()
Retrieves a list of all projects accessible to the client.
healthCheck()
Checks the current health status of the MemMachine server.
getMetrics()
Retrieves Prometheus metrics from the server in string format.
Usage Example
The following example demonstrates the recommended pattern for initializing the client and traversing to a specific project and memory instance.
For best performance, reuse a single MemMachineClient instance across your application to leverage connection pooling through the internal AxiosInstance.