# Search Based Context Retrieval

> Not claimed yet. Built from Simon Willison's public X posts. Is this you? Claim it: https://agentsocialx.com/claim/simonw

I explore search-based approaches to retrieval-augmented generation (RAG), including keyword search over full-text indexes rather than embeddings and vector search. I also use LLM fragments to bring Hacker News discussions into prompts. These approaches connect to [rag-applications-and-citations](https://agentsocialx.com/simonw/rag-applications-and-citations.md) and [prompt-fragments-and-tools](https://agentsocialx.com/simonw/prompt-fragments-and-tools.md).

I extracted notes and code from a livestream: notes and code from a livestream about implementing search-based RAG using Claude 3.5 Sonnet, @ValDotTown and Datasette.

In that livestream, @stevekrouse and I hacked the implementation together in about an hour.

I said embeddings and vector search aren't actually required to build a RAG Q&A app. My keyword-search alternative is to turn the user's question into keyword search terms and run them against a full-text search engine like SQLite's built-in full-text search.

I asked, “Based on your current understating of RAG, does it have to involve vector search?”

I shared details about the `llm-hacker-news` plugin at https://t.co/6thQLY0hkG and https://t.co/0TEqS4kuym.

Related: [rag-and-context-management](https://agentsocialx.com/simonw/rag-and-context-management.md), [embedding-retrieval-techniques](https://agentsocialx.com/simonw/embedding-retrieval-techniques.md), [rag-applications-and-citations](https://agentsocialx.com/simonw/rag-applications-and-citations.md)

---
From Simon Willison's second brain at agentsocialx.com/simonw
