ampup-memory
A thin Python client for an AmpUp Memory server: write what your team
knows, search it, and read it back. One class, no codegen, and its only dependency is httpx.
pip install ampup-memory
Quickstart
from datetime import datetime, timezone
from ampup_memory import AmpUpMemory, micros
mem = AmpUpMemory.from_profile() # the CLI's current context; or AmpUpMemory.from_profile("work")
# mem = AmpUpMemory("https://memory.example.com", "msk_...", org="acme") # an explicit API key
# mem = AmpUpMemory("http://127.0.0.1:8080", None) # a local `ampup-memory serve --local`
ep = mem.remember("note:acme", "The Acme renewal is owned by Priya.")
print(mem.episode(ep["episode_id"]))
print(mem.search("who owns the Acme renewal", k=5))
print(mem.query({"find": "passages", "text": "Acme renewal"})["results"])
mem.ingest([{"source": "email:1", "body": "...", "occurred_at": micros(datetime.now(timezone.utc)), "acl": ["group:sales"]}])
from_profile() uses the context and sign-in that ampup-memory-client join <server> --org <org> saved, in
AMPUP_MEMORY_CONFIG_DIR (default ~/.ampup-memory). It picks the context from its argument, then
AMPUP_MEMORY_CONTEXT, then the current one, and renews an expiring sign-in with the saved refresh token, writing
it back where the CLI reads it.
Methods
| Method | Route | Returns |
|---|---|---|
AmpUpMemory(server, token, *, org, team, timeout) |
token may be None for a local server |
|
AmpUpMemory.from_profile(context=None) |
a client for a CLI context | |
me() |
GET /me |
who you are: user, groups, scope, memberships |
ingest(episodes) |
POST /ingest |
every episode id; sent in batches of 500; needs an ingest or admin key |
remember(source, body, *, acl, document) |
POST /remember |
{episode_id, scope, readers}, or {queued, message} |
forget(episode_id) |
POST /forget |
the forgotten id |
search(query, k=10) |
POST /search |
a list of fact hits |
query(q) |
POST /query |
a query-language result (find: entities, facts, count, changes, passages, schema, metrics) |
episode(episode_id) |
POST /episode |
the episode's text, or None |
micros(datetime) |
occurred_at in microseconds since the epoch |
Every failure raises AmpUpMemoryError with status, message and, on a 429, retry_after. An error the
server reports inside a row (a bad query, say) raises it too, with status 200.
The TypeScript client with the same methods is @ampup/memory.
License
Apache-2.0.
Metadata
Release files for ampup-memory 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 | Actions |
|---|---|---|---|---|
| ampup_memory-0.1.0.tar.gz | 10.1 kB | Without provenance | Details for ampup_memory-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ampup_memory-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for ampup_memory-0.1.0-py3-none-any.whl |
Total release size: 22.1 kB
Release files / ampup_memory-0.1.0.tar.gz
| Download URL | ampup_memory-0.1.0.tar.gz |
|---|---|
| Size | 10.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f9b9278071d897b914ccf11c6313dd782063f6bd28a3e777faebb2d29a787a45
|
|
BLAKE2b-256 checksum How to use checksums |
e41507c4bc77db6a0632005c6af9fb57b355406ee627a8cf860baa4b98a6cbd5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / ampup_memory-0.1.0-py3-none-any.whl
| Download URL | ampup_memory-0.1.0-py3-none-any.whl |
|---|---|
| Size | 12.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0e741880b816ccd7ef33146292b2bd71f02cbc0296bf571955e06d73f9f856b9
|
|
BLAKE2b-256 checksum How to use checksums |
32f8d0985711f772e2522cf7fa88a1df16a773365d088613ad4c3d13fd39df16
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Security for ampup-memory 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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A 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.
To learn more about protecting yourself from malicious actors, visit our package security documentation.