Yantrik Memory
Persistent cognitive memory for AI agents, powered by YantrikDB (docs).
Install
# PyPI release pending — install from source for now:
pip install git+https://github.com/yantrikos/yantrik-memory
yantrik-memory init
pip install yantrik-memorywill work once the first PyPI release ships; this README will drop the source install then.
What it does
Gives your AI agent persistent memory that survives across conversations:
- Remember & Recall — Store and retrieve memories with hybrid search (semantic + graph + temporal + keyword)
- Personality Traits — 9 evolving traits that adapt to each user
- Bond Evolution — Relationships grow from stranger to bonded over time
- Knowledge Graph — Entity relationships for context-aware retrieval
- Context Assembly — One call to get everything an LLM needs
Quick Start
from yantrik_memory import YantrikMemory
mem = YantrikMemory()
# Single entry point for agents
context = mem.process_turn(
agent_id="assistant",
user_id="user123",
message="I prefer dark mode and concise answers",
)
# Returns: memories, traits, bond state, personality guidance, mood, intent
print(context["traits"]) # {'conciseness': 0.55, 'humor': 0.5, ...}
print(context["bond"]["level"]) # 'acquaintance'
Real Conversation Demo
Here's Yantrik Memory running inside OpenClaw — an open-source AI agent platform. The agent remembers context across turns, learns preferences, and builds a profile over time.
Turn 1 — Alex introduces himself:
Alex: Hey! I'm Alex. I'm a backend engineer at a startup. We're building a task management app and I need help setting up the API.
Agent: Hi Alex. What stack are you using? What API help do you need?
Turn 2 — Alex shares preferences, agent adapts:
Alex: We're using Python with FastAPI. I prefer keeping things simple — no over-engineering. Can you suggest a basic project structure?
Agent:
taskapp/ ├── app/ │ ├── main.py # FastAPI app │ ├── api/ │ │ ├── tasks.py # /tasks endpoints │ │ └── users.py # /users endpoints │ ├── core/ │ │ ├── config.py # Settings │ │ └── security.py # Auth utils │ ├── models/ │ │ ├── task.py # Pydantic models │ │ └── user.py │ └── db/ │ └── database.py # DB connection ├── requirements.txt └── README.md
Turn 3 — Agent remembers the database preference:
Alex: That's perfect, thanks! Oh and remember — I always use PostgreSQL for production and SQLite for local dev. What about the database layer?
Agent:
from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker from app.core.config import settings # Use SQLite for dev, PostgreSQL for prod engine = create_engine(settings.DATABASE_URL) SessionLocal = sessionmaker(bind=engine)
Turn 4 — Alex asks what the agent remembers:
Alex: Great work! You're really helpful. One more thing — what do you remember about me and my project so far?
Agent:
- Backend engineer at a startup
- Building a task management app
- Using Python with FastAPI
- Prefer simple solutions, no over-engineering
- Always use PostgreSQL for production, SQLite for local dev
Behind the scenes, Yantrik Memory tracked:
- Traits evolved:
helpfulness: 0.55(from "really helpful"),conciseness: 0.55(from "keeping things simple") - Bond level:
acquaintance(score: 0.08 after 4 interactions) - Memories stored: 5 facts about Alex, preferences, and project context
- Knowledge graph:
Alex → works_at → Startup,TaskApp → uses → FastAPI
OpenClaw / ClawDBot Plugin
Yantrik Memory is a ClawHub plugin. Install via:
openclaw plugins install yantrik-memory
Or add to your skills directory:
cd ~/.openclaw/skills
git clone https://github.com/yantrikos/yantrik-memory.git
pip install -e yantrik-memory
Powered by YantrikDB
5 unified indexes on a single SQLite file:
| Index | Purpose |
|---|---|
| Vector (HNSW) | Semantic similarity |
| Graph | Entity relationships |
| Temporal | Time-aware retrieval |
| Decay Heap | Memory lifecycle |
| KV | Fast lookups |
<60ms latency. Zero config. No external databases.
License
MIT
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 yantrik_memory-0.1.0.tar.gz.
File metadata
- Download URL: yantrik_memory-0.1.0.tar.gz
- Upload date:
- Size: 18.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
32484eafbb935e903e90113deeba4296e38b8f145dfbce6b6313d78cd65e2490
|
|
| MD5 |
e200d1dd1df81d277536351ebb56d959
|
|
| BLAKE2b-256 |
c14b7653a43713f2648e5c97898f1aaf84487514c0d1fce9b39868b5f2c9821a
|
Provenance
The following attestation bundles were made for yantrik_memory-0.1.0.tar.gz:
Publisher:
publish.yml on yantrikos/yantrik-memory
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
yantrik_memory-0.1.0.tar.gz -
Subject digest:
32484eafbb935e903e90113deeba4296e38b8f145dfbce6b6313d78cd65e2490 - Sigstore transparency entry: 2409542551
- Sigstore integration time:
-
Permalink:
yantrikos/yantrik-memory@1c75362e69c06edaae45caa7ab0cbbc4d2f85f70 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/yantrikos
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@1c75362e69c06edaae45caa7ab0cbbc4d2f85f70 -
Trigger Event:
release
-
Statement type:
File details
Details for the file yantrik_memory-0.1.0-py3-none-any.whl.
File metadata
- Download URL: yantrik_memory-0.1.0-py3-none-any.whl
- Upload date:
- Size: 15.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c6f2708fc1d2c79dad4ca12058b31414249c6e3f3b4e6797ad745a08832a78b8
|
|
| MD5 |
214e9c7845c17359cb2e911ceb455537
|
|
| BLAKE2b-256 |
d654eab9104a828c7cffe46038df2d66c10a431434ac483c9080d897794b2cd3
|
Provenance
The following attestation bundles were made for yantrik_memory-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on yantrikos/yantrik-memory
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
yantrik_memory-0.1.0-py3-none-any.whl -
Subject digest:
c6f2708fc1d2c79dad4ca12058b31414249c6e3f3b4e6797ad745a08832a78b8 - Sigstore transparency entry: 2409542669
- Sigstore integration time:
-
Permalink:
yantrikos/yantrik-memory@1c75362e69c06edaae45caa7ab0cbbc4d2f85f70 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/yantrikos
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@1c75362e69c06edaae45caa7ab0cbbc4d2f85f70 -
Trigger Event:
release
-
Statement type: