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.
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.
pip install parclefrom 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.
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."},
],
)
# 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="dialog", id="...")]