neurophic-openai-agents
Give an OpenAI Agents SDK agent long-term memory of each user with Neurophic: two tools the model can call, and instructions with the relevant memories already in front of the model.
pip install neurophic-openai-agents
Python 3.10 or later, openai-agents 0.26 or later. The Agents SDK reads OPENAI_API_KEY; the client reads NEUROPHIC_API_KEY.
Tools
import asyncio
from agents import Agent, Runner
from neurophic import AsyncNeurophic
from neurophic_openai_agents import create_tools
client = AsyncNeurophic() # reads NEUROPHIC_API_KEY
memory = create_tools(client, "user-123", name="Ada")
agent = Agent(
name="Travel assistant",
instructions="Use recall before answering and remember what the user shares.",
tools=list(memory),
)
async def main() -> None:
result = await Runner.run(agent, "Remember that I prefer window seats on long flights.")
print(result.final_output)
asyncio.run(main())
create_tools returns remember and recall, scoped to the identifier you pass; the model never chooses whose memory it reads. name is the person's display name, shown in the console. roles, sources and rerank apply to every recall and are set by you. Both clients work: a sync Neurophic is called in a worker thread so the event loop is never blocked. Runner.run_sync works the same way.
remember is queued: the memory is processed in the background, so a recall in the same turn will not see it yet.
If a memory call fails, the model is told that memory is unavailable and the run carries on without it. If the model itself got the arguments wrong, it is told that instead, so it can correct the call.
Instructions with memory
from neurophic import Neurophic
from neurophic_openai_agents import with_context_sync
client = Neurophic()
instructions = with_context_sync(
client,
"user-123",
"Can you find me a flight to Lisbon next month?",
instructions="You are a travel assistant.",
)
For when you build the instructions yourself. with_context is the async form and takes either client; with_context_sync is for sync code with a sync Neurophic. Both return the instructions unchanged when nothing is relevant or the request fails. A template, a function (context, instructions) -> str, replaces the default layout.
License
MIT
Metadata
Release files for neurophic-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 |
|---|---|---|---|---|
| neurophic_openai_agents-0.1.0.tar.gz | 9.2 kB | With provenance | Details for neurophic_openai_agents-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| neurophic_openai_agents-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for neurophic_openai_agents-0.1.0-py3-none-any.whl |
Total release size: 17.3 kB
Release files / neurophic_openai_agents-0.1.0.tar.gz
| Download URL | neurophic_openai_agents-0.1.0.tar.gz |
|---|---|
| Size | 9.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8b1d93be474c6054da62ffb53a145a956f9c3177cd9cacfc08debb22b285ac8b
|
|
BLAKE2b-256 checksum How to use checksums |
a440af77f23daed71ac3dc530850b88b928bf1695304007e3ca7d947ab84be2f
|
| 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 Dec 5, 2026.
Transparency logRelease files / neurophic_openai_agents-0.1.0-py3-none-any.whl
| Download URL | neurophic_openai_agents-0.1.0-py3-none-any.whl |
|---|---|
| Size | 8.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7a9ffa1284956017a744ee0bc5a6a746e5d56445f69279f51206131f433ac4eb
|
|
BLAKE2b-256 checksum How to use checksums |
0998d6b27a3b5bfc6efbede3d2da9b4b08b5324d2f3df31dd8d53133cda0dc7a
|
| 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 Dec 5, 2026.
Transparency logSecurity for neurophic-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
Both files in this release have been uploaded with provenance metadata.
Attestation for neurophic_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 Dec 5, 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.