Give your OpenAI Agents SDK agent a June memory — wrap any Session to mirror conversations into a searchable, cited June knowledge canvas, add a memory-search tool, and backfill existing session databases.
Project description
june-openai-agents
Give your OpenAI Agents SDK agent a June memory. The SDK's Sessions are built for resuming a conversation — long-term, searchable memory is left as an exercise. This package closes the loop on both sides against Junê: conversations flow into a local-first, searchable, cited knowledge graph as your agent runs, and the agent can search that memory back while answering.
Runner ──▶ JuneSession (wraps your Session) ──▶ June canvas ◀── june_memory_tool
writes as the agent runs graph · cited the agent reads back
Write side — wrap the session you already use
pip install june-openai-agents
from agents import Agent, Runner, SQLiteSession
from june_openai_agents import JuneSession
session = JuneSession(
SQLiteSession("thread-42", "conversations.db"), # any Session works
june_url="http://127.0.0.1:8799", # the Junê desktop app's local engine
api_key="local",
canvas="agent-memory",
state_file=".june_oai_pending.json", # retry buffer, survives restarts
)
result = await Runner.run(agent, "hello", session=session)
JuneSession satisfies the SDK's runtime-checkable Session protocol —
attributes included — so the Runner can't tell the difference. Every
operation delegates to your real session first; each batch of new items then
mirrors to June while they're still live dicts. Fail-soft: June being
down never breaks a run — unmirrored items go to a persisted pending buffer
and flush on the next add (strict=True raises instead). Tool-call frames,
reasoning items and empty turns are filtered out — only conversation becomes
memory. JuneSession.from_env(inner) reads the same JUNE_BASE_URL /
JUNE_API_KEY / JUNE_CANVAS env vars as june-mcp.
Read side — one tool and the agent can recall
from agents import Agent
from june_openai_agents import june_memory_tool
agent = Agent(
name="assistant",
instructions="Use june_memory_search before answering questions about "
"prior conversations or saved knowledge.",
tools=[june_memory_tool()], # env-var config by default
)
The tool searches the same canvas the session writes into and returns matched knowledge as plain lines the model can ground on.
Backfill — history your app already saved
june-openai-agents sync --db conversations.db # one incremental pass
june-openai-agents watch --db conversations.db # keep syncing (Ctrl+C stops)
june-openai-agents doctor --db conversations.db # PASS/FAIL the setup
Discovery is metadata-only SQL (which session ids exist); content is
always read through the SDK's own SQLiteSession, so the SDK decodes its
stored items — never us. Every pass is incremental via a per-item ledger;
re-running never duplicates, and even a forced re-push is folded by June's
read-side dedup.
What you get on the June side
The canvas behaves like any other: search it, ask cited questions over it in the Junê app, and point june-mcp at the same canvas so Claude can answer over your agent's entire history.
Part of a family: june-langgraph (LangGraph checkpointers) and june-adk (Google ADK's MemoryService) do the same for their frameworks.
License
MIT. The Junê engine itself is a separate, closed-source product — this connector is the open part, by design.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file june_openai_agents-0.1.0.tar.gz.
File metadata
- Download URL: june_openai_agents-0.1.0.tar.gz
- Upload date:
- Size: 16.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
350dbfb3bf21ade2d2c24758403d9cf8021ec7ed07a9d4ae5c31e787b8869ee2
|
|
| MD5 |
0edabba5083b60a419af01b0df375002
|
|
| BLAKE2b-256 |
07fd6d92be195a4373e41e4deee8e30e147a02795279220ad136e9077de4886e
|
Provenance
The following attestation bundles were made for june_openai_agents-0.1.0.tar.gz:
Publisher:
publish.yml on Junemind/june-openai-agents
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
june_openai_agents-0.1.0.tar.gz -
Subject digest:
350dbfb3bf21ade2d2c24758403d9cf8021ec7ed07a9d4ae5c31e787b8869ee2 - Sigstore transparency entry: 2310531140
- Sigstore integration time:
-
Permalink:
Junemind/june-openai-agents@f9e9a1d25eb583020e1bb2c8d87113de79c414e3 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Junemind
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f9e9a1d25eb583020e1bb2c8d87113de79c414e3 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file june_openai_agents-0.1.0-py3-none-any.whl.
File metadata
- Download URL: june_openai_agents-0.1.0-py3-none-any.whl
- Upload date:
- Size: 16.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
59afc3ca9c0c837f7d5c9846e14d29a45098ad2023e6c12783e434251dd17f2f
|
|
| MD5 |
eb8de9aa957dfab98ec6754e46d51ad0
|
|
| BLAKE2b-256 |
f866c7fa05dd22b2acd85b1638c616cd0950d90ccbbbc4a9ca2b1c7779ba99bd
|
Provenance
The following attestation bundles were made for june_openai_agents-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on Junemind/june-openai-agents
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
june_openai_agents-0.1.0-py3-none-any.whl -
Subject digest:
59afc3ca9c0c837f7d5c9846e14d29a45098ad2023e6c12783e434251dd17f2f - Sigstore transparency entry: 2310531168
- Sigstore integration time:
-
Permalink:
Junemind/june-openai-agents@f9e9a1d25eb583020e1bb2c8d87113de79c414e3 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Junemind
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f9e9a1d25eb583020e1bb2c8d87113de79c414e3 -
Trigger Event:
workflow_dispatch
-
Statement type: