recall-openai-agents
Session memory for the OpenAI Agents SDK, backed by Recall by Polign.
The Agents SDK keeps a conversation going across runs through a Session:
the runner reads the history from it before each run and writes the new
items back after. RecallSession is that session over Recall, so the
history lives in the same database as the agent's memory and state, is read
by any process, and is written under a lease so two processes never
interleave writes to one session.
pip install recall-openai-agents
pip also brings the recall binary and polign-server for Linux, macOS
and Windows, so there is no separate database to download.
Usage
from agents import Agent, Runner
from recall_openai_agents import RecallSession
agent = Agent(name="assistant", instructions="Reply briefly.")
session = RecallSession("support-42", local_dir="./recall-data")
result = await Runner.run(agent, "Hi, I am Sam.", session=session)
result = await Runner.run(agent, "What is my name?", session=session)
print(result.final_output) # Sam
Run it twice, or from two processes, and the second run continues the first: the session id is what names the conversation.
What happens:
- Before each run the SDK calls
get_items, which reads the session's record and hands the history back oldest first.get_items(limit=n)returns the latestn. - After each run the SDK calls
add_itemswith the run's new items (the input, the model's messages, tool calls and their outputs). They are appended to the record under the session's lease, which is taken for the write and handed back after it. - Each message, tool call and tool output is also recorded as a turn of a
Recall agent named
oa-<session_id>.agent_resumeon that id, from the Recall MCP tools orpolign_recall.Client.resume, briefs another process with the conversation; the record stays as it was said, sopop_itemandclear_sessionchange what the SDK reads back, not that record. Passrecord_turns=Falseto keep the history only. pop_itemremoves and returns the latest item, andclear_sessionempties the history, as the SDK expects.
RecallSession implements the SDK's Session protocol, so anything that
takes a session takes it: Runner.run, run_sync and run_streamed,
SessionSettings(limit=...), and session_input_callback.
Options
| Option | Default | What it does |
|---|---|---|
client |
none | A polign_recall.Client opened with agent=True, to share one subprocess. Without it, RecallSession opens its own and closes it on close(). |
backend, backend_url, backend_key |
what the recall binary resolves: the environment, the saved setup, or a local database it runs itself |
Where the records live, the same three names as recall -backend, -url and -key (only when RecallSession opens its own client) |
local_dir |
none | Keep the database in this directory and run its server; the short spelling of backend="local", backend_url=... |
env |
process environment | Extra environment for the subprocess, such as RECALL_COLLECTION |
record_turns |
True |
Record each item as a turn of the Recall agent oa-<session_id> as well |
lease_ttl |
10 | Seconds a write's lease lasts if the process dies in the middle of it |
lease_wait |
30 | Seconds a write waits for another process to finish with the session before failing with RecallError code "lease_held" |
Session ids may hold any character; an id Recall cannot use as an agent name
as is (anything outside letters, digits, ., _, -, or longer than 125
characters) is hashed.
Limits
The history of one session is one Recall record, bounded by Recall's output
size of 1 MiB. That is a few thousand ordinary items; a session that grows
past it fails to write, so clear or compact sessions that run that long
(SessionSettings(limit=...) bounds what the model sees, not what is
stored).
The recall binary resolves the database the way the recall command line
does; a RecallSession opened without client and without a database named
uses the local database every agent on the machine shares, under
~/.local/share/recall.
Development
cd python/recall-openai-agents
python -m pip install -e . pytest pytest-asyncio
pytest tests/unit_tests -q # a fake Recall client, real Runner
pytest tests/integration_tests -v # the real recall binary and polign-server
Both suites drive real Runner.run calls with the SDK's ScriptedModel, so
no model API key is needed. Tested against openai-agents 0.24.0.
Metadata
Release files for recall-openai-agents 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| recall_openai_agents-0.1.0.tar.gz | 14.0 kB | With provenance | Details for recall_openai_agents-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| recall_openai_agents-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for recall_openai_agents-0.1.0-py3-none-any.whl |
Total release size: 26.7 kB
Release files / recall_openai_agents-0.1.0.tar.gz
| Download URL | recall_openai_agents-0.1.0.tar.gz |
|---|---|
| Size | 14.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
995b7afe6c0e88dd7db464d48f8ff051e7a61c1dc88e46da92204e768cfb0353
|
|
BLAKE2b-256 checksum How to use checksums |
b0608078c023ca774d71e919bbc8649879b4721f33ace2ecd700d7eeb9a4925a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 3, 2026.
Transparency logRelease files / recall_openai_agents-0.1.0-py3-none-any.whl
| Download URL | recall_openai_agents-0.1.0-py3-none-any.whl |
|---|---|
| Size | 12.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5b5edaeaeee7728aaefae1b62cd16ba3d2b78d78ac2e34bead75062849d8fcb4
|
|
BLAKE2b-256 checksum How to use checksums |
e11e1909dfadbb455e43f9cee3f60734ad32fb86459ccab4e56510ac352d6190
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 3, 2026.
Transparency logSecurity for recall-openai-agents 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for recall_openai_agents-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 3, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.