Long-term memory for AI agents — a Python client for the Parcle Memory API.
Project description
Parcle
Long-term memory for AI agents
Ingest conversations and files, then ask questions in natural language and get cited answers back. Give every user a private, persistent agent memory.
Why Parcle?
LLMs forget everything between calls. Parcle gives every user a private memory you can write to and search:
- 🧠 Per-user memory — scope everything to a
user_id. - 💬 Ingest anything — chat transcripts and files (PDF, Markdown, text, …) go in the same place.
- 🔎 Ask, don't query — search returns a synthesized answer with citations, not just raw chunks.
Installation
pip install parcle
Quickstart
from parcle import Parcle
# Reads PARCLE_API_KEY from the environment if api_key is omitted.
client = Parcle(api_key="pk_live_...")
# 1. Write a conversation into a user's memory.
# Ingestion is incremental: omit session_id to start a new session, then
# pass the returned session_id back to append more turns to the same one.
dialog = client.ingest_dialog(
user_id="ada",
messages=[
{"role": "user", "content": "I'm allergic to peanuts."},
{"role": "assistant", "content": "Got it — I'll avoid peanuts in suggestions."},
],
)
client.ingest_dialog(
user_id="ada",
session_id=dialog.session_id, # append to the same session
messages=[
{"role": "user", "content": "Also, I don't eat shellfish."},
],
)
# 2. ...or ingest a file (PDF, Markdown, text, …).
client.ingest_file(user_id="ada", file="diet-notes.pdf")
# Ingestion waits until content is searchable by default. Pass wait=False if
# you want to enqueue writes and call wait_until_ready(...) yourself.
# 3. Ask a question. You get an answer with confidence and citations.
result = client.search(user_id="ada", query="What food should I avoid?")
print(result.answer) # "You're allergic to peanuts, so avoid them."
print(result.confidence) # 0.92
print(result.citations) # [Citation(type='session', id='...')]
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file parcle-0.1.1.tar.gz.
File metadata
- Download URL: parcle-0.1.1.tar.gz
- Upload date:
- Size: 14.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f94b7f4e4c16631b4f6ddeb7801120ca228197af5a1199f2162afe9e052608f4
|
|
| MD5 |
a41b1ab68ee8da7cc99da99eb8834a30
|
|
| BLAKE2b-256 |
6ebce13cf225582cf63d01ab8f514fb3e302dfca299f394f91d97bbd2f2c5ee9
|
File details
Details for the file parcle-0.1.1-py3-none-any.whl.
File metadata
- Download URL: parcle-0.1.1-py3-none-any.whl
- Upload date:
- Size: 13.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8ff3816faa1254aedfec90cab07f49c48b79d27c2351a4080b8bce66166ef5ca
|
|
| MD5 |
9fe5986c2eae67f26b0f2647b269d756
|
|
| BLAKE2b-256 |
ce747d56a2551fa029b2a76b43977eb3ae39715c8d1af2bc99864e55dfd456d9
|