Skip to main content

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.

PyPI License


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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

parcle-0.1.2.tar.gz (17.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

parcle-0.1.2-py3-none-any.whl (14.9 kB view details)

Uploaded Python 3

File details

Details for the file parcle-0.1.2.tar.gz.

File metadata

  • Download URL: parcle-0.1.2.tar.gz
  • Upload date:
  • Size: 17.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for parcle-0.1.2.tar.gz
Algorithm Hash digest
SHA256 aa7fcf8529ea37e7ac86b3d49e06358d6d957e13f3e6e0921aef6fd21b1b3238
MD5 a2ff421ac53cf5f4aa3bf42e82da4381
BLAKE2b-256 5522215032c10567835e250733f1d2787377b0b45d1fe338bd8fa42a5bae4f77

See more details on using hashes here.

File details

Details for the file parcle-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: parcle-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 14.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for parcle-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 caadda9eb7052021685f533afd72863031d7398ad293d1339c46136e668a07ee
MD5 fe75f4e2813f6188adfcac2394686bd2
BLAKE2b-256 67189b4a223d8f422e156a8b6da1e7e8f708d26ed521d27dc9eabf33f6cc2270

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page