Docs

Give your agent long-term memory. The whole surface is add and recall — write what's worth remembering, pull back only what's relevant at query time.

Quickstart 4 steps

From install to recalling a memory in four steps.

1 · Install

Python and TypeScript SDKs are the primary path. Go is in beta.

python
pip install inra

2 · Initialize a client

Grab an API key from the dashboard, then point the client at it.

from inra import Memory

mem = Memory(api_key="inra_...")

3 · Add a memory

Write anything worth remembering, scoped to an agent and a user. inra handles embedding and storage.

mem.add(
    agent="support-bot",
    user="u_123",
    text="prefers email over phone",
)

4 · Recall at query time

Retrieve only the memories relevant to the current step — not the whole history. Feed the result straight into your prompt.

ctx = mem.recall(
    agent="support-bot",
    user="u_123",
    query="how should I reach them?",
)
print(ctx)  # → ["prefers email over phone"]

Core concepts mental model

inra is a memory layer, not a chat-history log. The design centers on one idea: recall happens at query time, so the model only ever sees what's relevant to the current step.

Memory

A Memory client is your handle to a store. It owns the API key and the connection; everything else flows through add and recall.

add — write

When you add, inra embeds the text and stores it under the agent + user scope you pass. You don't manage vectors or an index yourself — you hand over a string and the scope it belongs to.

recall — read at query time

The core move. Instead of stuffing an entire conversation history into the prompt, you call recall with the current query. inra returns only the memories that match, ranked by relevance. This is what keeps prompts small as history grows.

Namespaces & scope

Every memory lives under a scope — typically agent (which bot) and user (whose memory). Scoping keeps one user's memories out of another's recall, and lets one agent's knowledge stay separate from another's. [draft — namespace filters not frozen]

API reference add · recall

The two calls you'll use every day. Signatures below are the stable core; advanced filters are still being finalized and are marked as draft.

mem.add(...)

Store a memory under an agent + user scope. Returns a memory record.

ParameterTypeRequiredDescription
agentstrrequiredWhich agent this memory belongs to.
userstrrequiredWhose memory this is (end-user scope).
textstrrequiredThe content to remember. inra embeds and stores it.
metadatadictoptionalArbitrary key/value tags for later filtering. [draft — schema not frozen]
record = mem.add(
    agent="support-bot",
    user="u_123",
    text="prefers email over phone",
    metadata={"source": "ticket-4471"},
)

mem.recall(...)

Retrieve the memories most relevant to a query, within a scope. Returns a ranked list.

ParameterTypeRequiredDescription
agentstrrequiredAgent scope to search within.
userstrrequiredUser scope to search within.
querystrrequiredThe current step / question. Recall ranks against this.
limitintoptionalMax memories to return. Default behavior [draft — default not frozen]
ctx = mem.recall(
    agent="support-bot",
    user="u_123",
    query="how should I reach them?",
    limit=5,
)
# → ["prefers email over phone", ...]

[draft — API not frozen] Batch writes, cross-agent sharing, and hard metadata filters are planned for v1. Endpoint URLs and error codes are not published until the API freezes.

Integrations agent frameworks

inra sits behind whatever agent loop you already run. The pattern is the same everywhere: recall before the model call, add after a useful turn.

Drop-in pattern

# before you call the model, pull relevant memory
context = mem.recall(agent="support-bot", user=uid, query=user_msg)

reply = llm.chat(
    system="You are a support agent.",
    context=context,
    message=user_msg,
)

# after a useful turn, remember what matters
mem.add(agent="support-bot", user=uid, text=summarize(reply))

Because the surface is just two calls, wiring inra into an existing framework (a tool-calling loop, a graph, or a plain request handler) is a two-line change: one recall, one add. [draft — framework-specific adapters not published]

Skeleton docs, pre-launch. Signatures marked [draft] are not frozen and may change before v1. Endpoint URLs, rate limits, and error codes are published when the API freezes — we won't invent them here.