Skip to main content

yclient-memory

yclient-memory is an in-tree implementation of the external memory package described in external_memory_package_pipeline.md.

It provides:

  • a stable yclient_memory import surface
  • shared contracts and runtime protocols
  • a build_memory_engine() factory
  • two interchangeable backends:
    • hybrid_semantic
    • simple_recent

Installation

From PyPI, once published:

pip install yclient-memory

Quick Start

from yclient_memory import build_memory_engine
from yclient_memory.config import MemoryConfig

memory = build_memory_engine(
    backend="hybrid_semantic",
    config=MemoryConfig.from_mapping({"memory_vote_signal_only": True}),
    runtime=my_runtime_adapter,
)

Public API

from yclient_memory import build_memory_engine
from yclient_memory.contracts import (
    CommentMemoryEvent,
    PostStyleRequest,
    ReplyMemoryRequest,
)

Core operations:

  • build_reply_context()
  • build_browse_context()
  • build_post_style_context()
  • record_comment()
  • record_vote()
  • record_post()
  • relationship_signal()
  • maintenance_tick()

Backends

hybrid_semantic

  • preserves the richer Reddit-style behavior
  • tracks social cards, thread cards, community digest, and reflections
  • supports semantic-style lexical retrieval, high-affect recall, and post-style guidance

simple_recent

  • keeps deterministic recent interaction state only
  • exposes the same engine signature with fewer capabilities
  • is suitable for lower-dependency adoption in other clients

Runtime Adapter

The package expects a runtime object with the methods documented in docs/runtime_adapter.md.

At minimum, backends depend on:

  • get_author_id_and_username(post_id)
  • get_thread_root_id(post_id)
  • get_recent_root_posts(round_id, limit, rounds_back)
  • get_post_text(post_id)
  • llm_json(prompt_key, variables, config=None)
  • llm_text(prompt_key, variables, config=None)
  • decision_log(payload)

Notebooks

Example walkthroughs live in:

Development

python -m pytest

Packaging And Release

Build locally:

python -m pip install .[release]
python -m build
python -m twine check dist/*

The repository also includes GitHub Actions workflows for package validation and PyPI publishing:

Release details are documented in docs/release_pipeline.md.

MkDocs

uv run --with mkdocs-material mkdocs serve

Strict build:

uv run --with mkdocs-material mkdocs build --strict

Metadata

Release files for yclient-memory 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for yclient-memory 0.1.0
File Size Uploaded
yclient_memory-0.1.0.tar.gz 23.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for yclient-memory 0.1.0
File Interpreter ABI Platform
yclient_memory-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 49.8 kB

Release files / yclient_memory-0.1.0.tar.gz

Download URL yclient_memory-0.1.0.tar.gz
Size 23.0 kB
Tags Source
SHA-256 checksum
How to use checksums
ea5ed6a1b4407a568c2645a46fec7a0cd70ac80461bbd46107c049bc7b1f2417
BLAKE2b-256 checksum
How to use checksums
41d921206978e32a2e25cdf49cf6db84d1689b4d75a6772bf9d802e4fe60b1d1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.13

Release files / yclient_memory-0.1.0-py3-none-any.whl

Download URL yclient_memory-0.1.0-py3-none-any.whl
Size 26.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b4c2311ffff2a8fbda9c55aa3694517ea8795af88ef625f574c1f6a134bcbb43
BLAKE2b-256 checksum
How to use checksums
bf9f4bc4df9ab9ef3a37ed881ad4b5a8e70f7df692bdf5b3e05acd37621bc34c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.13

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page