Live data from Hacker News

Show HN: Semantic grep with local embeddings

github.com

51–60 of 84 posts

Re: Show HN: Semantic grep with local embeddings

#51
post #4

this is so cool, is there any other tool which is more mature?

I recently saw SemTools [0], but have not tried it out yet myself. [0] https://github.com/run-llama/semtools

I don't see how these are apples-to-apples given its "send me all your content" approach https://github.com/run-llama/semtools#:~:text=get%20your%20a...>

versus https://github.com/BeaconBay/ck#:~:text=yes%2C%20completely%...

Re: Show HN: Semantic grep with local embeddings

#52

Earlier quoted context omitted.

Mainly I wrote it because I noticed Claude's "by design" use of grep meant it couldn't search the code base for things it didn't already know the name of, or find "the auth section". But equally, it's well documented that e.g. Cursor's old RAG technique wasn't that great. My idea was to make a tool that just does a quick and simple embedding on each file, and uses that to provide a semantic alternative that is much c…

CC is so good with grep that I'm half expecting to clutter its context with bad results from semantic search. But also half optimistic at this just improving its search. If you're getting useful results from hybrid mode that's very interesting to me since well-constructed grep that claude executes don't really look like they'd work great for semantic search to me! But intuition is often wrong on this stuff. I am very…

if you’re concerned about context you can trivially make a hook that will prune your conversation history of older semantic search results.

i do a lot of context management with hooks for all sorts of tool calls.

Re: Show HN: Semantic grep with local embeddings

#53

I saw this comment a little bit back and I don’t think the OP expanded on it, but this looks like a fantastic idea to me: sam0x17 20 days ago: Didn't want to bury the lead, but I've done a bunch of work with this myself. It goes fine as long as you give it both the textual representation and the ability to walk along the AST. You give it the raw source code, and then also give it the ability to ask a language server…

One thing to take care with in cases like this, it probably needs to handle code with syntax errors. It's not uncommon for developers to work with code that doesn't parse (e.g. while you're typing, to resolve merge conflicts, etc).

In general, a drum I beat regularly is that during development the code spends most of its time incorrect in one way or another. Syntax errors, doesn't type check, missing function implementations, still working out the types and their relationships, etc. Any developer tooling that only works on valid code immediately loses a lot of its value.

Re: Show HN: Semantic grep with local embeddings

#54
post #53

I saw this comment a little bit back and I don’t think the OP expanded on it, but this looks like a fantastic idea to me: sam0x17 20 days ago: Didn't want to bury the lead, but I've done a bunch of work with this myself. It goes fine as long as you give it both the textual representation and the ability to walk along the AST. You give it the raw source code, and then also give it the ability to ask a language server…

One thing to take care with in cases like this, it probably needs to handle code with syntax errors. It's not uncommon for developers to work with code that doesn't parse (e.g. while you're typing, to resolve merge conflicts, etc). In general, a drum I beat regularly is that during development the code spends most of its time incorrect in one way or another. Syntax errors, doesn't type check, missing function impleme…

Isn't that the benefit of treesitter? I was under the impression that it's more accepting of these types of errors, at least to a degree where you can get enough info to fix it.

Re: Show HN: Semantic grep with local embeddings

#55

Earlier quoted context omitted.

CC is so good with grep that I'm half expecting to clutter its context with bad results from semantic search. But also half optimistic at this just improving its search. If you're getting useful results from hybrid mode that's very interesting to me since well-constructed grep that claude executes don't really look like they'd work great for semantic search to me! But intuition is often wrong on this stuff. I am very…

if you’re concerned about context you can trivially make a hook that will prune your conversation history of older semantic search results. i do a lot of context management with hooks for all sorts of tool calls.

That sounds great - do you have any examples?

Re: Show HN: Semantic grep with local embeddings

#57

Earlier quoted context omitted.

Agreed - Logan is a legend, this is similar but simpler - no dependency on external models (might add it)

We really are living in the golden age of the terminal. I thought this would take a chunk out of Typescript/node marketshare of young coders, but i'm starting to see more and more of these animals building TUIs using nothing but npm packages. Have they no shame?

[deleted]

Re: Show HN: Semantic grep with local embeddings

#58
I actually have a WIP library for this, the indexing server isn't where I want it just yet, but I have an entire agent toolkit that does this stuff, and the indexing server is quite advance, with self-tuning, raptor/lsp integration, solves for optimal result set using knapsack, etc.

https://github.com/sibyllinesoft/grimoire

Re: Show HN: Semantic grep with local embeddings

#59

There's also https://github.com/bartolli/codanna , that's similarly new. I'll have to try that again, and this one.

I've benchmarked the code search MCPs extensively and agents with LSP-aware mcps outperform agents using raw indexed stores quite handily. Serena, as janky as it is, is a better enabler than Codanna.

Re: Show HN: Semantic grep with local embeddings

#60

This is cool, but I don't understand why it tries to re-implement (a subset of) grep. Not only that, but the grep-like behaviour is the default and I need to opt-in to the semantic search using the --sem flag. If I want grep I can use grep/ripgrep.

The reason to overload grep is that the agents already understand most of the semantics and are primed to use it, so it's a small lift to get them to call a modified grep with some minor additional semantics.
Post reply on HN