llama-index-memory-gnarl
Gnarl agent memory for LlamaIndex: a memory block for the
Memory API and a retriever. Thin wrappers over the published
gnarl-client; the node embeds, so
there is no embedding model to configure.
pip install llama-index-memory-gnarl
With no address configured, the client finds the node itself: $GNARL_URL,
else the endpoint the node on this machine recorded, else the Gnarly app's
http://127.0.0.1:43300. Pass a client to point anywhere else.
from llama_index.core.memory import Memory
from llama_index.core.agent.workflow import FunctionAgent
from llama_index.memory.gnarl import GnarlMemoryBlock
block = GnarlMemoryBlock(namespace="agent-memory", user="alice")
await block.aremember("Alice is vegetarian") # store a fact directly
memory = Memory.from_defaults(session_id="thread-42", memory_blocks=[block])
agent = FunctionAgent(llm=llm, tools=[])
await agent.run("Suggest a dinner for me", memory=memory) # recalls "vegetarian"
GnarlMemoryBlock
GnarlMemoryBlock(client=None, namespace=None, space=None, user=None, session=None, k=5, min_score=None, retrieval_context_window=1, store_roles=[USER, ASSISTANT], require_complete=False, name="GnarlMemory", priority=0)
- get: recalls the
kmemories most relevant to the latestretrieval_context_windowmessages and returns them as- …lines, whichMemoryplaces in its memory-blocks template. - put:
Memoryhands a block the messages it flushes out of short-term history (when the token limit is reached). Each user/assistant message is stored as one memory with itssession. To store every turn immediately, callblock.aput(messages)yourself, oraremember(text)for a single fact. - Recall is scoped to
userby the node, and spans all sessions unlesssessionis set. - If part of the memory space did not answer, the text ends with a note saying
memories may be missing;
require_complete=TrueraisesIncompleteRecall.
GnarlRetriever
GnarlRetriever(client=None, *, async_client=None, namespace=None, space=None, user=None, session=None, k=4, require_complete=False)
A BaseRetriever returning NodeWithScores whose metadata carries score,
knn_score, fact_type, session, agent, created, tags, namespace,
partial and coverage. Usable anywhere LlamaIndex takes a retriever, e.g.
RetrieverQueryEngine.from_args(GnarlRetriever(user="alice")).
Development
pip install -e '.[dev]'
ruff check . && mypy && pyright
pytest tests/unit
GNARL_URL=http://127.0.0.1:<port> pytest tests/integration # a throwaway test node; skipped when unset
Licensed under Apache-2.0.
Metadata
Release files for llama-index-memory-gnarl 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 | |
|---|---|---|---|
| llama_index_memory_gnarl-0.1.0.tar.gz | 16.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| llama_index_memory_gnarl-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 31.3 kB
Release files / llama_index_memory_gnarl-0.1.0.tar.gz
| Download URL | llama_index_memory_gnarl-0.1.0.tar.gz |
|---|---|
| Size | 16.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
018f7ffec9cde28df767eff0e7761993359d63f348780c61d96fa44f80d9b8f6
|
|
BLAKE2b-256 checksum How to use checksums |
8f29e707cfabaf2ddfbde74ab7506d634410b908a3322b49059ec6ff4b6b288d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 11, 2026.
Transparency logRelease files / llama_index_memory_gnarl-0.1.0-py3-none-any.whl
| Download URL | llama_index_memory_gnarl-0.1.0-py3-none-any.whl |
|---|---|
| Size | 15.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f089cb0bf30e4d423dee8e7eee5895f5076535acf14b73f890689948c960f17e
|
|
BLAKE2b-256 checksum How to use checksums |
948b73d8f03f133bc4849ea080210de7c5480339d925137fc85f3e65924ff278
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 11, 2026.
Transparency log