Skip to main content

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 a Reflection with .render() for LLM prompts
  • Auto-embedder: pass embedder="all-MiniLM-L6-v2" to connect() (or keep default) and the client lazy-loads sentence-transformers

API surface

  • connect(url, *, token, embedder=...) — returns a YantrikClient
  • YantrikClient.remember(text, ...) — store a memory
  • YantrikClient.recall(query, ...) — semantic search
  • YantrikClient.relate(entity, target, relationship) — knowledge graph edge
  • YantrikClient.think(...) — trigger consolidation / conflict scan
  • YantrikClient.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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

yantrikdb_client-0.2.0.tar.gz (9.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

yantrikdb_client-0.2.0-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

Details for the file yantrikdb_client-0.2.0.tar.gz.

File metadata

  • Download URL: yantrikdb_client-0.2.0.tar.gz
  • Upload date:
  • Size: 9.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for yantrikdb_client-0.2.0.tar.gz
Algorithm Hash digest
SHA256 f6009d252ac2fc3867c8a3d425c7cbe043c34aa7895d034d4a6f422f1bcfb09d
MD5 2b400316c589a18abddd62ee930f3490
BLAKE2b-256 706fa2e0fd24f1d990af2a918012c24c6a6396efc2f42589afe84e70374855b9

See more details on using hashes here.

Provenance

The following attestation bundles were made for yantrikdb_client-0.2.0.tar.gz:

Publisher: publish-sdk.yml on yantrikos/yantrikdb-server

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file yantrikdb_client-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for yantrikdb_client-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 05df8f35b0b4f4a114763aaae78dfcfa25826f951889f8c3c8b8a838065ea848
MD5 81378010eda302df7d9d3f4d37c2aaae
BLAKE2b-256 ce7d8900205a28dd490ef68dcc4ee8f55249f906f6bda1cb8953cc3d114ca203

See more details on using hashes here.

Provenance

The following attestation bundles were made for yantrikdb_client-0.2.0-py3-none-any.whl:

Publisher: publish-sdk.yml on yantrikos/yantrikdb-server

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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