jose-compu / jose-compu/funes.cpp

[LogosDB] Track and expose memory IDs in search results

Open
#10 0 comments 0 reactions 0 assignees View on GitHub
stale
Dominant language
C++
Stars
1
Forks
0
PR merge metrics
No merged PRs in 30d

Description

Update search result handling to expose memory IDs returned by LogosDB v0.2.0.

## Background
LogosDB v0.2.0 adds logosdb_result_id() to get row IDs from search results. Currently funes.cpp ignores these IDs.

## Proposed Changes

1. **Store IDs when teaching**
- Keep track of (text_hash -> id) mapping
- Or use sidecar metadata file for ID persistence

2. **Include ID in debug output**
- When LLAMA_SEMANTIC_MEMORY_DEBUG is set, show:
[semantic-memory] search hit: id=42 score=0.95 text="..."

3. **Use IDs for memory provenance**
- Track which memories were used in a response
- Enable feedback: "that memory was helpful / not helpful"

## Implementation
- Add id field to memory chunk structure
- Update build_llm_compressed_hint to receive IDs
- Update debug logging in search code path

## Acceptance Criteria
- [ ] Capture and store IDs from logosdb_put()
- [ ] Expose IDs in LLAMA_SEMANTIC_MEMORY_DEBUG output
- [ ] Include IDs in search results passed to compressor
- [ ] Document ID usage in SPECS.md

## Dependencies
- Requires LogosDB v0.2.0 (issue #8)

## Related Code
- tools/cli/cli.cpp lines 1377-1411 (search result handling)

Contributor guide

Open the contributing guide

Research direction

Start with tools/cli/cli.cpp lines 1377-1411 and trace the search result handling, including logosdb_result_id() and logosdb_put(). Review the memory chunk path and build_llm_compressed_hint, then update the debug output and search results to carry IDs. Done means the acceptance criteria are met, including documenting ID usage in SPECS.md; LogosDB v0.2.0 is required first.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
search
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.