Lightweight client + LangChain/LangGraph adapters for memnos — backend memory for AI agents.
Project description
memnos-sdk
Lightweight Python client for memnos — governed, vendor-neutral backend memory for AI agents. Use it directly, or as a LangChain retriever, a LangGraph long-term-memory store, or a LlamaIndex retriever.
httpx-only (no server deps). Talks to a running memnos server over REST.
Add it to your project with uv (or plain pip — it's an importable library, not a CLI app):
uv pip install memnos-sdk # core client (or: pip install memnos-sdk)
uv pip install 'memnos-sdk[langchain]' # + LangChain retriever
uv pip install 'memnos-sdk[langgraph]' # + LangGraph BaseStore
uv pip install 'memnos-sdk[llamaindex]' # + LlamaIndex retriever
uv pip install 'memnos-sdk[all]' # everything
Core client (sync + async)
from memnos_sdk import MemnosClient
with MemnosClient(base_url="http://127.0.0.1:8900", token="mnk_...", namespace="org:acme") as mem:
mem.remember("We chose PostgreSQL + pgvector for the memory store")
ctx = mem.context("what database did we choose?") # ready-to-inject; no LLM at query time
rows = mem.recall("database decision")["memories"] # ranked memories w/ scores + dates
from memnos_sdk import AsyncMemnosClient
async with AsyncMemnosClient(token="mnk_...", namespace="org:acme") as mem:
await mem.remember("...")
print(await mem.context("..."))
A token + namespace come from your memnos admin (memnos token <principal>,
memnos grant <principal> <namespace>). Every call is namespace-scoped and audited
server-side.
LangChain
from memnos_sdk import MemnosClient
from memnos_sdk.integrations.langchain import MemnosRetriever
retriever = MemnosRetriever(client=MemnosClient(token="mnk_...", namespace="org:acme"))
docs = retriever.invoke("auth token expiry policy") # drop into any RAG chain
retriever.save("JWT tokens expire after 15 minutes in prod")
LangGraph (long-term memory)
from memnos_sdk import MemnosClient
from memnos_sdk.integrations.langgraph import MemnosStore
store = MemnosStore(MemnosClient(token="mnk_..."))
graph = builder.compile(store=store)
# in a node: store.search(("org","acme"), query="...") · store.put(("org","acme"), key, {"text": "..."})
memnos is semantic memory: put→remember, search→hybrid+reranked recall. Exact-key
get is best-effort (use search).
LlamaIndex
from memnos_sdk import MemnosClient
from memnos_sdk.integrations.llamaindex import MemnosRetriever
retriever = MemnosRetriever(client=MemnosClient(token="mnk_...", namespace="org:acme"))
nodes = retriever.retrieve("auth token expiry policy") # NodeWithScore[]; drop into a query engine
retriever.save("JWT tokens expire after 15 minutes in prod")
API surface
remember(text) · recall(query) -> {memories, context} · context(query) -> str ·
consolidate() · feedback(query, helpful) · healthy(). Async mirror on
AsyncMemnosClient.
Apache-2.0.
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 memnos_sdk-0.1.3.tar.gz.
File metadata
- Download URL: memnos_sdk-0.1.3.tar.gz
- Upload date:
- Size: 9.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ccff110d88369c151fd1b414dabac1b9a51c4a23365633a534445d58b19cf139
|
|
| MD5 |
9c4eb71c011393b2c22d0257f1715cdd
|
|
| BLAKE2b-256 |
d8c88e875f4bfe6a5dd1d17973c6546d03c4fd5ea69c04e05d30235655a7fffc
|
Provenance
The following attestation bundles were made for memnos_sdk-0.1.3.tar.gz:
Publisher:
release.yml on thameema/memnos
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
memnos_sdk-0.1.3.tar.gz -
Subject digest:
ccff110d88369c151fd1b414dabac1b9a51c4a23365633a534445d58b19cf139 - Sigstore transparency entry: 1774330680
- Sigstore integration time:
-
Permalink:
thameema/memnos@9e81e0403a08bad39ae4ab123cef1b7a688bb3dd -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/thameema
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@9e81e0403a08bad39ae4ab123cef1b7a688bb3dd -
Trigger Event:
release
-
Statement type:
File details
Details for the file memnos_sdk-0.1.3-py3-none-any.whl.
File metadata
- Download URL: memnos_sdk-0.1.3-py3-none-any.whl
- Upload date:
- Size: 8.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7c52bd3a48f638629fb8a166322043ee606ab81c2da02ece6f1af26161584736
|
|
| MD5 |
f023b2cb83048e83781c92db53dae3a9
|
|
| BLAKE2b-256 |
d71f945f8e259439567311327354196c9c635b8cfc3898c8a3e44c4bd3f31566
|
Provenance
The following attestation bundles were made for memnos_sdk-0.1.3-py3-none-any.whl:
Publisher:
release.yml on thameema/memnos
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
memnos_sdk-0.1.3-py3-none-any.whl -
Subject digest:
7c52bd3a48f638629fb8a166322043ee606ab81c2da02ece6f1af26161584736 - Sigstore transparency entry: 1774330779
- Sigstore integration time:
-
Permalink:
thameema/memnos@9e81e0403a08bad39ae4ab123cef1b7a688bb3dd -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/thameema
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@9e81e0403a08bad39ae4ab123cef1b7a688bb3dd -
Trigger Event:
release
-
Statement type: