Skip to content

feat(memory): add semantic backend registry - #627

Merged
delete-cloud merged 1 commit into
mainfrom
feat/tape-memory-index-retrieval
Jun 25, 2026
Merged

delete-cloud merged 1 commit into
mainfrom
feat/tape-memory-index-retrieval

Conversation

@delete-cloud

@delete-cloud delete-cloud commented Jun 25, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Add a Coding Agent semantic memory backend registry/factory.
  • Route semantic backend validation and construction through the registry.
  • Keep the first slice intentionally limited to the existing fake backend; no concrete Chroma/Milvus/pgvector adapters or AgentKit provider names are added.
  • Preserve disabled semantic backend behavior: unknown backend names are inert while semantic memory is disabled, and still fail fast when enabled.

Verification

  • UV_PYTHON=3.12 uv run pytest tests/coding_agent/test_memory_index_backend_contract.py tests/coding_agent/test_memory_switch.py tests/coding_agent/test_semantic_tape_index.py tests/coding_agent/test_semantic_recall.py tests/coding_agent/test_semantic_sync.py -q
  • uv run ruff check src/coding_agent/core/app.py src/coding_agent/topics/semantic_backends tests/coding_agent/test_memory_index_backend_contract.py tests/coding_agent/test_memory_switch.py
  • uv run ruff format --check src/coding_agent/core/app.py src/coding_agent/topics/semantic_backends tests/coding_agent/test_memory_index_backend_contract.py tests/coding_agent/test_memory_switch.py
  • git diff --check -- src/coding_agent/core/app.py src/coding_agent/topics/semantic_backends/__init__.py src/coding_agent/topics/semantic_backends/base.py src/coding_agent/topics/semantic_backends/registry.py tests/coding_agent/test_memory_index_backend_contract.py tests/coding_agent/test_memory_switch.py

Review

  • Local read-only subagent review: no P1/P2 code findings.
  • One review gate warning about untracked registry.py was addressed before commit; the file is included in this PR.

Summary by CodeRabbit

  • New Features

    • Added support for selecting from available semantic memory backends, with the app now using the configured backend automatically.
    • Exposed backend options through the public package interface for easier integration.
  • Bug Fixes

    • Improved validation so invalid semantic backend selections are rejected earlier.
    • Made backend setup more reliable when semantic memory is enabled.
  • Refactor

    • Simplified several internal semantic-memory helper operations.

Introduce a Coding Agent semantic backend factory registry and route semantic memory backend validation/construction through it.\n\nVerification:\n- UV_PYTHON=3.12 uv run pytest tests/coding_agent/test_memory_index_backend_contract.py tests/coding_agent/test_memory_switch.py tests/coding_agent/test_semantic_tape_index.py tests/coding_agent/test_semantic_recall.py tests/coding_agent/test_semantic_sync.py -q\n- uv run ruff check src/coding_agent/core/app.py src/coding_agent/topics/semantic_backends tests/coding_agent/test_memory_index_backend_contract.py tests/coding_agent/test_memory_switch.py\n- uv run ruff format --check src/coding_agent/core/app.py src/coding_agent/topics/semantic_backends tests/coding_agent/test_memory_index_backend_contract.py tests/coding_agent/test_memory_switch.py\n- git diff --check -- src/coding_agent/core/app.py src/coding_agent/topics/semantic_backends/__init__.py src/coding_agent/topics/semantic_backends/base.py src/coding_agent/topics/semantic_backends/registry.py tests/coding_agent/test_memory_index_backend_contract.py tests/coding_agent/test_memory_switch.py
@coderabbitai

coderabbitai Bot commented Jun 25, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: fdc4c4fb-a10a-4f3b-a64e-03257d03678e

📥 Commits

Reviewing files that changed from the base of the PR and between c4932bf and e436109.

📒 Files selected for processing (6)
  • coding-agent/src/coding_agent/core/app.py
  • coding-agent/src/coding_agent/topics/semantic_backends/__init__.py
  • coding-agent/src/coding_agent/topics/semantic_backends/base.py
  • coding-agent/src/coding_agent/topics/semantic_backends/registry.py
  • coding-agent/tests/coding_agent/test_memory_index_backend_contract.py
  • coding-agent/tests/coding_agent/test_memory_switch.py

📝 Walkthrough

Walkthrough

Semantic memory setup now uses a registry to list available backends, validate configured backend names, and create the selected backend instance. The package exports the registry helpers, and tests cover registry behavior plus app-level wiring.

Changes

Semantic backend registry wiring

Layer / File(s) Summary
Registry API
coding-agent/src/coding_agent/topics/semantic_backends/registry.py, coding-agent/src/coding_agent/topics/semantic_backends/__init__.py
Adds the semantic backend registry, exposes the available backend names, and exports the registry helpers from the package.
App integration
coding-agent/src/coding_agent/core/app.py
Validates configured semantic backend names against the registry and creates the child-pipeline backend through the registry factory.
Registry and app tests
coding-agent/tests/coding_agent/test_memory_index_backend_contract.py, coding-agent/tests/coding_agent/test_memory_switch.py
Adds tests for registry listing, backend construction, unknown-backend errors, and app wiring through the registry factory.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

I sniffed the registry, bright and new,
Picked my backend by its name just so.
A schema hopped along with grace,
And tests kept time in bunny pace.
Thump! 🐇

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: introducing a semantic backend registry for memory handling.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/tape-memory-index-retrieval

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@delete-cloud
delete-cloud merged commit 88a8fd1 into main Jun 25, 2026
2 checks passed
@delete-cloud
delete-cloud deleted the feat/tape-memory-index-retrieval branch June 25, 2026 07:03
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.

1 participant