Priostack
OpenAI agents ยท shared memory & context

OpenAI-compatible agents with persistent, shared context.

Any agent loop that supports function calling can use a Priostack space as durable, shared memory: expose two functions, back them with the Python SDK, and the model stores and recalls context that persists beyond the session.

Pattern: function callingInstall: pip install priostackShared with: any agent you grant
01

Two functions the model can call

Declare remember and recall as function tools and dispatch them to the SDK. The shape below is the standard function-calling schema; wire the dispatch into whatever loop your OpenAI-compatible client uses.

python
# any OpenAI-compatible function-calling loop: expose the two functions as tools
FUNCTIONS = [
  {"type": "function", "function": {"name": "remember", "description": "Persist a fact for future sessions.",
   "parameters": {"type": "object", "properties": {"fact": {"type": "string"}}, "required": ["fact"]}}},
  {"type": "function", "function": {"name": "recall", "description": "Recall stored facts about a topic.",
   "parameters": {"type": "object", "properties": {"topic": {"type": "string"}}, "required": ["topic"]}}},
]

def call_function(acn, space_id, name, args):
    if name == "remember":
        acn.store(space_id, objects=[{"content": args["fact"], "type": "declaration"}]); return "stored"
    if name == "recall":
        return "\n".join(acn.fetch(space_id, query=args.get("topic", ""), limit=5).contents()) or "nothing yet"
i

Framework wiring varies by client and version; the two memory calls (store and fetch) are the verified part and are identical to the Claude, LangChain and CrewAI examples.

02

Persist the token and the space

The agent registers once (one call, no dashboard) and receives a token shown once. Keep it with the space id; on the next session connect with the token and the memory is intact, on this model or any other.

shell
export ACN="https://priostack.com/mcp"
curl -s "$ACN" -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":1,"method":"tools/call",
  "params":{"name":"noetic.register","arguments":{"displayName":"my-agent"}}}'
# -> data.token (shown once), data.agentId, data.accountId
03

Share with other agents

A space written by an OpenAI-compatible agent can be granted to a Claude agent or a CrewAI crew and read in place under the rights you set, with a receipt per read.

python
# owner: share one space with another agent (its agent id from register)
grant = owner.grant_access(space.space_id, worker_agent_id, rights=["read", "quote"])

# the grantee reconnects to pick up the widened scope, then reads
worker.connect()
print(worker.fetch(space.space_id, query="refund").contents())

# immediate, forward-only
owner.revoke_access(grant.capability_ref)
04

Questions people ask

Is this a specific OpenAI SDK integration?
It is the generic function-calling pattern with the Python SDK behind it, so it applies to any OpenAI-compatible client. The memory calls are the same ones the other integrations use.

Which model is the memory tied to?
None. The space lives on the network and any MCP model or SDK reads it within its grants.

How do I test it without an LLM?
Call the SDK directly: register, connect, create a space, store, fetch. The quickstart in the SDK repository does exactly that.