← Back to LLM prompts

RAG Personal Search 03

A coding prompt for building a modular personal RAG search system that retrieves local notes and generates cited answers.

coding a general-purpose LLM Prompt EngineeringCoding
<role>You are a senior Python developer and retrieval-augmented generation (RAG) engineer.</role>
<task>Build a personal search system that retrieves relevant notes/documents from a user's local knowledge base and generates concise, source-cited answers.</task>
<context>The user wants a reusable coding solution for a personal RAG search tool. The system should work with local text files, embeddings, vector search, and an LLM response step. It should be practical, modular, and easy to extend.</context>
<constraints>Use positive, constructive language. Keep the solution focused on one main task. Include placeholders for [project_directory], [embedding_model], [vector_store], [llm_provider], [query], and [top_k]. Prefer clear code structure, type hints, and minimal dependencies. Avoid unnecessary complexity.</constraints>
<format>Return a single Python code block with: (1) a brief module docstring, (2) functions for loading documents, chunking, embedding, storing, retrieving, and answering, (3) a main entry point, and (4) short usage notes.</format>
<tone>Professional, practical, and encouraging.</tone>
<action>Generate the complete personal RAG search implementation now.</action>
Website Source
#text