What LlamaIndex already keeps

Agents keep chat memory buffers, and indexes answer questions over documents you loaded. When a document is revised, a re-index replaces content but doesn’t tell the agent what changed or when.

Where Auld fits

Keep LlamaIndex for document retrieval. Add Auld as a FunctionTool for facts that change — budgets, owners, dates, preferences — and use its validity times when the user asks “as of when?”.

ConcernLlamaIndexAuld
Current conversationYesNot needed
Facts across sessions and channelsYour codeYes
Which fact is current after a changeYour codeYes, with history
What was true on a dateYour codeYes (asOf)
Who may see a memoryYour codeIdentities and audiences
Source for each statementYour codeReturned with every memory

Implementation sequence

  1. Wrap recall

    Create a FunctionTool from a typed function with a clear docstring.

  2. Add an as-of parameter

    Pass an optional ISO date for point-in-time questions.

  3. Combine with a query engine

    Give the agent both the document tool and the memory tool and describe when to use each.

  4. Ingest revisions

    When a source document changes, send the new version with the same sourceId.

Example

memory_client.py — shared helper
import os, requests

AULD = os.environ["AULD_API_BASE"]          # e.g. https://YOUR-AULD-HOST
HEADERS = {"Authorization": f"Bearer {os.environ['AULD_API_KEY']}"}

def auld_post(path: str, body: dict) -> dict:
    r = requests.post(f"{AULD}/v1/{path}", json=body, headers=HEADERS, timeout=30)
    r.raise_for_status()
    return r.json()

def remember(text: str, user_id: str, source_id: str, occurred_at: str) -> str:
    """Store a dated record for one user. Returns the job id."""
    return auld_post("records", {"sourceId": source_id, "text": text,
                                 "occurredAt": occurred_at, "author": user_id,
                                 "visibility": f"user:{user_id}"})["jobId"]

def recall(query: str, user_id: str, max_tokens: int = 2000) -> str:
    """Current memories with sources, formatted for a prompt."""
    res = auld_post("recall", {"query": query, "viewer": user_id, "maxTokens": max_tokens})
    return "\n".join(f"- {m['text']} ({m['sources'][0]['title']}, {m['sources'][0]['occurredAt'][:10]})"
                     for m in res["memories"]) or "No relevant memory."
LlamaIndex wiring
from llama_index.core.tools import FunctionTool
from memory_client import auld_post

def make_memory_tool(user_id: str) -> FunctionTool:
    def recall_facts(question: str, as_of: str | None = None) -> str:
        """Facts about accounts and projects that change over time. Use as_of (YYYY-MM-DD) for past states."""
        body = {"query": question, "viewer": user_id, "maxTokens": 1500}
        if as_of:
            body["asOf"] = as_of + "T23:59:59Z"
        res = auld_post("recall", body)
        return "\n".join(f"{m['text']} [{m['state']}, from {m['validFrom'][:10]}]" for m in res["memories"])
    return FunctionTool.from_defaults(fn=recall_facts)

# agent = FunctionAgent(tools=[docs_tool, make_memory_tool(user.id)], llm=llm)

Illustrative example · standard HTTP · check the framework’s current docs for exact signatures

Or connect the MCP server

If your LlamaIndex setup can use MCP tools, point it at the Auld MCP endpoint instead of writing wrappers. The model gets remember, recall, forget and memory_status. Use wrappers when you need to inject the user id yourself or post-process results; use MCP for speed of setup.

Connect an MCP client →

Custom integration recipe using standard HTTP/MCP tools

  • This recipe wires LlamaIndex’s own tool interface to the Auld REST API or MCP server; there is nothing Auld-specific to install.
  • Bind the viewer id from your authentication layer, not from model output.
  • Ingestion is asynchronous — poll the job before depending on a just-sent fact in tests.
  • Recall returns up to your plan’s token limit (8,000 on Pay as you go and Flex).

Frequently asked questions

When does the agent pick memory over documents?

Describe it in the tool docstring: documents for policies and manuals, memory for what happened with this user or account.

Can I ingest whole documents?

Yes, but split them into meaningful records (sections, versions) so supersession works per fact. See sending data.