All plugins

uniichat-recall

Uniichat memory provider — the chat log IS the memory. Append-only JSONL log with a binary summary tree, coverage + BM25-lite ranking, query expansion, optional dense recall, and strict zero-leak abstention over every past turn. Disclosure — stores the append-only log, derived summary tree, vectors/, and misses.jsonl locally under the served profile's hermes_home / "uniichat" (bound in initialize(); configurable via root for a shared log), using fcntl on POSIX and msvcrt byte-range locks on Windows, with a background thread that rebuilds the summary tree after turns are appended. Chat, summarization, recall routing/answering, and query-expansion calls use the user's configured Hermes provider via ctx.llm (no hardcoded third-party endpoint or API key; runs offline when summarize: false). Optional dense_recall embeddings send redacted record excerpts (first 4,000 characters) and query text to a user-configured OpenAI-compatible embeddings endpoint using a secret resolved from embedding_api_key_env (plaintext embedding_api_key is ignored); a configured key is sent only over HTTPS and redirects away from the configured origin are refused (disabled/no-op when unconfigured; nothing stored remotely). Optional agy second-opinion CLI is opt-in (second_opinion: false by default); when enabled and agy is present, spawns agy on semantic misses with a minimal environment (via -p= since agy does not accept plain-text stdin). Credential-shaped tokens are masked in transcripts before transmission.

DevvGwardo2Memoryv0.1.5Updated 3 hours ago

About

Uniichat memory provider — the chat log IS the memory. Append-only JSONL log with a binary summary tree, coverage + BM25-lite ranking, query expansion, optional dense recall, and strict zero-leak abstention over every past turn. Disclosure — stores the append-only log, derived summary tree, vectors/, and misses.jsonl locally under the served profile's hermes_home / "uniichat" (bound in initialize(); configurable via root for a shared log), using fcntl on POSIX and msvcrt byte-range locks on Windows, with a background thread that rebuilds the summary tree after turns are appended. Chat, summarization, recall routing/answering, and query-expansion calls use the user's configured Hermes provider via ctx.llm (no hardcoded third-party endpoint or API key; runs offline when summarize: false). Optional dense_recall embeddings send redacted record excerpts (first 4,000 characters) and query text to a user-configured OpenAI-compatible embeddings endpoint using a secret resolved from embedding_api_key_env (plaintext embedding_api_key is ignored); a configured key is sent only over HTTPS and redirects away from the configured origin are refused (disabled/no-op when unconfigured; nothing stored remotely). Optional agy second-opinion CLI is opt-in (second_opinion: false by default); when enabled and agy is present, spawns agy on semantic misses with a minimal environment (via -p= since agy does not accept plain-text stdin). Credential-shaped tokens are masked in transcripts before transmission.

uniichat-recall

An independent Python memory-provider for Hermes Agent that reads the UniiChat log format.

Credit: the UniiChat log format and the memory-tree design come from
VictorTaelin/uniichat (Victor
Taelin) — an AI chat with one endless conversation and a binary-tree
memory. This repo is a from-scratch Python implementation for a different
runtime (a Hermes plugin); it shares no code or history with the original.
Fork the original if you want the app itself.

What it does

Hermes agents get recall over a UniiChat log: ask "what did we decide about
X" and the provider ranks the log's records, returns the original text with
record/session IDs, and abstains when nothing in the log answers — no
hallucinated memory, ever.

  • Ranking: coverage-primary scoring with a BM25-lite tie-break over
    cold-window candidates, L1-cached
  • Query expansion: when the query's own words rank no candidate, one cheap
    model call re-expresses it in the log's vocabulary and the variant hits join
    the candidate pool — the fix for paraphrased questions (offline = no-op)
  • Two-tier evidence: candidate-first routing with a strong-gate
    (second-opinion model) tier for ambiguous windows
  • Negative gate: adversarial queries never leak; the provider returns
    nothing rather than guessing

Design notes from the original implementation are preserved in
README-original.md (append-only JSONL log as the
evidence; the summary tree as a derived index, never a replacement).

Comparison to Original Hermes

DimensionOriginal Hermes Agentuniichat-recall Provider
Memory CapacityFixed 2,200 chars (~800 tokens max snapshot)Unlimited scale (append-only JSONL log, 20+ days)
Recall Latency28.5 s (multi-hop menu walk)0.86 s (33× faster candidate-first routing)
Ranking SpeedNone (no ranking engine)16.7 ms p50 (in-process L1 cached)
Retrieval Accuracy0.742 hit@1 (BM25 baseline)0.933 hit@1 (+19.1% improvement)
Hallucination DefenseUnbounded (guesses when missing)100% Zero-Leak Abstention (20/20 refused)
Evidence GroundingLossy summaries onlyExact JSONL character offsets & session IDs

uniichat-recall vs Original Hermes

Benchmarks

Measured over a 20-day real UniiChat log (120 gold queries, tier L; strict
hit@1 — the gold record ranked first):

Varianthit@1hit@3hit@6
BM25 only0.7420.8751.000
Keyword first-pass0.8580.9671.000
Coverage + re-rank (shipped)0.9330.9751.000

Latency: end-to-end recall 28.5 s → 0.86 s (33× faster); in-process
ranking p50 16.7 ms / p95 28.9 ms; LLM-judged tier p50 23.5 ms / p95
47.5 ms.

Negative baseline: 20/20 adversarial queries abstained; 0 secrets
leaked; 0.0 false-positive gate rate on real queries. Re-checked live
2026-11-17 with expansion on: 4/4 adversarial/injection queries abstained,
and credential-shaped tokens in outbound transcripts are masked
(apikey_*, sk-*, vck_*, gh* patterns) — the local log stays
complete, only bytes leaving for the model endpoint are redacted.

Paraphrase recall (the old honest gap): lexical ranking misses rephrased
wording — 3/6 on the frozen 20-day bench. Query expansion (one model call
re-expressing the query into search variants) is the shipped fix; measured
2026-11-17 on a fresh 8-item paraphrase set over a 3-day log snapshot with
glm-5.3-flash: judged-correct 5/8 -> 6/8, gold-in-window unchanged (6/8),
zero regressions, median latency 4.4 s -> 12.3 s. The remaining misses: one
true retrieval miss (variants still didn't reach the gold session) and one
strict-judge case. The frozen 20-day bench remains the hard case to re-run.
LLM-free alternatives (pseudo-relevance feedback, query-term co-occurrence
mining — bench/offline_expanders.py) were built and measured on the same
set: both 6/8 retrieval, identical to baseline — a 120-record chatty log has
no statistically visible co-occurrence breadcrumbs, exactly as predicted for
corpus-local expansion. They may pay off on a large old log; re-run the tool
against the frozen 20-day bench before adding an offline expansion tier.

Retrieval accuracy benchmark
Latency benchmark
Negative baseline benchmark
Paraphrase recall benchmark

Infographics styled in the Hermes Duet design language — every number
grounded in bench/ result files.

Install & test

Drop this directory into your Hermes plugins folder (e.g.
<HERMES_HOME>/plugins/uniichat-recall) or install from the Hermes plugin
catalog (hermes plugins install uniichat-recall), then enable the provider
in your agent config.

Configuration

All options are exposed through get_config_schema() / Hermes plugin settings:

  • root — Storage directory for the append-only log, summary tree,
    vectors/, and misses.jsonl. Defaults per-profile to
    <the served profile's hermes_home> / "uniichat", bound in initialize()
    from that profile's hermes_home; set an explicit path to share one log
    across profiles.
  • summarize (true by default) — Use the configured Hermes provider
    (ctx.llm) to summarize tree nodes (false = clipped verbatim excerpts,
    offline).
  • query_expansion (true by default) — On a weak keyword match,
    re-express the query via ctx.llm into search variants (no-op offline).
  • dense_recall (true by default) — Widen the candidate pool with
    cosine-similar records from a local vector index using a user-configured
    OpenAI-compatible embeddings endpoint, model, and secret (disabled / no-op
    when unconfigured). The key is read only from embedding_api_key_env
    through Hermes's secret scope; a plaintext embedding_api_key in
    config.yaml is ignored. Redirects that leave the configured origin are
    refused, and a configured key is only sent over HTTPS.
  • second_opinion (false by default) — Opt-in second-opinion check via
    the agy CLI on semantic misses.

Tests

Tests are stdlib unittest:

pip install ruamel.yaml
PYTHONPATH=<hermes-agent> python -m unittest discover -s tests
# 113 tests, ~13s

store.py tests are dependency-free; the provider tests import
agent.memory_provider / hermes_cli.config from a hermes-agent checkout,
which is the only reason PYTHONPATH and ruamel.yaml are needed. CI runs
the full suite on both ubuntu-latest and windows-latest.

The bench (bench/bench.py, bench/misses.py) needs your own UniiChat log
snapshot — none is bundled, on purpose: real logs contain private
conversations.

Disclosure

What this plugin does beyond local storage, so you can decide before installing:

  • Model calls via your configured Hermes provider (ctx.llm). Chat,
    summary-tree compression, recall routing/answering, and query-expansion
    calls use the user's configured Hermes provider via ctx.llm (no hardcoded
    third-party endpoint or API key). Runs fully offline when summarize: false
    (clipped verbatim nodes, no model calls). Credential-shaped tokens are
    masked in transcripts before transmission.
  • Optional dense_recall embeddings. When dense_recall is enabled and
    a user-configured OpenAI-compatible embeddings endpoint, model, and secret
    are set, redacted record excerpts (first 4,000 characters) and query text
    are sent to that configured endpoint to build and query a local cosine index
    under <root>/vectors/. The secret is resolved at call time from
    embedding_api_key_env via Hermes's secret scope; plaintext
    embedding_api_key values are ignored. A redirect that changes origin
    (scheme, host, or port) is refused, and a configured key is only sent over
    HTTPS. Disabled / no-op when unconfigured; this plugin stores nothing
    remotely.
  • Optional agy CLI and background work. Opt-in only (second_opinion: false by default). When second_opinion: true and the agy
    (Antigravity/Gemini) binary is present, on a semantic miss the provider may
    spawn agy as a second-opinion reviewer with a minimal environment and
    redacted prompt (agy -p=, as agy does not accept plain-text stdin). Separately, a background thread rebuilds the
    summary tree after turns are appended.
  • Local logs. The append-only log, derived tree, vectors/, and
    misses.jsonl default per-profile under that profile's
    hermes_home / "uniichat" (configurable via root for a shared log).
    Cross-platform: cross-process
    append locks use fcntl on POSIX and an msvcrt byte-range-lock shim on
    Windows; directory fsync around atomic renames is POSIX-only (Windows
    renames are atomic without it).

Status

Working, benchmarked, 113/113 tests on Linux and Windows. The store.py
ranking, two-tier evidence routing, and negative gate are considered
stable; query expansion addresses the paraphrase gap (see Benchmarks), and
re-running the frozen 20-day bench against it is the remaining work item.

Recall now fuses three candidate sources — lexical coverage ranking, query
expansion variants, and cosine similarity over a local vector sidecar
(dense_recall, venice-embed-1 at a measured ~$0.000004/request) — behind
an unchanged strong gate: dense hits widen the semantic tier and never
promote to raw mode, and the offline behavior is identical. Judged
14/16 on the 16-item paraphrase tier; the residual miss shape is
"right neighborhood, wrong instance" (same-topic impostors fuse above the
gold), which a record-level reranker is the next lever for
(bench/README.md, fourth wave of 2026-11-28).

Every provider-side model call is now hard-bounded by the 90 s semantic
deadline (_bounded_chat): a hung or slow-drip endpoint is abandoned at the
budget and the recall returns honest partial evidence — two recalls measured
at 90.1 s / 188.1 s against the budget before the fix (see bench/README.md,
2026-11-27). The answer stage is shaped by query type, one call each:
question-shaped queries answer from quoted passages first (grounded,
negation-aware — P003/P009-class rescues); keyword-shaped queries get an
all-terms lookup prompt whose abstention line is enforced locally (a claimed
record must verifiably contain every query term, else NOT FOUND — no extra
model call). The 20/20 negative baseline holds with glm-5.3-flash, the only
model in use, at a measured $0.0043/request (bench/README.md, third wave of
2026-11-28, which also records the dead-ends: morphological variants,
session-vote seeding, a third candidate window, char-ngram retrieval).

README from the reviewed commit 9a1e457; it updates when the author re-pins.

Developer Mode

Explore built-in Hermes toolsets and actions.

HermesAgent

Developer?

Create a Hermes extension for Desktop or agent workflows.

Developer Section