Don't use a vector database for code, embeddings are slow and bad for code. Code likes bm25+trigram, that gets better results while keeping search responses snappy.
You can do hybrid search in Postgres. Shameless plug: https://github.com/jankovicsandras/plpgsql_bm25 BM25 search implemented in PL/pgSQL ( Unlicense / Public domain ) The repo includes also plpgsql_bm25rrf.sql : PL/pgSQL function for hybrid search ( plpgsql_bm25 + pgvector ) with Reciprocal Rank Fusion; and Jupyter notebook examples.
Ask HN: How are you doing RAG locally?
111–120 of 166 posts
Re: Ask HN: How are you doing RAG locally?
#112https://github.com/ggozad/haiku.rag/ - the embedded lancedb is convenient and has benchmarks; uses docling. qwen3-embedding:4b, 2560 w/ gpt-oss:20b.
Re: Ask HN: How are you doing RAG locally?
#113Don't use a vector database for code, embeddings are slow and bad for code. Code likes bm25+trigram, that gets better results while keeping search responses snappy.
Anybody know of a good service / docker that will do BM25 + vector lookup without spinning up half a dozen microservices?
You can use pgvector for the vector lookup and paradedb for bm25.
Re: Ask HN: How are you doing RAG locally?
#114Re: Ask HN: How are you doing RAG locally?
#115Using Ollama for the embeddings with “nomic-embed-text”, with LanceDB for the vector database. Recently updated it to use “agentic” RAG, but probably not fully needed for a small project.
Re: Ask HN: How are you doing RAG locally?
#116Re: Ask HN: How are you doing RAG locally?
#117Most of my complex documents are, luckily, Markdown files. I can recommend https://github.com/tobi/qmd/ . It’s a simple CLI tool for searching in these kinds of files. My previous workflow was based on fzf, but this tool gives better results and enables even more fuzzy queries. I don’t use it for code, though.
Given that preface, I was really expecting that link to be a grepping tool rewritten in golang or something, or perhaps customised for markdown to weigh matches in "# heading title"s heavier for example
I haven't used it extensively, but semantic grep alone was kind of worth it.
Re: Ask HN: How are you doing RAG locally?
#118I am surprised to see very few setups leveraging LSP support. (Language Server Protocol) It has been added to Claude Code last month. Most setups rely on naive grep.
LSP is not great for non-editor use cases. Everything is cursor position oriented.
Re: Ask HN: How are you doing RAG locally?
#119sqlite + FTS + sqlite-vec + local LLM for reranking results (reasoning model)