Skip to Content
Nenavi CloudQuick start

Quick start

This page takes you from a new project to a stored and retrieved memory. You need an invitation to the early-access alpha. If you do not have one yet, join the waitlist .

1. Create a project

  1. Open the console at app.nenavi.com  and sign in, or follow your invitation link.
  2. On your first visit, the console asks you to name your organization.
  3. Create your first project. The alpha allows up to 10 projects per organization.

Only organization owners can create projects and keys. If you are a member, ask an owner.

2. Create an API key

  1. Open the project and choose API keys.
  2. Choose Create API key and give the key a name. The first step of Get started on the project’s overview opens the same dialog.
  3. Copy the full key. The console shows it once and cannot show it again.

A project can have up to 5 active keys in the alpha. Keys start with prm_live_. A revoked key stops working within a minute.

Keep the key secret. Do not put it in a repository, a log, or a ticket. These examples read it from an environment variable. NENAVI_API_KEY is only a name for these examples. The service does not read it, so you can use any name.

export NENAVI_API_KEY="<paste your API key>"

3. Store a memory

The base URL is https://api.prismemory.com. The hosted API keeps this address for now. Every request sends the key as a bearer token and names a user_id.

curl -sS -w '\n' https://api.prismemory.com/v1/store \ -H "Authorization: Bearer $NENAVI_API_KEY" \ -H "content-type: application/json" \ -d '{"content": "Alex prefers concise explanations.", "user_id": "alex"}'

The answer comes back at once with an event_id, a node_id, and a processing_status. Its processing_status.status is complete. A few seconds later, the service extracts entities and claims from the text in the background. That extraction counts as one ingest call against your monthly limit. To store the text as it is, with no extraction, add "extract": false to the body.

4. Retrieve what matters

curl -sS -w '\n' https://api.prismemory.com/v1/retrieve \ -H "Authorization: Bearer $NENAVI_API_KEY" \ -H "content-type: application/json" \ -d '{"query": "How should I explain this to Alex?", "user_id": "alex", "limit": 3}'

The first item in results is the sentence you stored. The answer also holds a packed context (bundle) that you can put in a model prompt, and metrics.

The same calls in Python

The PRME MemoryClient runs the engine on your machine and does not call Nenavi Cloud. Use plain HTTP:

# pip install httpx import os import httpx client = httpx.Client( base_url="https://api.prismemory.com", headers={"Authorization": f"Bearer {os.environ['NENAVI_API_KEY']}"}, timeout=30, ) stored = client.post( "/v1/store", json={"content": "Alex prefers concise explanations.", "user_id": "alex"}, ) stored.raise_for_status() found = client.post( "/v1/retrieve", json={"query": "How should I explain this to Alex?", "user_id": "alex", "limit": 3}, ) found.raise_for_status() for result in found.json()["results"]: print(f"{result['score']:.3f}", result["content"])

Import a batch that is safe to retry

POST /v1/store and POST /v1/ingest are not safe to retry. If a request times out and you send it again, the text is stored twice and extracted twice, and both count against your limits.

To import text that you may need to send again, use POST /v1/ingest/fast with an Idempotency-Key header. Make one new UUID for each batch, and send the same one with every retry of that batch. A retry then returns the first attempt’s event_ids and stores nothing new.

BATCH_KEY=$(uuidgen) curl -sS -w '\n' --retry 3 https://api.prismemory.com/v1/ingest/fast \ -H "Authorization: Bearer $NENAVI_API_KEY" \ -H "content-type: application/json" \ -H "Idempotency-Key: $BATCH_KEY" \ -d '{"items": [{"content": "Alex moved to Lisbon in May."}], "user_id": "alex"}'

Fast ingest saves the text for retrieval and runs no extraction. Using the same key with different items is a 409 error.

Notes

  • user_id is yours. It names one of your end users. The service does not check it, so your code must send the right one. Memory is always private to the project, whatever user_id you send.
  • Retrieved memory is untrusted input. Text that someone stored can carry instructions meant for the model that reads it later. Treat retrieved text as data in your prompt, not as instructions.
  • See what is stored. The project’s Memory tab in the console shows a project’s memories as an overview, a list, and a graph. It asks you to paste one of the project’s keys, keeps it in the page only, and forgets it after 15 minutes of no use.
  • Next: read The API for how the hosted routes differ from PRME, and Limits and errors before you load a lot of data.
Last updated on