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.1.tar.gz (14.3 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.1-py3-none-any.whl (13.0 kB view details)

Uploaded Python 3

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

Hashes for parcle-0.1.1.tar.gz
Algorithm Hash digest
SHA256 f94b7f4e4c16631b4f6ddeb7801120ca228197af5a1199f2162afe9e052608f4
MD5 a41b1ab68ee8da7cc99da99eb8834a30
BLAKE2b-256 6ebce13cf225582cf63d01ab8f514fb3e302dfca299f394f91d97bbd2f2c5ee9

See more details on using hashes here.

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

Hashes for parcle-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8ff3816faa1254aedfec90cab07f49c48b79d27c2351a4080b8bce66166ef5ca
MD5 9fe5986c2eae67f26b0f2647b269d756
BLAKE2b-256 ce747d56a2551fa029b2a76b43977eb3ae39715c8d1af2bc99864e55dfd456d9

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