← all conversations

RAG system prompt creation

2025-10-172 turns5,996 charsgpt-5
ragprompt-engineeringknowledge-management

Summary

User sought to create a system prompt for a RAG system with expertise in computer science and best practices.

Messages

You are the best prompt writer who has ever lived. You know absolutely everything there is to know about computer science and best practices but always verify your sources and test absolutely everything so that you know what you are doing will work. Your job is to write a prompt will instruct a different LLM with access to MCP servers as well as github connection to the repo in question that needs to be improved. The things which need improved are that it needs a UI for one. It should be a chat window that can be interacted with to do RAG. The main thing is that it uses Graph and Vector for a hybrid search. That is what I really want you to research is how to do really good RAG on a set of documents so that it uses Ollama for the local inference and also I want it to use the best strategies for chunkinwg, database management and everything else that needs to be taken into consideration. Pretty please with sugar on top. You have one and only one deliverable which is the prompt that I will give to another LLM which will generate the prompt I give to CLIne. So you are not directing it to CLIne, although I want you to research what they recently updated and include that because I included things like MCP servers like context7 and others. Anyway all I want from you is an output which is as long as possible which will instruct the LLM to output the prompt to be given to CLIne.
Below is a **draft “super-prompt”** you can feed into your orchestrator LLM (the one with access to MCP servers and GitHub) so that it will generate the **prompt for CLIne** that meets all your requirements. (You can of course iterate on this.) The idea is: this meta-prompt instructs the orchestrator LLM *how* to emit the prompt for CLIne, including architectural guidelines, detailed constraints, etc. --- **Super-Prompt to give to the orchestrator LLM (the one with MCP / GitHub access):** > You are a highly capable DevOps/ML architect agent. Your job is to **write** a prompt for CLIne (which will be used downstream) so that CLIne will generate or modify a codebase (in our repo) into a high-quality RAG system with a chat UI, using hybrid (graph + vector) retrieval, leveraging Ollama for local inference, and following best practices. > > You have access to: > - The target GitHub repo (so you can inspect its structure, code files, dependencies, etc.) > - MCP servers / context7 / any other infra available > - Any internal resources or compute needed > > The generated prompt (which you produce for CLIne) must: > 1. Clearly lay out the architecture and modular components (e.g. ingestion / indexing / retrieval / generation / UI / API layers). > 2. Require the chat UI (web or desktop) with interactive messaging, streaming responses, memory context, user feedback, etc. > 3. Demand hybrid search combining **vector (dense)** search and **graph / knowledge graph / structural retrieval / link traversal**. > 4. Specify chunking strategies, embedding model selection, overlap, fallback strategies, re-ranking, filtering, metadata, and evaluation metrics. > 5. Handle database management: how to store chunks, embeddings, graph nodes/edges, metadata, versioning, updates, deletion, incremental reindexing, consistency, backups. > 6. Integrate Ollama (local LLM inference) as the generation engine, including prompt construction, context windows, streaming responses, and cost/throughput trade-offs. > 7. Include instructions to test, benchmark, and validate each component (e.g. retrieval recall / precision, latency, hallucination tests). > 8. Lay out error handling, fallback strategies, logging, observability, and monitoring. > 9. Optionally, include guidance on scaling (sharding, caching, quantization, memory budgets). > 10. Be explicit about versioning, dependencies, and interface contracts so that the generated code is coherent and maintainable. > While composing that prompt for CLIne, you (the orchestrator LLM) should refer to best practices and cite or internalize empirical pointers (e.g. from GraphRAG, ACORN, hybrid search, chunking strategies, pitfalls). > > A few technical references / constraints you should internalize when writing: > - GraphRAG is a good pattern to combine knowledge graph plus vector retrieval in a unified RAG architecture. (There are local Ollama adaptations / patches to GraphRAG to support local models. See “GraphRAG Local Setup via Ollama” for implementation pitfalls. ) citeturn0search8turn0search12turn0search19turn0search15 > - Hybrid search (dense + sparse) boosts recall and catches edge cases when embeddings miss tokens/keywords. Use hybrid search or re-ranking. citeturn0search10turn0search14turn0search17 > - Chunking: use overlapping chunks, tune chunk sizes relative to context window, maybe semantic or hierarchical chunking (e.g. via HiChunk ideas). citeturn0search28turn0search3turn0search9 > - Beware common vector search pitfalls: insufficient evaluation, ignoring hybrid search, chunk boundary issues, quantization or memory scaling problems. citeturn0search14turn0search31 > - For graph + vector hybrid indexes, research ACORN ideas (predicate-agnostic hybrid search) to unify sparse + dense queries. citeturn0academia27 > - Ingest pipelines: extract text cleanly (OCR, image captions, handle tables), build entities / edges for KG, then chunk or embed. citeturn0search7turn0search16turn0search19 > > The prompt you output for CLIne should be **self-contained** (i.e. not depend on this meta context) and precise (so that CLIne’s generated code is well scoped). > > **Your deliverable**: only the prompt to feed into CLIne (no extra filler). The prompt should be long, detailed, and prescriptive, but also modular so CLIne can break it into tasks or code modules. --- You can push that to your orchestrator LLM. If you like, I can simulate the output prompt for CLIne right now (i.e. act as the orchestrator LLM). Do you want me to generate that prompt now?
gpt-5