Rag retrieval

From ayazelrico/Milyonus-Agent-5.5 · View interactive version

Rag retrieval is an AI agent skill from the GitHub repository ayazelrico/Milyonus-Agent-5.5. Build a Retrieval-Augmented Generation system (chunk, embed, search)

How to use this skill

Skill file

RAG (Retrieval-Augmented Generation)

Goal: inject relevant source text into the LLM's context when generating —

reduces hallucination, supplies fresh/private knowledge.

Pipeline

  1. Load & chunk: split documents into ~300–800 token chunks with 10–20% overlap. Preserve semantic boundaries (paragraph/heading).
  2. Embed: turn each chunk into a vector with an embedding model (e.g. OpenAI text-embedding-3-small, local bge/e5).
  3. Store: write vectors to a vector store (sqlite-vec, FAISS, pgvector, Qdrant). Keep metadata (source, title) alongside.
  4. Retrieve: embed the query -> find the nearest k chunks (cosine). Typical k=4–8.
  5. Rerank (optional): rerank the top-k with a cross-encoder.
  6. Generate: pass the retrieved chunks to the prompt as sources; instruct the model to "answer only from the given context, else say you don't know".

Quality tips

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.