Live data from Hacker News

Show HN: Semantic grep with local embeddings

github.com

31–40 of 84 posts

Re: Show HN: Semantic grep with local embeddings

#31

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.

Fair comment- the initial thinking was to have both and in fact a hybrid mode too which fuses results so you can get chunks that match both semantically and on keyword search in one resultset. Later could add a reranker too.

Or another way of thinking. How much is the penalty we are talking about for semantic vs conventional grep?

My thinking is that for large codebase, sorting embedding matches maybe more efficient than reading all files and hence there is no point to put semantic search behind a --semantic flag

Re: Show HN: Semantic grep with local embeddings

#32

Earlier quoted context omitted.

LlamaIndex is batting a thousand since their inception. Can't go wrong with this tool, either.

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

Thanks!

Seems like CLI tools are all the rage these days

Re: Show HN: Semantic grep with local embeddings

#33
post #66

[stub for offtopicness]

This looks interesting and I look forward to trying it but the title here should really just use the description of the repo, or that be adjusted.

Apart from anything else it appears to be very misleading as Rust (ironically) according to the documentation is not one of the languages supported.

Re: Show HN: Semantic grep with local embeddings

#34
post #66

[stub for offtopicness]

This looks interesting and I look forward to trying it but the title here should really just use the description of the repo, or that be adjusted. Apart from anything else it appears to be very misleading as Rust (ironically) according to the documentation is not one of the languages supported.

I clicked on this because it said rust in the title. Very disappointed.

Re: Show HN: Semantic grep with local embeddings

#35

At this point, we aren't even saying it's written in Rust anymore, we just mention it in the title whenever possible. I did look into the core features and I gotta say, that looked quite cool. It's like Google search, but for the codebase. What does it take to support other languages?

It supports most languages but needs a bit of tree-sitter setup to do semantic chunking. Let me know what languages you’d like added

Java would be useful as well for larger backend codebases.

Re: Show HN: Semantic grep with local embeddings

#36
post #27

Earlier quoted context omitted.

What does this have to do with Claude Code?

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 curious your thoughts on speed. I'd rather any tools claude invokes be as fast as possible so it can get feedback immediately and execute again.

Re: Show HN: Semantic grep with local embeddings

#37

Earlier quoted context omitted.

This looks interesting and I look forward to trying it but the title here should really just use the description of the repo, or that be adjusted. Apart from anything else it appears to be very misleading as Rust (ironically) according to the documentation is not one of the languages supported.

I clicked on this because it said rust in the title. Very disappointed.

I'll add rust, ruby, elixir, Clojure next. It says rust as it's written in rust, sorry about that!

Re: Show HN: Semantic grep with local embeddings

#39
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 to move a cursor that walks along the AST, and then every time it makes a change you update the cursor location accordingly. You basically have a cursor in the text and a cursor in the AST and you keep them in sync so the LLM can't mess it up. If I ever have time I'll release something but right now just experimenting locally with it for my rust stuff On the topic of LLMs understanding ASTs, they are also quite good at this. I've done a bunch of applications where you tell an LLM a novel grammar it's never seen before _in the system prompt_ and that plus a few translation examples is usually all it takes for it to learn fairly complex grammars. Combine that with a feedback loop between the LLM and a compiler for the grammar where you don't let it produce invalid sentences and when it does you just feed it back the compiler error, and you get a pretty robust system that can translate user input into valid sentences in an arbitrary grammar.

https://news.ycombinator.com/item?id=44941999

Post reply on HN