From AI prototype to credible information system.Explore Go Live Fintech
CrewAI integration

Shared memory for
CrewAI.

Give every agent in a crew the same two tools, and what one agent records is available to the others and to the next run.

Connect once

Install the SDK and CrewAI:

Shell
pip install priostack crewai

One registration per crew is the simplest: the crew is one agent, and its members share its space. Register separate agents when you want per-agent grants and receipts.

Python · connect
import os
from priostack import ACNClient

# First run: no ACN_TOKEN yet, so register once and save the token it prints
# (it is shown once). Later runs: set ACN_TOKEN and ACN_SPACE and the same
# agent finds the same memory.
acn = ACNClient(token=os.environ.get("ACN_TOKEN"))
if not acn.token:
    print("ACN_TOKEN =", acn.register(display_name="crewai-crew").token)
acn.connect()
SPACE_ID = os.environ.get("ACN_SPACE") or acn.create_space("crew-shared-memory").space_id
print("ACN_SPACE =", SPACE_ID)

Two crew tools

Define the tools once with CrewAI's @tool and pass the same list to each Agent. A researcher records a finding, a writer recalls it, and both read the same durable space.

Python · CrewAI tools
from crewai.tools import tool

@tool("Remember Fact")
def remember_tool(fact: str) -> str:
    """Persist a fact to the crew's shared long-term memory."""
    acn.store(SPACE_ID, objects=[{"content": fact, "type": "declaration"}])
    return f"Recorded: {fact!r}"

@tool("Recall Fact")
def recall_tool(topic: str) -> str:
    """Recall facts that contain a word from the crew's shared memory. Pass one word, not a question."""
    return "\n".join(acn.fetch(SPACE_ID, query=topic, limit=5).contents()) or "Nothing recorded yet."

# give the same two tools to every Agent(...) in the crew
memory_tools = [remember_tool, recall_tool]
The runnable version is examples/crewai_memory.py in the SDK repository; it runs in tool-only mode without a model key.

Or connect over MCP

CrewAI's MCPServerAdapter (pip install "crewai-tools[mcp]") hands the network's own tools to an agent. The model then makes the calls: it must call noetic.connect with the saved token first and pass the returned sessionId to every other tool.

Python · MCPServerAdapter
from crewai import Agent
from crewai_tools import MCPServerAdapter

server = {"url": "https://priostack.com/mcp", "transport": "streamable-http"}

with MCPServerAdapter(server) as acn_tools:  # the noetic.* tools
    researcher = Agent(
        role="Researcher",
        goal="Record findings in the crew's memory",
        backstory="Call noetic.connect with the saved token first, then pass the "
                  "returned sessionId to every other noetic tool.",
        tools=acn_tools,
    )
    # build the Crew and kickoff() inside this block, while the connection is open
The network names its tools with a dot, such as noetic.fetch. Several model APIs accept only letters, digits, underscores and hyphens in a tool name. If yours refuses the tool list, use the two crew tools above.

Share it with another crew

Register the second agent separately, so each one has its own token and its own permissions. As the owner, grant it rights on the space. The grant applies at once: noetic.fetch checks it on every call, so the second agent does not need to reconnect. Revoking stops future reads; it cannot take back what was already returned.

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

# fetch checks the grant on every call, so the grantee can read at once
print(worker.fetch(space_id, query="refund").contents())

# immediate, forward-only
owner.revoke_access(grant.capability_ref)
Understand grants and revocation

Questions

What does the memory not do?

It does not embed or rank your facts. It returns what is stored, filtered by a word, and an empty list when nothing matches. What the crew reads back is exactly what a crew member wrote.

Can a crew read another crew's memory?

Only through a grant from that crew's owner, and only with the rights granted.

Inspect the MCP tool schemas

Let your next agent start with context.

Try the memory demo, then connect the tools you already use.

Try the demo

The endpoint is live. Example ids, keys and outputs on this page are samples.