Index of every page on this site: llms.txt
All skills
apowerb avatar

/rag-search

@e6a80dd
by apowerbapowerb/apowerb150 stars
27
Run it yourself

Search and retrieve information from knowledge bases and documents using RAG (Retrieval-Augmented Generation). Use when the user asks questions about uploaded files, PDFs, documents, or wants to create a knowledge base for question answering. Keywords - knowledge base, document, RAG, search, PDF, file, index, question answering, retrieval, upload, find in document.

  • 2 files
  • 7.3 KB
  • Updated 4 months ago
  • GitHub
Use this Skill: https://skilld.dev/gh/apowerb/apowerb/rag-search

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

SKILL.md

≈95 tokens for metadata: the name and description. ≈959 when used: this file. ≈821 more on demand in 1 file.

Description uses 4.8% of example budget

Before choosing a Skill, your Agent reads its name and description. All available Skills share that space.

  • A shorter description leaves more room for other Skills. This entry exceeds our 1% size suggestion.

In our Claude Code example, all Skill names and descriptions share 8,000 characters. This Skill uses ≈380 characters, or 4.8%.

The 1% threshold is a size suggestion. Longer descriptions can still fit.

Your model, settings, and other Skills decide how much text your Agent can read.

Example settings and source

The example uses a 200k-token context and default Claude Code settings. The count includes the name, description, separators, and when_to_use when present. Codex also counts local file paths.

Skit's source and limits: Codex 0.160.1, Claude Code 2.1.292.

RAG Search — Knowledge Base Interaction

You are an expert at searching knowledge bases and retrieving relevant information from documents. Follow these steps to answer user questions using RAG.

Step 1: Check Existing Knowledge Bases

Always call tool_list_knowledge first to see what knowledge bases already exist.

  • Review the names and descriptions of available knowledge bases.
  • Determine which knowledge base is most likely to contain the answer.
  • If multiple knowledge bases might be relevant, plan to search each one.

Step 2: Create a Knowledge Base (If Needed)

If the user provides new files or documents that are not yet indexed:

  1. Call tool_create_knowledge with a descriptive name and the file references.
  2. Wait for indexing to complete.
  3. If indexing takes too long or times out, inform the user: "The documents are being indexed. This may take a few minutes depending on file size. You can ask your question again shortly."
  4. Do not attempt to search a knowledge base that is still indexing.

Supported File Types

  • PDF, Word (DOCX), Excel (XLSX), CSV, TXT, Markdown, JSON
  • For large files (> 50MB), warn the user that indexing may take longer.

Step 3: Formulate the Search Query

The quality of results depends heavily on query formulation. Follow these guidelines:

  • Be specific: Rephrase the user's question to be keyword-rich and targeted.
  • Use domain terms: If the documents use specific terminology, include those terms.
  • Avoid filler words: Strip out "can you tell me", "I want to know", etc.
  • Focus on entities: Include names, dates, numbers, and specific concepts.

Examples of Query Reformulation

User Question Search Query
"What does the contract say about termination?" "termination clause conditions notice period"
"How much revenue did we make in Q3?" "Q3 revenue total earnings third quarter"
"Who is responsible for approving expenses?" "expense approval authority responsible person"

Step 4: Search the Knowledge Base

Call tool_search_knowledge with your formulated query.

  • Review the returned chunks and their relevance scores.
  • If the top results do not seem relevant, proceed to Step 5.
  • If results are relevant, extract the answer and note the source document and section.

Step 5: Retry with Reformulated Query

If initial results are insufficient:

  1. Try a different angle — use synonyms, broader terms, or more specific terms.
  2. If the original query was specific, try a broader version.
  3. If the original query was broad, try a more specific version.
  4. Search a different knowledge base if multiple exist.

Try at most 2 different query reformulations before concluding the information is not available.

Step 6: Present the Answer

  • Always cite the source: Mention which document and section the answer came from.
    • Example: "According to the Employee Handbook (Section 4.2), the policy states..."
  • Quote relevant passages when they directly answer the question.
  • Synthesize across sources if information comes from multiple documents.
  • Be transparent about gaps: If the documents do not fully answer the question, say so clearly.
  • Do not hallucinate: Never make up information that is not in the retrieved content. If you are unsure, say "The documents do not appear to contain this information."

Guidelines

  • For multi-part questions, search for each part separately and combine the answers.
  • If the user asks about a topic not covered in any knowledge base, inform them and suggest uploading relevant documents.
  • When creating knowledge bases, use descriptive names that reflect the content (e.g., "Q3 Financial Reports" not "KB1").
  • If the user asks to search "all documents" or "everything", search all available knowledge bases.

Source: SKILL.md on GitHub

No rule matched.

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No third-party reports yet.

Signed by skilld at e6a80dd. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 6 days ago.

Activeupdated 4 months ago

README badge

README badge for apowerb/apowerb/rag-search