Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@
<a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="license: MIT"></a>
</p>

<!-- Demo GIF goes here once recorded: `brew install vhs && vhs docs/demo.tape` -->
<p align="center">
<img src="https://raw.githubusercontent.com/devcodes9/agsearch/main/docs/demo.gif"
alt="Typing a misspelled half-remembered phrase; the session you meant is row one"
width="100%">
</p>

## Why not just `/resume`?

Expand Down Expand Up @@ -168,7 +172,7 @@ opened the session *asking for*, so it's weighted hardest; **length normalizatio
sprawling transcript that mentions your term once no longer outranks a short, on-point session.
Near-ties are then nudged by **recency** and by how often you've actually resumed that session
(read off agsearch's own resume log). Badge `N/T` = query terms matched. A word that barely exists
anywhere (a typo like `alibrry`) falls back to subsequence matching. No modes or flags.
anywhere (a typo like `conection`) falls back to subsequence matching. No modes or flags.

**Honest limit:** this is lexical, not semantic. Ranking beats an unordered `rg` dump, but it
is not a guarantee that row one is the session you meant. Because transcripts are large,
Expand Down
4 changes: 2 additions & 2 deletions agsearch
Original file line number Diff line number Diff line change
Expand Up @@ -1041,7 +1041,7 @@ def build_sessions(lines):
fh.write("\n".join(out))


# Common words that add noise, not signal, to a search ("migration OF alibrary").
# Common words that add noise, not signal, to a search ("migration OF the database").
_STOP = {"of", "the", "a", "an", "to", "for", "in", "on", "and", "or", "is", "it", "this",
"that", "with", "from", "by", "at", "as", "be", "are", "was", "were", "how", "do",
"i", "my", "me", "we", "you", "about", "into", "using", "use", "some", "any"}
Expand Down Expand Up @@ -1219,7 +1219,7 @@ def rank_sessions(rows, qterms, usage=None, now=None):
length normalization, so a sprawling session no longer outranks a short exact match, and
what a session was *opened to do* outweighs a passing mention buried in it. The result is
then nudged by recency and how often you've resumed that session. A term that exists almost
nowhere as text (a typo like 'alibrry') falls back to subsequence matching.
nowhere as text (a typo like 'conection') falls back to subsequence matching.
"""
usage = usage or {}
n = len(rows) or 1
Expand Down
Binary file added docs/demo.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
42 changes: 0 additions & 42 deletions docs/demo.tape

This file was deleted.