Skip to content

feat(init): Hermes memory-provider plugin (automatic recall + extraction) - #479

Merged
ajianaz merged 3 commits into
codecoradev:developfrom
gnoviawan:feat/hermes-memory-provider
Jun 27, 2026
Merged

ajianaz merged 3 commits into
codecoradev:developfrom
gnoviawan:feat/hermes-memory-provider

Conversation

@gnoviawan

Copy link
Copy Markdown
Contributor

Summary

Adds a memory-provider integration for Hermes, alongside the existing uteke-tool plugin.

uteke init --agent hermes --memory-provider installs a MemoryProvider plugin to ~/.hermes/plugins/uteke/ that makes uteke Hermes's default long-term memory:

  • Automatic recall — relevant memories are prefetched and injected into the prompt every turn (no explicit uteke(...) call needed).
  • Automatic extraction — on session end / pre-compress, the transcript is distilled into atomic facts via the opt-in import --extract path.
  • No daemon — talks to the uteke binary directly via subprocess, so uteke-serve is not required.
  • Circuit breaker — after repeated subprocess failures it pauses calls for a cooldown, so a misconfigured endpoint or missing binary never blocks the agent.

This complements the existing uteke-tool plugin rather than replacing it. The docs now frame the two integration modes side by side:

uteke-tool (Mode A) memory-provider (Mode B)
Install uteke init --agent hermes uteke init --agent hermes --memory-provider
Invocation manual uteke(action=...) automatic, every turn
Capture agent decides auto-extract on session end
Transport HTTP to uteke-serve direct subprocess
Daemon required none
Rooms yes no

Implementation

  • New --memory-provider flag on uteke init (threaded through cli.rs, commands/mod.rs, init.rs).
  • New init_hermes_memory_provider() writes __init__.py + plugin.yaml.
  • Plugin templates live in extensions/hermes-memory-provider/ and are embedded with include_str! so the generated plugin always matches the installed binary.
  • Activation is via Hermes config: memory.provider: uteke.

Docs

  • docs/integrations/hermes.md — restructured into Mode A / Mode B with a full memory-provider setup guide + config reference.
  • docs/cli-reference.md — added the --memory-provider variant.
  • CHANGELOG.md — Unreleased/Added entry.

Testing

  • cargo fmt --all clean
  • cargo clippy -p uteke-cli --all-targets -- -D warnings clean
  • cargo test --workspace green, incl. 2 new tests guarding the embedded templates (register() entry point + declared hooks)
  • Manual: uteke init --agent hermes --memory-provider against a temp $HOME generates a valid plugin (__init__.py parses, exposes register()).

Notes

Adds `uteke init --agent hermes --memory-provider`, which installs a
MemoryProvider plugin to ~/.hermes/plugins/uteke/ that makes uteke
Hermes's default long-term memory:

- automatic recall prefetched + injected into the prompt each turn
- opt-in LLM fact extraction on session end / pre-compress
- direct subprocess to the uteke binary (no uteke-serve daemon)
- circuit breaker so a bad endpoint never blocks the agent

Plugin templates live in extensions/hermes-memory-provider/ and are
embedded via include_str! so the generated plugin always matches the
binary. Complements the existing uteke-tool plugin (manual HTTP actions)
rather than replacing it.

Docs: docs/integrations/hermes.md documents both modes (tool vs
memory-provider). Zero new dependencies.
@ajianaz
ajianaz merged commit 81fac81 into codecoradev:develop Jun 27, 2026
8 checks passed
ajianaz added a commit that referenced this pull request Jun 27, 2026
* feat: configurable embedding endpoint path (#473) (#474)

* feat: configurable embedding endpoint path (#473)

Add endpoint_path config field and UTEKE_EMBEDDING_ENDPOINT_PATH env var
for OpenAI-compatible backends that use non-standard paths (e.g. CodeCora
Embed uses /embed instead of /embeddings).

Changes:
- openai.rs: add endpoint_path field, DEFAULT_ENDPOINT_PATH constant,
  normalize leading slash, update all tests
- config.rs: add endpoint_path to EmbeddingConfig, TOML merge, ENV override
- lib.rs: add endpoint_path to EmbeddingSettings, resolve_with_defaults,
  pass to OpenAiEmbedder::new() in ensure_embedder

Zero breaking change: defaults to /embeddings (OpenAI standard).
Cora review: clean.

* fix: add missing endpoint_path to EmbeddingSettings literals

- main.rs: CLI EmbeddingSettings construction
- lib.rs: 3 test struct literals
- cargo fmt applied

CI failures expected: missing field, format.

* fix: restore original test credential values corrupted by patch

The fuzzy patch tool replaced real credential-like test strings (sk-*-config,
sk-config-only) with literal '***'. Restore original values to fix CI test
failures.

---------

Co-authored-by: ajianaz <[email protected]>

* feat: default max_seq_length 256→2048 for ONNX embedding (#472) (#475)

- engine.rs: MAX_SEQ_LEN constant 256→2048
- config.rs: EmbeddingConfig default 256→2048
- Add UTEKE_MAX_SEQ_LENGTH env var override
- Update 4 test assertions for new default

Aligns with CodeCora Embed Modal API and practical use cases.
Zero breaking change for explicit config users.

Closes #472

Co-authored-by: ajianaz <[email protected]>

* docs: update CHANGELOG and configuration.md for #474 & #475 (#476)

- Add Unreleased section in CHANGELOG for:
  - #473: configurable embedding endpoint_path + ENV override
  - #472: max_seq_length 256→2048 default + ENV override
- Fix docs/configuration.md:
  - max_seq_length default: 256 → 2048
  - Add endpoint_path config field and table row
  - Add UTEKE_EMBEDDING_ENDPOINT_PATH env var
  - Add UTEKE_MAX_SEQ_LENGTH env var

Co-authored-by: ajianaz <[email protected]>

* fix(cora): add ignore.rules for hardcoded secret false positives (#478)

Cora LLM flags struct field declarations named api_key as
'Hardcoded password or secret in variable' — these are identifiers,
not hardcoded values. rules field (soft LLM instruction) is insufficient;
add deterministic ignore filter that matches on issue title.

Also remove the non-effective LLM-only rule that was added
attempting to suppress the same issue.

Co-authored-by: ajianaz <[email protected]>

* feat(import): opt-in LLM fact extraction (--extract) (#477)

* feat(import): add opt-in LLM fact extraction (--extract)

Raw source material (chat transcripts, long notes, exported dumps) is
noisy and pollutes recall when imported verbatim. `uteke import --extract`
distills the input into atomic facts via an OpenAI-compatible
chat-completions endpoint and stores one memory per fact.

Opt-in and offline-first: without --extract the importer makes no network
calls and behaves exactly as before. Settings resolve CLI flag >
UTEKE_EXTRACTION_* env > [extraction] config > default, and the API key
falls back to the embedding/OPENAI_API_KEY credential so an existing
OpenAI-compatible setup needs no duplication.

Follows the existing embedding-backend pattern (reqwest blocking, bearer
auth, base_url/endpoint_path, URL validation). No new dependencies.

Relates to #46 (Obsidian/CSV import was partially landed; this completes
the "import from external knowledge sources" goal for noisy free-form text).

* chore(cora): suppress false-positive secret findings on api_key identifiers

CodeCora's static scanner flags struct fields and CLI flags named
`api_key` / `extract_api_key` as "hardcoded password or secret", but
these are identifiers populated at runtime from env/config/CLI input,
never literal secrets. Mirrors the existing `embed/openai.rs` api_key
field. Adds a suppression rule following the same pattern already used
for the SQL-injection false positive.

---------

Co-authored-by: Anaz S. Aji <[email protected]>

* chore(cora): suppress false-positive command injection on subprocess pattern (#480)

subprocess.run(cmd) in __init__.py.tmpl uses controlled args
(self._bin + hardcoded literals), not dynamic user input.
Add context rule + ignore rule to prevent Cora/CodeCora false positives.

Co-authored-by: ajianaz <[email protected]>

* feat(init): add Hermes memory-provider plugin (--memory-provider) (#479)

Adds `uteke init --agent hermes --memory-provider`, which installs a
MemoryProvider plugin to ~/.hermes/plugins/uteke/ that makes uteke
Hermes's default long-term memory:

- automatic recall prefetched + injected into the prompt each turn
- opt-in LLM fact extraction on session end / pre-compress
- direct subprocess to the uteke binary (no uteke-serve daemon)
- circuit breaker so a bad endpoint never blocks the agent

Plugin templates live in extensions/hermes-memory-provider/ and are
embedded via include_str! so the generated plugin always matches the
binary. Complements the existing uteke-tool plugin (manual HTTP actions)
rather than replacing it.

Docs: docs/integrations/hermes.md documents both modes (tool vs
memory-provider). Zero new dependencies.

Co-authored-by: Anaz S. Aji <[email protected]>

* docs: update CHANGELOG, roadmap, and getting-started for v0.5.0 (#481)

- CHANGELOG: add store() accessor (#466) and rusqlite 0.40 upgrade
- Roadmap: add v0.4.x and v0.5.0 entries (previously stuck at v0.3.0)
- Getting started: mention --extract flag and Hermes memory-provider

Co-authored-by: ajianaz <[email protected]>

* docs: add marketing assets + fix install URL + test count (#483)

* docs: add marketing assets + fix install URL + test count

README updates:
- Add banner image (docs/assets/uteke-banner.png)
- Add architecture diagram (docs/assets/uteke-architecture.png)
  with HNSW + FTS5 + RRF pipeline description
- Add comparison infographic (docs/assets/uteke-comparison.png)
- Fix install URL: raw.githubusercontent → codecora.dev/install
  (CF Worker redirect, cleaner)
- Fix test count: 295 → 312 unit tests (verified)

README.id.md: same install URL + test count fixes.

* docs: update test count 312 → 327

---------

Co-authored-by: ajianaz <[email protected]>

* chore: bump status badge v0.4.3 → v0.5.0 (#484)

Co-authored-by: ajianaz <[email protected]>

* release: v0.5.0 (#485)

* release: bump version to v0.5.0

Features:
- Hermes memory-provider plugin (--memory-provider)
- LLM-backed fact extraction on import (--extract)
- Configurable embedding endpoint path
- Default max_seq_length 256 → 2048
- Public store() accessor
- rusqlite 0.31 → 0.40

* release: bump inter-crate dependency versions to 0.5.0

---------

Co-authored-by: ajianaz <[email protected]>

---------

Co-authored-by: ajianaz <[email protected]>
Co-authored-by: Ginanjar Noviawan <[email protected]>
ajianaz added a commit that referenced this pull request Aug 13, 2026
Adds `uteke init --agent hermes --memory-provider`, which installs a
MemoryProvider plugin to ~/.hermes/plugins/uteke/ that makes uteke
Hermes's default long-term memory:

- automatic recall prefetched + injected into the prompt each turn
- opt-in LLM fact extraction on session end / pre-compress
- direct subprocess to the uteke binary (no uteke-serve daemon)
- circuit breaker so a bad endpoint never blocks the agent

Plugin templates live in extensions/hermes-memory-provider/ and are
embedded via include_str! so the generated plugin always matches the
binary. Complements the existing uteke-tool plugin (manual HTTP actions)
rather than replacing it.

Docs: docs/integrations/hermes.md documents both modes (tool vs
memory-provider). Zero new dependencies.

Co-authored-by: Anaz S. Aji <[email protected]>
ajianaz added a commit that referenced this pull request Aug 13, 2026
* feat: configurable embedding endpoint path (#473) (#474)

* feat: configurable embedding endpoint path (#473)

Add endpoint_path config field and UTEKE_EMBEDDING_ENDPOINT_PATH env var
for OpenAI-compatible backends that use non-standard paths (e.g. CodeCora
Embed uses /embed instead of /embeddings).

Changes:
- openai.rs: add endpoint_path field, DEFAULT_ENDPOINT_PATH constant,
  normalize leading slash, update all tests
- config.rs: add endpoint_path to EmbeddingConfig, TOML merge, ENV override
- lib.rs: add endpoint_path to EmbeddingSettings, resolve_with_defaults,
  pass to OpenAiEmbedder::new() in ensure_embedder

Zero breaking change: defaults to /embeddings (OpenAI standard).
Cora review: clean.

* fix: add missing endpoint_path to EmbeddingSettings literals

- main.rs: CLI EmbeddingSettings construction
- lib.rs: 3 test struct literals
- cargo fmt applied

CI failures expected: missing field, format.

* fix: restore original test credential values corrupted by patch

The fuzzy patch tool replaced real credential-like test strings (sk-*-config,
sk-config-only) with literal '***'. Restore original values to fix CI test
failures.

---------

Co-authored-by: ajianaz <[email protected]>

* feat: default max_seq_length 256→2048 for ONNX embedding (#472) (#475)

- engine.rs: MAX_SEQ_LEN constant 256→2048
- config.rs: EmbeddingConfig default 256→2048
- Add UTEKE_MAX_SEQ_LENGTH env var override
- Update 4 test assertions for new default

Aligns with CodeCora Embed Modal API and practical use cases.
Zero breaking change for explicit config users.

Closes #472

Co-authored-by: ajianaz <[email protected]>

* docs: update CHANGELOG and configuration.md for #474 & #475 (#476)

- Add Unreleased section in CHANGELOG for:
  - #473: configurable embedding endpoint_path + ENV override
  - #472: max_seq_length 256→2048 default + ENV override
- Fix docs/configuration.md:
  - max_seq_length default: 256 → 2048
  - Add endpoint_path config field and table row
  - Add UTEKE_EMBEDDING_ENDPOINT_PATH env var
  - Add UTEKE_MAX_SEQ_LENGTH env var

Co-authored-by: ajianaz <[email protected]>

* fix(cora): add ignore.rules for hardcoded secret false positives (#478)

Cora LLM flags struct field declarations named api_key as
'Hardcoded password or secret in variable' — these are identifiers,
not hardcoded values. rules field (soft LLM instruction) is insufficient;
add deterministic ignore filter that matches on issue title.

Also remove the non-effective LLM-only rule that was added
attempting to suppress the same issue.

Co-authored-by: ajianaz <[email protected]>

* feat(import): opt-in LLM fact extraction (--extract) (#477)

* feat(import): add opt-in LLM fact extraction (--extract)

Raw source material (chat transcripts, long notes, exported dumps) is
noisy and pollutes recall when imported verbatim. `uteke import --extract`
distills the input into atomic facts via an OpenAI-compatible
chat-completions endpoint and stores one memory per fact.

Opt-in and offline-first: without --extract the importer makes no network
calls and behaves exactly as before. Settings resolve CLI flag >
UTEKE_EXTRACTION_* env > [extraction] config > default, and the API key
falls back to the embedding/OPENAI_API_KEY credential so an existing
OpenAI-compatible setup needs no duplication.

Follows the existing embedding-backend pattern (reqwest blocking, bearer
auth, base_url/endpoint_path, URL validation). No new dependencies.

Relates to #46 (Obsidian/CSV import was partially landed; this completes
the "import from external knowledge sources" goal for noisy free-form text).

* chore(cora): suppress false-positive secret findings on api_key identifiers

CodeCora's static scanner flags struct fields and CLI flags named
`api_key` / `extract_api_key` as "hardcoded password or secret", but
these are identifiers populated at runtime from env/config/CLI input,
never literal secrets. Mirrors the existing `embed/openai.rs` api_key
field. Adds a suppression rule following the same pattern already used
for the SQL-injection false positive.

---------

Co-authored-by: Anaz S. Aji <[email protected]>

* chore(cora): suppress false-positive command injection on subprocess pattern (#480)

subprocess.run(cmd) in __init__.py.tmpl uses controlled args
(self._bin + hardcoded literals), not dynamic user input.
Add context rule + ignore rule to prevent Cora/CodeCora false positives.

Co-authored-by: ajianaz <[email protected]>

* feat(init): add Hermes memory-provider plugin (--memory-provider) (#479)

Adds `uteke init --agent hermes --memory-provider`, which installs a
MemoryProvider plugin to ~/.hermes/plugins/uteke/ that makes uteke
Hermes's default long-term memory:

- automatic recall prefetched + injected into the prompt each turn
- opt-in LLM fact extraction on session end / pre-compress
- direct subprocess to the uteke binary (no uteke-serve daemon)
- circuit breaker so a bad endpoint never blocks the agent

Plugin templates live in extensions/hermes-memory-provider/ and are
embedded via include_str! so the generated plugin always matches the
binary. Complements the existing uteke-tool plugin (manual HTTP actions)
rather than replacing it.

Docs: docs/integrations/hermes.md documents both modes (tool vs
memory-provider). Zero new dependencies.

Co-authored-by: Anaz S. Aji <[email protected]>

* docs: update CHANGELOG, roadmap, and getting-started for v0.5.0 (#481)

- CHANGELOG: add store() accessor (#466) and rusqlite 0.40 upgrade
- Roadmap: add v0.4.x and v0.5.0 entries (previously stuck at v0.3.0)
- Getting started: mention --extract flag and Hermes memory-provider

Co-authored-by: ajianaz <[email protected]>

* docs: add marketing assets + fix install URL + test count (#483)

* docs: add marketing assets + fix install URL + test count

README updates:
- Add banner image (docs/assets/uteke-banner.png)
- Add architecture diagram (docs/assets/uteke-architecture.png)
  with HNSW + FTS5 + RRF pipeline description
- Add comparison infographic (docs/assets/uteke-comparison.png)
- Fix install URL: raw.githubusercontent → codecora.dev/install
  (CF Worker redirect, cleaner)
- Fix test count: 295 → 312 unit tests (verified)

README.id.md: same install URL + test count fixes.

* docs: update test count 312 → 327

---------

Co-authored-by: ajianaz <[email protected]>

* chore: bump status badge v0.4.3 → v0.5.0 (#484)

Co-authored-by: ajianaz <[email protected]>

* release: v0.5.0 (#485)

* release: bump version to v0.5.0

Features:
- Hermes memory-provider plugin (--memory-provider)
- LLM-backed fact extraction on import (--extract)
- Configurable embedding endpoint path
- Default max_seq_length 256 → 2048
- Public store() accessor
- rusqlite 0.31 → 0.40

* release: bump inter-crate dependency versions to 0.5.0

---------

Co-authored-by: ajianaz <[email protected]>

---------

Co-authored-by: ajianaz <[email protected]>
Co-authored-by: Ginanjar Noviawan <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants