LlamaIndex
Add Suprflo long-term memory to LlamaIndex retrievers and agents. Ships in the Python SDK.
Install
bash
pip install "suprflo[llamaindex]"Targets llama-index-core >= 0.11.
What you get
All three are built on the Python SDK MemoryClient:
SuprfloMemory— a long-term memory that saves chat messages to Suprflo and recalls relevant ones asChatMessages. Duck-types theBaseMemorymethod names (put,get,get_all,set,reset) rather than subclassing it, so it isn't pinned to one narrow version range.SuprfloRetriever— aBaseRetrieverthat returns memories asNodeWithScorefor RAG / query engines.create_memory_tools(client, user_id)— LlamaIndexFunctionTools (save_memory,search_memory) to drop into an agent.
Memory
python
from llama_index.core.llms import ChatMessage
from suprflo import MemoryClient
from suprflo.integrations.llamaindex import SuprfloMemory
client = MemoryClient(api_key="YOUR_API_KEY")
memory = SuprfloMemory(client=client, user_id="alice")
memory.put(ChatMessage(role="user", content="I love hiking"))
memory.get("hobbies") # -> [ChatMessage(role=SYSTEM, content="loves hiking")]SuprfloMemory is a long-term memory, not a chat buffer. Suprflo stores derived memories rather than raw turns, so two things differ from ChatMemoryBuffer:
get_all()returns Alice's distilled memories, not verbatim chat history — don't use it to replay an exact transcript.get(input)returns memories relevant toinput, not the tail of the conversation. With noinputit falls back toget_all().
Retriever for RAG
python
from suprflo.integrations.llamaindex import SuprfloRetriever
retriever = SuprfloRetriever(client=client, user_id="alice", top_k=5)
nodes = retriever.retrieve("dietary restrictions") # [NodeWithScore, ...]Each memory becomes a TextNode (memory id as id_, Suprflo metadata as metadata) wrapped in a NodeWithScore carrying the relevance score.
Tools for an agent
python
from suprflo.integrations.llamaindex import create_memory_tools
tools = create_memory_tools(client, user_id="alice") # [save_memory, search_memory]
# add `tools` to your LlamaIndex agent's toolsetIf
llama-index-coreisn't installed, importing this module raises a clearImportErrortelling you topip install "suprflo[llamaindex]".