LlamaIndex Memory Integration: past dev
past dev is a memory API for AI agents. This package gives a LlamaIndex agent
long-term memory in past dev, as a memory block for the
LlamaIndex Memory class.
- Get: the block does a past dev Recall. The query is the latest user message. The recalled memory goes into the system message, with the date, the kind and the quoted evidence of each entry.
- Put: when the
Memoryflushes old messages from its short-term queue, the block does a past dev Ingest of the user and assistant text, as one data point.
Install
pip install llama-index-memory-pastdotdev
Get a key
- Sign up at past.dev and open a project.
- Make a project API key. It starts with
past_sk_. - Set it in the environment as
PAST_API_KEY, or give it to the block asapi_key.
Use
from llama_index.core.agent.workflow import FunctionAgent
from llama_index.core.memory import Memory
from llama_index.llms.openai import OpenAI
from llama_index.memory.pastdotdev import PastDevMemoryBlock
memory = Memory.from_defaults(
session_id="session-42",
token_limit=30000,
memory_blocks=[
PastDevMemoryBlock(
identity=current_user.id, # your id for the end user, from your own user record
)
],
)
agent = FunctionAgent(tools=[], llm=OpenAI(model="gpt-4.1-mini"))
response = await agent.run("How should you contact me?", memory=memory)
The identity
past dev keeps memory per identity: your id for the end user. Recall needs an identity, and the first ingest for an identity creates it.
Set identity in your code, from your trigger or your user record. Do not let
the model choose it. The block has no tool and no prompt that can change the
identity, so each user reads and writes only their own memory.
Parameters
| Parameter | Default | Description |
|---|---|---|
identity |
(required) | Your id for the end user. |
api_key |
PAST_API_KEY |
A past dev project API key (past_sk_...). |
api_host |
PAST_API_HOST, else https://api.past.dev |
The API base URL. Change it only if you run past dev in your own cloud. |
audience |
none | The audience slug for ingested memory. Without it, the memory is visible to the project. |
level |
low (on the server) |
The recall evidence budget: low, medium, high or extra-high. |
max_tokens |
none | An explicit recall evidence budget in tokens. Use level or max_tokens, not both. |
limit |
100 (on the server) | The maximum number of recalled documents. |
label |
LlamaIndex chat |
The label of each ingested data point. |
name |
past_dev_memory |
The name of the block in the memory template. |
priority |
0 |
The BaseMemoryBlock truncation priority. 0 means never truncate. |
raise_on_error |
True |
When False, the block logs an API error and continues without memory. |
What the block sends
- Recall (
POST /api/v1/recall):query(the latest user message),identity, andlevel,maxTokensorlimitif you set them. - Ingest (
POST /api/v1/ingest):content(the flushed user and assistant messages asrole: textlines; system and tool messages are not sent),identity,timestamp,label,audienceif you set it, andmetadatawith{"source": "llama-index", "sessionId": ...}.
The timestamp is the timestamp of the first flushed message, if your
application puts one in message.additional_kwargs["timestamp"]. Otherwise it
is the time of the flush.
Credits
Each recall and each ingest spends credits on your past dev plan. The block
recalls once each time the agent reads its memory, and ingests once each time
the Memory flushes messages.
Errors
An API error raises PastDevError, with the error code, the HTTP status,
the message and the X-Request-Id of the request. The block retries a 429
once, after its Retry-After delay. It does not retry other errors, for
example 402 out-of-credits or a 400.
Links
- Quickstart
- API reference
- LlamaIndex memory guide
- Tools for the same API:
llama-index-tools-pastdotdev
License
MIT. See LICENSE.
Metadata
Release files for llama-index-memory-pastdotdev 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 | |
|---|---|---|---|---|
| llama_index_memory_pastdotdev-0.1.0.tar.gz | 12.2 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| llama_index_memory_pastdotdev-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 22.4 kB
Release files / llama_index_memory_pastdotdev-0.1.0.tar.gz
| Download URL | llama_index_memory_pastdotdev-0.1.0.tar.gz |
|---|---|
| Size | 12.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
680c8996e68ff80faf7da9c6dec96d92c55bf3879db0b8616e3206e82c7ac10d
|
|
BLAKE2b-256 checksum How to use checksums |
5afd19eacd0783e5662c9f299c54a39dec0b4c22cff678138dba26a4600decbd
|
| 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 Oct 22, 2026.
Transparency logRelease files / llama_index_memory_pastdotdev-0.1.0-py3-none-any.whl
| Download URL | llama_index_memory_pastdotdev-0.1.0-py3-none-any.whl |
|---|---|
| Size | 10.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1b2db3d9ca1c6fc516c388d762a7f0f0f1b1dd886f4f896c1fc93d9dfcef8b0a
|
|
BLAKE2b-256 checksum How to use checksums |
0826d169e968de035e7456dba34193545622b66da0188c518f46b3810ed871f3
|
| 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 Oct 22, 2026.
Transparency logSecurity for llama-index-memory-pastdotdev 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
All 2 files in this release have been uploaded with provenance metadata.
Attestation for llama_index_memory_pastdotdev-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 Oct 22, 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.