Session Model
One token = one session
Section titled “One token = one session”POST /api/demo/token creates an anonymous token. That token owns one demo session and one temporary MRHI index.
The session response includes:
sessionIdcreatedAtupdatedAtlastAccessedAtexpiresAtttlMsRemaininginitializedvectorCountmaxVectorsconfig.dimensionsconfig.metricconfig.vectorTypeconfig.backend
Initialization rules
Section titled “Initialization rules”When a session is new:
initializedisfalsedimensionsisnullmetricisnull
The first successful add or add-many call initializes the session.
Dimension rules
Section titled “Dimension rules”- Dimensions must be greater than
0 - Dimensions cannot exceed
1024 - All vectors in one add request must use the same length
- All query vectors in one search-many request must use the same length
- After initialization, future adds and searches must match the session dimension
If you want to switch dimensions while keeping the same token:
curl https://mrhisearch.com/api/demo/index/reset \ -X POST \ -H 'authorization: Bearer mrhi_demo__YOUR_TOKEN'Metric rules
Section titled “Metric rules”Supported metrics:
cosinel2
Once a session is initialized, the metric is locked for that session. To switch metrics, reset the index and add vectors again.
clear vs reset
Section titled “clear vs reset”POST /vectors/clear
- removes all vectors
- keeps the same session
- keeps the configured dimensions + metric
POST /index/reset
- deletes the whole index
- resets dimensions + metric
- lets the token start fresh
Expiration
Section titled “Expiration”Sessions expire after the configured inactivity TTL. When a session expires:
- the token becomes invalid
- the stored index is deleted
- the caller must request a new token
The exact deployed TTL is exposed by GET /api/demo/limits.