Python client SDK for YantrikDB — the cognitive memory database
Project description
yantrikdb-client
Python SDK for YantrikDB — a cognitive memory database with persistent typed memory, contradiction handling, and reflection.
Install
pip install yantrikdb-client
# with client-side auto-embedding
pip install 'yantrikdb-client[embed]'
Quick start
from yantrikdb import connect
client = connect("http://localhost:7438", token="ydb_...")
# Basic memory
client.remember("Alice prefers dark mode", domain="preference")
results = client.recall("what does Alice prefer?")
# Character-substrate primitives (v0.2.0+)
client.remember_self("I overtrust single-source reports under time pressure")
client.remember_rule(
condition="single-source high-stakes claim",
action="state uncertainty and request corroboration",
)
client.remember_constraint(
label="truthfulness_over_pleasing",
description="Disclose uncertainty even when unwelcome",
priority=0.95,
)
# Reflect — compose a structured meta-state view for an LLM prompt
reflection = client.reflect(
"How should I handle this high-stakes single-source claim?",
)
print(reflection.render())
What's in 0.2.0
- Character-substrate primitives:
remember_self,remember_rule,remember_hypothesis,remember_constraint,remember_goal,remember_arc,record_signal - Typed recall:
recall_typed(query, memory_type)for filtered retrieval - Reflect API:
reflect(question)composes parallel type-filtered recalls + open conflicts into aReflectionwith.render()for LLM prompts - Auto-embedder: pass
embedder="all-MiniLM-L6-v2"toconnect()(or keep default) and the client lazy-loads sentence-transformers
API surface
connect(url, *, token, embedder=...)— returns aYantrikClientYantrikClient.remember(text, ...)— store a memoryYantrikClient.recall(query, ...)— semantic searchYantrikClient.relate(entity, target, relationship)— knowledge graph edgeYantrikClient.think(...)— trigger consolidation / conflict scanYantrikClient.reflect(question, ...)— structured meta-state view- Typed helpers:
remember_self/rule/hypothesis/constraint/goal/arc,record_signal,recall_typed YantrikClient.session(...)— context manager for cognitive sessions
License
MIT
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 yantrikdb_client-0.2.1.tar.gz.
File metadata
- Download URL: yantrikdb_client-0.2.1.tar.gz
- Upload date:
- Size: 10.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
add3066850f69fedb5b98348a3f70621015ae21f87369d27eb6aa036f1bd8e5d
|
|
| MD5 |
411193fdd656b548c33546de08b32a40
|
|
| BLAKE2b-256 |
ca7cba839402ef3bffd626f20d6ee0363b78a5eb7b479b2b254ec598dc417a28
|
Provenance
The following attestation bundles were made for yantrikdb_client-0.2.1.tar.gz:
Publisher:
publish.yml on yantrikos/yantrikdb-client
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
yantrikdb_client-0.2.1.tar.gz -
Subject digest:
add3066850f69fedb5b98348a3f70621015ae21f87369d27eb6aa036f1bd8e5d - Sigstore transparency entry: 1343478754
- Sigstore integration time:
-
Permalink:
yantrikos/yantrikdb-client@a869c3ea77a4bfae9654dfe2279a1042b7ccc4fd -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/yantrikos
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a869c3ea77a4bfae9654dfe2279a1042b7ccc4fd -
Trigger Event:
release
-
Statement type:
File details
Details for the file yantrikdb_client-0.2.1-py3-none-any.whl.
File metadata
- Download URL: yantrikdb_client-0.2.1-py3-none-any.whl
- Upload date:
- Size: 11.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cc50ea38f2feb2b9c8b510ef5b712daff3b0e84ec91a9936818ba3b7acc3e138
|
|
| MD5 |
0e40d9f84ba955472be9be8beacf70ca
|
|
| BLAKE2b-256 |
8510ff2e6c6bc532a414f74f3aa6d447132d1acd5818b42879358ee725829928
|
Provenance
The following attestation bundles were made for yantrikdb_client-0.2.1-py3-none-any.whl:
Publisher:
publish.yml on yantrikos/yantrikdb-client
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
yantrikdb_client-0.2.1-py3-none-any.whl -
Subject digest:
cc50ea38f2feb2b9c8b510ef5b712daff3b0e84ec91a9936818ba3b7acc3e138 - Sigstore transparency entry: 1343478760
- Sigstore integration time:
-
Permalink:
yantrikos/yantrikdb-client@a869c3ea77a4bfae9654dfe2279a1042b7ccc4fd -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/yantrikos
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a869c3ea77a4bfae9654dfe2279a1042b7ccc4fd -
Trigger Event:
release
-
Statement type: