Developer SDK for Persisto: a persistent memory layer for AI apps
Project description
🧠 Persisto AI
Semantic Memory-as-a-Service (SMaaS) for LLM-powered applications.
Give your AI agents persistent memory — no vector DB setup, no boilerplate, no drift.
🧩 What is Persisto?
Persisto is a plug-and-play memory backend for LLM apps, agents, and chatbots. It handles:
- ✅ Memory saving, querying, and deletion
- ✅ OpenAI embedding +
pgvectorsimilarity search - ✅ TTL/expiry support for short-lived memory
- ✅ Metadata filtering + structured search
- ✅ Fully working Python SDK with retries, error handling, and test script
Use Persisto to recall facts, track preferences, or power retrieval-augmented generation (RAG) — with clean APIs and no infrastructure overhead.
💡 Why Use Persisto?
LLMs forget. Agents drift. Context disappears. Persisto solves this with long-term, queryable memory that just works:
- 🧠 Save memory chunks by namespace
- 🔍 Retrieve by semantic similarity and metadata filters
- ⏳ Expire memory after N seconds (
ttl_seconds) - ⚙️ Use a simple Python SDK or REST API
- 🔐 Scoped by user with API key auth
You focus on building smart apps — Persisto handles memory.
🔧 Quick Start
1. Install the SDK
pip install persisto-ai
⚙️ Alternatively, clone the repo and run
python test_sdk.pyafter setting your.env.
2. Save a memory
from persisto import PersistoClient
client = PersistoClient(api_key="your-api-key")
client.save(
namespace="demo-agent",
content="The user prefers concise summaries.",
metadata={"source": "profile"}
)
3. Query memory
results = client.query(
namespace="demo-agent",
query="How does the user like their output?",
filters={"source": "profile"}
)
for r in results:
print(r["content"], r["similarity"])
⚙️ Architecture Overview
sdk/python/persisto/ # Python SDK (retry logic, typed errors)
backend/
├── main.py # FastAPI app entry
├── routers/memory.py # REST endpoints: /save, /query, /delete
├── services/ # Embedding, DB, memory logic
├── utils/ # Chunking, auth, helpers
✅ Completed Features (V1.0 + V1.5)
🧠 Memory Infrastructure
.save(),.query(),.delete()APIs- Text chunking + OpenAI embeddings
pgvectortop-k semantic search- Structured filtering via metadata
- API key–based user isolation
🧰 SDK Polish
- Full Python SDK
- Retry logic via
tenacity - Typed SDK errors (e.g.
PersistoAuthError,PersistoNotFoundError) .envsupport and test suite
⏳ TTL / Expiry Support
ttl_secondsin.save()expires_atcolumn in DB- Expired memories excluded from queries
🪪 Query History API
/queries/listendpoint.list_queries()in SDK- Filter by namespace and time
🛣️ Roadmap
🔷 V2.0 – Power Tools for Devs (Next)
- Retrieval Profiles:
strict,fuzzy,recency summarize_old()— LLM-based memory compression- JS/TS SDK
- Scoped tokens + project-based auth
- TTL cleanup script (optional)
🔶 V3.0 – Persisto Cloud (Hosted Platform)
- Hosted dashboard + usage metrics
- Interactive playground
- Org/project system with team access
- API keys + usage billing
🔷 V4.0 – The RAG Engine (Infra Toolkit)
- Hybrid search (vector + keyword)
- BYO embedder + summarizer
- Declarative config:
persisto.config.json - LangChain / LlamaIndex adapters
- GitHub RAG chatbot template
💼 Use Cases
- Memory for multi-turn AI agents
- Preference recall in LLM copilots
- Long-term document understanding
- Semantic search + RAG pipelines
- Personalization across sessions
📦 Tech Stack
- Python (FastAPI, Pydantic, Requests)
- Supabase (PostgreSQL + pgvector)
- OpenAI embeddings (
text-embedding-3-small) - Tenacity (retry logic)
- dotenv (
.envconfig for SDK) - Future: TS SDK, hosted dashboard, LangChain adapters
🚀 Vision
Persisto is building the Vercel for RAG A fully hosted, developer-first platform to deploy AI memory, retrieval, and context systems — in one line of code.
- No infra setup
- No vector DB config
- Just
.save()and.query()memory — and you're live
👇 Try It Locally
# Start backend server
uvicorn backend.main:app --reload
# Run the test script
python test_sdk.py
Configure your
.envwith your API key (from Supabase).
🧠 Persisto gives your AI a brain.
Build memory-aware agents. Ship smarter assistants. Deploy production-ready RAG in minutes.
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 persisto-0.1.1.tar.gz.
File metadata
- Download URL: persisto-0.1.1.tar.gz
- Upload date:
- Size: 10.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
93c8709a6c6ecd2a1e40add8b9dd411d04b2a63f37116df9ce02afca55e8a2d0
|
|
| MD5 |
7d38e47c31113e9d223f58ddc91ff321
|
|
| BLAKE2b-256 |
768863ded19e1c6f04c82178345ba765b4b2f3c540e7dfc8f0cd830ecd8c119a
|
File details
Details for the file persisto-0.1.1-py3-none-any.whl.
File metadata
- Download URL: persisto-0.1.1-py3-none-any.whl
- Upload date:
- Size: 6.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0e0e41572182b82b33a018cc044a1745fefff0f60344aef2a69ca4a41cf69fa5
|
|
| MD5 |
d9144a7794729503f06b8e03084dd347
|
|
| BLAKE2b-256 |
123e8867975479a3c1c6f9eee54e3d54106c31f99b9d2cdc8c47f5471c886a88
|