# ebbmem-client
Rust client for the Ebb memory HTTP API. Version 0.2.0. Homepage: https://ebbmem.ai.
This crate is not yet published. When it is, install it from the package registry:
```toml
ebbmem-client = "0.2.0"
```
## Quickstart
```rust
let client = EbbmemClient::builder().build()?; // reads EBBMEM_ORIGIN and EBBMEM_TOKEN
let stored = client.memory().remember("the harbor light is cobalt", None, None, None, None).await?;
let found = client.memory().recall("harbor light", None, None).await?;
```
`EbbmemClient::builder()` configures the client. Calls are async and use reqwest through the generated client.
## Auth
`EBBMEM_ORIGIN` is required. There is no default origin. `EBBMEM_TOKEN` is sent as `Authorization: Bearer`. `EBBMEM_API_KEY` is sent as `X-API-Key`. `EBBMEM_NAMESPACE` is sent as `X-Ebb-Namespace`. An explicit builder argument overrides the matching environment variable. `Debug` does not include the token.
## Methods
`client.memory()` exposes `remember`, `remember_batch`, `recall`, `recall_federated`, `get`, `list`, `update`, `forget`, `reinforce`, `reflect`, `why_not`, and `status`. `client.tasks()` exposes `get`, `list`, and `cancel`. `client.events().stream` calls the SSE operation. `client.health` calls the health endpoint.
## Errors and retries
Failures return `EbbmemError` (`status`, `code`, `message`, `details`, `request_id`) wrapped as `AuthError` (401/403), `NotFoundError` (404), `ValidationError` (400/422), `RateLimitError` (429), `ServerError` (5xx), or `ConnectionError`.
The client retries connection errors, 429, and 502/503/504. The generated response error does not include headers, so Rust retries 429 with exponential backoff and does not read `Retry-After` or `X-Request-ID`. Retries apply to idempotent methods, and to `remember` / `remember_batch` when an idempotency key is set. `max_retries` defaults to 2. The timeout defaults to 30 seconds. The user agent is `ebbmem-client-rust/0.2.0`.
## Pagination
`memory().list(limit)` returns a cursor iterator. Call `next` until it returns `None`.
## Events
`events().stream(token)` calls the generated events operation. Pass the query token only when the stream must authenticate that way. The generated client materializes the body.
## Raw API
`client.raw()` returns the generated `Configuration` used by the API functions.
## License
Proprietary, (c) Spectrayan.