ruvnet / ruvnet/agentdb

SelfLearningRvfBackend feedback and contrastive learning are disconnected from retrieval

Open
#14 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
89
Forks
15
PR merge metrics
No merged PRs in 30d

Description

Versions

  • agentdb@3.0.0-alpha.17
  • @ruvector/sona@0.1.7
  • Node 26.4.0, macOS arm64

Reproduction

  1. Create SelfLearningRvfBackend with learning: true.
  2. Insert two vectors.
  3. Call searchAsync().
  4. Call recordFeedback(firstHit.id, 1.0), using the returned document ID.
  5. Inspect getLearningStats().

Observed:

  • Returned hits expose only id, distance, similarity, and metadata; there is no query or trajectory handle.
  • Feedback using the returned hit ID records zero trajectories.
  • Guessing the hidden internal ID q_0 records one trajectory, proving the trajectory exists but its identifier is unreachable through the public result.
  • Feeding one low-quality and one high-quality trajectory through guessed q_N identifiers still creates zero contrastive samples and zero training batches.
  • forceLearn() does not change that result.

Root cause

There are three independent breaks in the loop:

  1. searchAsync() creates a private q_N key but never returns it or accepts a caller-owned correlation key.
  2. recordFeedback() does not assign the matching recentSearches[].quality, while contrastive sample creation requires that value.
  3. ContrastiveTrainer.project() is not called by the search path, so even trained projection weights cannot affect retrieval.

Impact

The advertised self-learning path can collect neither normal asynchronous feedback safely nor use contrastive training to change rankings. Applications may believe retrieval is learning when it is effectively unchanged.

Requested fix

  • Accept a caller-provided opaque feedbackId in search options, with duplicate-ID validation.
  • Link feedback quality to the matching recent search.
  • Apply the trained projection to retrieval only after a trained batch exists.
  • Add concurrent and out-of-order feedback tests.
  • Add an end-to-end held-out test showing that feedback measurably changes ranking.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing SelfLearningRvfBackend.searchAsync(), recordFeedback(), getLearningStats(), forceLearn(), and ContrastiveTrainer.project(). Reproduce the q_N correlation and contrastive-training failures, then inspect the existing recent-search handling and retrieval path. Done means caller-owned feedback IDs work with concurrent and out-of-order feedback, contrastive batches train, and the held-out ranking test shows the trained projection affects retrieval.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
backend-api-design, databases, machine-learning, testing-qa
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.