SelfLearningRvfBackend feedback and contrastive learning are disconnected from retrieval
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
- Create
SelfLearningRvfBackendwithlearning: true. - Insert two vectors.
- Call
searchAsync(). - Call
recordFeedback(firstHit.id, 1.0), using the returned document ID. - Inspect
getLearningStats().
Observed:
- Returned hits expose only
id,distance,similarity, andmetadata; there is no query or trajectory handle. - Feedback using the returned hit ID records zero trajectories.
- Guessing the hidden internal ID
q_0records 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_Nidentifiers 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:
searchAsync()creates a privateq_Nkey but never returns it or accepts a caller-owned correlation key.recordFeedback()does not assign the matchingrecentSearches[].quality, while contrastive sample creation requires that value.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
feedbackIdin 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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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