Skip to content

Add jot related command with TF-IDF similarity#23

Open
Intina47 wants to merge 1 commit intomainfrom
mamba/implement-related-notes-suggestion
Open

Add jot related command with TF-IDF similarity#23
Intina47 wants to merge 1 commit intomainfrom
mamba/implement-related-notes-suggestion

Conversation

@Intina47
Copy link
Owner

Motivation

  • Provide a lightweight, local similarity feature to surface related notes so users can explore patterns in their single-file notebook.
  • Offer a simple CLI entry point to inspect related items from an existing note by ID.

Description

  • Add a related subcommand to main and usage text for jot related <note-id> in the README via README.md changes.
  • Implement note loading and preprocessing with loadNotes and extractNoteText to read ~/.jot/journal.txt into numbered notes.
  • Add a small TF-IDF pipeline (tfidfVectors, tokenize, vectorNorm) and cosine similarity (cosineSimilarity) to compute note-to-note similarity and return the top 5 matches in jotRelated.
  • Wire everything together so jotRelated prints matching note IDs and their raw lines, and validate input ranges with clear errors.

Testing

  • Added tests TestJotRelatedOutputsTopMatches and TestJotRelatedRejectsOutOfRangeID in main_test.go.
  • Ran go test ./... and the test suite passed (ok).
  • Existing tests around jotInit, ensureJournal, and jotList were left intact and continued to succeed.

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant