Skip to content

feat(memory): configure semantic embedding schema - #647

Merged
delete-cloud merged 4 commits into
mainfrom
feat/semantic-memory-config
Jun 28, 2026
Merged

delete-cloud merged 4 commits into
mainfrom
feat/semantic-memory-config

Conversation

@delete-cloud

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

Copy link
Copy Markdown
Owner

Summary

  • add semantic memory embedding schema overrides for provider/model/dimension
  • render optional Helm [memory.semantic] config when explicitly enabled
  • keep Helm defaults unchanged: semantic memory remains disabled and unrendered

Tests

  • uv run pytest tests/coding_agent/test_memory_switch.py::test_semantic_enabled_lancedb_backend_uses_configured_embedding_schema tests/deploy/test_helm_chart.py::test_helm_semantic_memory_enabled_renders_config -q
  • uv run pytest tests/coding_agent/test_memory_switch.py tests/coding_agent/test_memory_index_backend_contract.py tests/deploy/test_helm_chart.py -q
  • uv run pytest tests/ui/test_session_manager_runtime.py::test_sqlite_durable_semantic_rebuild_recalled_by_later_build_context_without_backend_hit_text tests/coding_agent/test_semantic_recall.py tests/coding_agent/test_semantic_sync.py tests/coding_agent/test_semantic_maintenance.py -q
  • uv run ruff check src/coding_agent/core/app.py tests/coding_agent/test_memory_switch.py tests/deploy/test_helm_chart.py

Notes

This prepares o6n semantic-memory dogfood by allowing the existing LanceDB backend to use the same OpenAI-compatible embedding settings as the deployed KB path, for example SiliconFlow BAAI/bge-m3 at 1024 dimensions. It does not enable semantic memory by default or change SRE values.

Summary by CodeRabbit

  • New Features

    • Added optional semantic memory support to the agent, including Helm configuration to enable it and set backend/embedding settings.
    • When enabled, the agent now includes the semantic memory plugin and uses the configured semantic memory storage and embedding parameters.
  • Bug Fixes

    • Improved configuration handling so semantic memory settings are validated and applied consistently, with clearer rejection of invalid values.
  • Tests

    • Expanded deployment and runtime coverage for the new semantic memory configuration and startup behavior.

@coderabbitai

coderabbitai Bot commented Jun 28, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@delete-cloud, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 47 minutes and 42 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: c3ae799b-ec37-4a3e-9f50-fde99c3ad801

📥 Commits

Reviewing files that changed from the base of the PR and between 3c249f6 and 46f9391.

📒 Files selected for processing (2)
  • coding-agent/src/coding_agent/core/app.py
  • coding-agent/tests/coding_agent/test_memory_switch.py
📝 Walkthrough

Walkthrough

Adds semantic memory configuration support to the Helm chart (new memory values block and conditional ConfigMap TOML section) and refactors SemanticMemoryConfig in app.py to parse and propagate optional embedding schema overrides (provider, model, dimension). New tests cover Helm rendering, runtime bootstrap, schema propagation, and validation.

Semantic Memory Configuration

Layer / File(s) Summary
Helm values and ConfigMap template
coding-agent/helm/values.yaml, coding-agent/helm/templates/configmap-agent-config.yaml
Adds memory.semantic defaults (disabled, lancedb backend, OpenAI embedding settings) and conditionally renders the semantic_memory plugin entry and [memory.semantic] TOML block in the ConfigMap.
SemanticMemoryConfig schema override parsing
coding-agent/src/coding_agent/core/app.py
Adds replace import; refactors _parse_semantic_memory_config to derive schema via new _semantic_schema_from_config (reads optional embedding overrides, validates types, merges with dataclasses.replace); extends to_config_dict to emit override fields only when they differ from backend defaults.
Unit tests for schema propagation and validation
coding-agent/tests/coding_agent/test_memory_switch.py
Updates mocked create_backend to capture embedding_fn; adjusts assertions; adds tests for configured embedding schema propagation into backend.schema and rejection of empty embedding_model.
Helm chart render and runtime bootstrap tests
coding-agent/tests/deploy/test_helm_chart.py
Adds tests rendering the chart with semantic memory enabled to assert TOML output, and bootstrapping the agent runtime to verify backend schema values, resolved db_path, and semantic_memory plugin registration.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Poem

🐇 A hop through the config, a leap through the TOML,
Semantic memory wakes where the embeddings roam,
LanceDB listens, the schema is set,
Provider and model — no override forget!
The rabbit has wired it, all tidy and true. 🌿

🚥 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 clearly and concisely describes the main change: configuring the semantic embedding schema for memory.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/semantic-memory-config

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 marked this pull request as ready for review June 28, 2026 08:02

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@coding-agent/src/coding_agent/core/app.py`:
- Around line 311-315: Update the memory semantic config validation in app.py so
whitespace-only overrides are treated as blank, not valid values. In the helper
that validates the [memory.semantic].{key} setting, keep the string type check
but change the non-empty check to use strip() so inputs like "   " raise the
same ValueError as other blank values. This should be applied in the validation
path around the existing return value logic for the memory.semantic schema
override.
- Around line 291-301: The payload builder in app.py should stop returning all
three embedding fields whenever any one differs from defaults. Update the
schema-to-dict logic around the existing default comparison so it emits only the
individual fields in schema.embedding_provider_id, schema.embedding_model, and
schema.embedding_dim that actually differ from default_schema, returning an
empty dict only when all match. Keep the behavior localized to this
serialization helper so defaults are not written back as explicit config.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: e90a0380-efc1-49b4-9703-5e9f09cf36ab

📥 Commits

Reviewing files that changed from the base of the PR and between a453af6 and 3c249f6.

📒 Files selected for processing (5)
  • coding-agent/helm/templates/configmap-agent-config.yaml
  • coding-agent/helm/values.yaml
  • coding-agent/src/coding_agent/core/app.py
  • coding-agent/tests/coding_agent/test_memory_switch.py
  • coding-agent/tests/deploy/test_helm_chart.py

@delete-cloud
delete-cloud merged commit 36a2bef into main Jun 28, 2026
2 checks passed
@delete-cloud
delete-cloud deleted the feat/semantic-memory-config branch June 28, 2026 08:31
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