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.


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.
result = 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=result.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")

# 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.0.tar.gz (14.1 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.0-py3-none-any.whl (12.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: parcle-0.1.0.tar.gz
  • Upload date:
  • Size: 14.1 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.0.tar.gz
Algorithm Hash digest
SHA256 b9614d1ce5d0d99317f645b655db3a5d1c75ed719bc5fc86769a9215ed2fbd49
MD5 cd488278b439e56988f4352cb1623579
BLAKE2b-256 10e21f2d3e28ad6363d7aa4d1058b426b053e21bc9235742dcfaffe944f6ab04

See more details on using hashes here.

File details

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

File metadata

  • Download URL: parcle-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 12.4 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bd2329cbb6f793c9e8142a34fbdf8a9a506ea637c499840fd3a1c98f94847bc2
MD5 612b4dcdaf6adad2491a3146cbaf66df
BLAKE2b-256 2c0f746ba6e493582b04464732283484be7325d3a20eb3a50c51a239274a2c1b

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