Langchain4j RAG Implementation Patterns
giuseppe-trisciuoglio/developer-kit
Provides Retrieval-Augmented Generation (RAG) implementation patterns with LangChain4j for Java.
Retrieve relevant information from a knowledge base using semantic, keyword, or hybrid search to ground a query.
$ npx skills add seb1n/awesome-ai-agent-skills --skill context-retrieval -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install seb1n/awesome-ai-agent-skills context-retrieval --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/seb1n/awesome-ai-agent-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/context-engineering/context-retrieval .claude/skills/context-retrieval && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "context-retrieval" agent skill from https://github.com/seb1n/awesome-ai-agent-skills/tree/main/context-engineering/context-retrieval into .claude/skills/context-retrieval/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "context-retrieval", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/seb1n/awesome-ai-agent-skills/tree/main/context-engineering/context-retrievalType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add seb1n/awesome-ai-agent-skills --skill context-retrieval -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install seb1n/awesome-ai-agent-skills context-retrieval --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/seb1n/awesome-ai-agent-skills.git skills-src && mkdir -p .agents/skills && cp -r skills-src/context-engineering/context-retrieval .agents/skills/context-retrieval && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "context-retrieval" agent skill from https://github.com/seb1n/awesome-ai-agent-skills/tree/main/context-engineering/context-retrieval into .agents/skills/context-retrieval/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "context-retrieval", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add seb1n/awesome-ai-agent-skills --skill context-retrieval -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install seb1n/awesome-ai-agent-skills context-retrieval --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/seb1n/awesome-ai-agent-skills.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/context-engineering/context-retrieval .cursor/skills/context-retrieval && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "context-retrieval" agent skill from https://github.com/seb1n/awesome-ai-agent-skills/tree/main/context-engineering/context-retrieval into .cursor/skills/context-retrieval/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "context-retrieval", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/seb1n/awesome-ai-agent-skills.git --path context-engineering/context-retrieval--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add seb1n/awesome-ai-agent-skills --skill context-retrieval -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install seb1n/awesome-ai-agent-skills context-retrieval --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/seb1n/awesome-ai-agent-skills.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/context-engineering/context-retrieval .gemini/skills/context-retrieval && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "context-retrieval" agent skill from https://github.com/seb1n/awesome-ai-agent-skills/tree/main/context-engineering/context-retrieval into .gemini/skills/context-retrieval/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "context-retrieval", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install seb1n/awesome-ai-agent-skills context-retrievalInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add seb1n/awesome-ai-agent-skills --skill context-retrieval -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/seb1n/awesome-ai-agent-skills.git skills-src && mkdir -p .github/skills && cp -r skills-src/context-engineering/context-retrieval .github/skills/context-retrieval && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "context-retrieval" agent skill from https://github.com/seb1n/awesome-ai-agent-skills/tree/main/context-engineering/context-retrieval into .github/skills/context-retrieval/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "context-retrieval", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add seb1n/awesome-ai-agent-skills --skill context-retrieval -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install seb1n/awesome-ai-agent-skills context-retrieval --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/seb1n/awesome-ai-agent-skills.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/context-engineering/context-retrieval .opencode/skills/context-retrieval && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "context-retrieval" agent skill from https://github.com/seb1n/awesome-ai-agent-skills/tree/main/context-engineering/context-retrieval into .opencode/skills/context-retrieval/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "context-retrieval", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
context-retrievalRetrieve relevant information from a knowledge base using semantic, keyword, or hybrid search to ground a query.
Context Retrieval is an agent skill from seb1n/awesome-ai-agent-skills. Retrieve relevant information from a knowledge base using semantic, keyword, or hybrid search to ground a query. Use when the task starts with a corpus or index that must be searched; use context-ranking when candidate chunks already exist and only need ordering.
Its SKILL.md is about 2.1k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.
It sits in AI & LLM Engineering, covering Retrieval-augmented generation, Context engineering and Knowledge bases. The repository describes itself as: 103 ready-to-use AI agent skills for Claude Code, OpenAI Codex, Gemini CLI, Cursor, GitHub Copilot, Windsurf, and other Agent Skills-compatible tools. Complete SKILL.md… The licence is MIT.
6 steps, taken from the first numbered list in SKILL.md.
Read from SKILL.md and the folder at commit 75865a5. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
No scripts in the folder and no shell commands in SKILL.md.
From the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names these keys or tokens, usually read from environment variables:
JWT_SECRETFrom names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Context Retrieval loads about 2.1k tokens when it runs. Until then it costs about 70 tokens; SKILL.md has 1,020 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from seb1n/awesome-ai-agent-skills at commit 75865a5, republished under its MIT licence (© seb1n). 1,020 words, ~2,071 tokens.
.claude/skills/context-retrieval/SKILL.md (or your agent's skills folder).Context retrieval is the process of finding and assembling the most relevant pieces of information from a knowledge base to ground an AI agent's responses in factual, up-to-date data. It is the backbone of Retrieval Augmented Generation (RAG) and ensures that generated outputs are accurate and verifiable rather than hallucinated.
Embed the Query: Convert the user's natural-language query into a dense vector representation using an embedding model (e.g., OpenAI text-embedding-3-small, Cohere embed-v3, or an open-source model like bge-large). The embedding captures the semantic meaning of the query so it can be compared against stored documents.
Search the Vector Store: Send the query embedding to a vector database (Pinecone, Weaviate, Qdrant, Chroma, etc.) and perform an approximate nearest-neighbor (ANN) search. Request the top-k candidate chunks, typically k = 10–20 to give the reranker enough material to work with.
Rerank the Results: Pass the candidate chunks through a cross-encoder reranker (e.g., Cohere Rerank, bge-reranker-large, or a ColBERT model). The reranker scores each chunk against the original query with full attention, producing much more accurate relevance scores than cosine similarity alone. Keep the top-n results (typically n = 3–5).
Assemble the Context Window: Concatenate the selected chunks into a single context block, ordered by relevance score descending. Prepend source metadata (file path, URL, page number) to each chunk so the agent can cite its sources. Ensure the total token count fits the model's budget for the context section of the prompt.
Generate the Response: Feed the assembled context into the LLM prompt alongside the original query and a system instruction that tells the model to answer only from the provided context. This grounds the response in retrieved facts and reduces hallucination.
Validate and Cite: After generation, verify that the answer references information actually present in the retrieved chunks. Attach inline citations or a references section so the user can trace each claim back to a source document.
To use this skill, you need a pre-indexed knowledge base with document embeddings stored in a vector database. Provide a natural-language query as input. The skill returns the retrieved context block ready for prompt assembly, along with source metadata for citation.
Query: "How does the authentication middleware validate JWT tokens?"
Retrieved Chunks (after reranking):
| Rank | Source | Score | Snippet |
|---|---|---|---|
| 1 | src/middleware/auth.ts:14-38 | 0.94 | export function validateToken(req, res, next) { const token = req.headers.authorization?.split(' ')[1]; if (!token) return res.status(401).json({ error: 'Missing token' }); try { const decoded = jwt.verify(token, process.env.JWT_SECRET); req.user = decoded; next(); } catch (e) { return res.status(403).json({ error: 'Invalid token' }); } } |
| 2 | docs/auth-flow.md:8-22 | 0.87 | "The JWT is signed with HS256 using the JWT_SECRET env var. Tokens expire after 24 hours. The middleware extracts the token from the Authorization header, verifies the signature, and attaches the decoded payload to req.user." |
| 3 | tests/auth.test.ts:5-19 | 0.72 | Test cases covering valid token, expired token, and malformed token scenarios. |
Assembled Prompt:
Answer the following question using ONLY the provided context. Cite file paths.
Context:
[1] src/middleware/auth.ts:14-38 — export function validateToken(req, res, next) { ... }
[2] docs/auth-flow.md:8-22 — The JWT is signed with HS256 using the JWT_SECRET env var...
[3] tests/auth.test.ts:5-19 — Test cases covering valid token, expired token...
Question: How does the authentication middleware validate JWT tokens?Query: "How do I reset my password if I no longer have access to my email?"
Retrieved Chunks:
help/account-recovery.md (score 0.91) — "If you cannot access your registered email, navigate to Settings > Account > Identity Verification. You will be asked to verify your identity using your phone number or a government-issued ID. Once verified, you can set a new email and reset your password."help/password-reset.md (score 0.85) — "To reset your password, click 'Forgot Password' on the login page. A reset link will be sent to your registered email address. The link expires after 1 hour."Generated Answer: "Since you no longer have access to your email, use the identity verification flow: go to Settings > Account > Identity Verification, verify via phone number or government ID, update your email address, then reset your password from the login page. [Sources: help/account-recovery.md, help/password-reset.md]"
© seb1n, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in context-engineering/context-retrieval of seb1n/awesome-ai-agent-skills.
Open the folder on GitHubat commit 75865a5
Context Retrieval next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Context Retrieval this skillseb1n/awesome-ai-agent-skills | 206 | — | ~2.1k | Automated safety check: Pass | MIT | |
| Langchain4j RAG Implementation Patternsgiuseppe-trisciuoglio/developer-kit | 355 | 1 repos | ~3.3k | Automated safety check: Notes | MIT | |
| RAG Pipelinebrightdata/skills | 264 | — | ~1.9k | Automated safety check: Pass | MIT | |
| AWS Cloudformation Bedrockgiuseppe-trisciuoglio/developer-kit | 355 | — | ~3.2k | Automated safety check: Notes | MIT | |
| Blockify Integrationiternal-technologies-partners/blockify-agentic-data-optimization | 316 | — | ~6.2k | Automated safety check: Notes | Custom licence | |
| Agentsop Difyagentsope/SkillAlchemy | 459 | — | ~5.4k | Automated safety check: Notes | MIT |
giuseppe-trisciuoglio/developer-kit
Provides Retrieval-Augmented Generation (RAG) implementation patterns with LangChain4j for Java.
brightdata/skills
Build a RAG (retrieval-augmented generation) pipeline or a custom search engine on top of Bright Data's Discover API — using intent-ranked web results + parsed page content as the…
giuseppe-trisciuoglio/developer-kit
Provides AWS CloudFormation patterns for Amazon Bedrock resources including agents, knowledge bases, data sources, guardrails, prompts, flows, and inference profiles.
iternal-technologies-partners/blockify-agentic-data-optimization
Process documents with Blockify API to create optimized IdeaBlocks for RAG.
agentsope/SkillAlchemy
SOP for building LLM applications on Dify — visual workflow + chatflow + agent + RAG knowledge base + plugin marketplace + observability, self-hostable.
Prism-Shadow/penguin-harness
A skill your agent uses whenever the user wants to build an agent application — their own program with an embedded agent, such as an AI app, an agentic app or a RAG app.
seb1n/awesome-ai-agent-skills
Plan, execute, document, and retest authorized security assessments of AI agents and multi-agent workflows using safe adversarial cases, synthetic identities, canaries, and evidence-based findings.
seb1n/awesome-ai-agent-skills
Build a preliminary, evidence-based EU AI Act readiness assessment across AI-system inventory, territorial scope, operator roles, prohibited-practice screening, risk classification, transparency…
seb1n/awesome-ai-agent-skills
Design and verify auditable human oversight, approval gates, escalation paths, and safe state transitions for AI agent workflows.
seb1n/awesome-ai-agent-skills
Design, implement, harden, and verify Model Context Protocol (MCP) servers with precise tool contracts, least-privilege authorization, safe transports, structured errors, and interoperability tests.
seb1n/awesome-ai-agent-skills
Audit agent skills, plugins, prompts, manifests, scripts, dependencies, and bundled assets for provenance, prompt-injection, permission, execution, exfiltration, persistence, and update risk.
seb1n/awesome-ai-agent-skills
Inspect, profile, clean, reconcile, analyze, visualize, and verify spreadsheet data while preserving formulas, formatting, types, and source files.
Retrieve relevant information from a knowledge base using semantic, keyword, or hybrid search to ground a query. Context Retrieval is an agent skill from seb1n/awesome-ai-agent-skills. Retrieve relevant information from a knowledge base using semantic, keyword, or hybrid search to ground a query.
Context Retrieval fits situations like: the task starts with a corpus; index that must be searched; use context-ranking when candidate chunks already exist and only need ordering.
Run `npx skills add seb1n/awesome-ai-agent-skills --skill context-retrieval -a claude-code`. Or copy the skill folder (context-engineering/context-retrieval in seb1n/awesome-ai-agent-skills) into .claude/skills/context-retrieval in your project. Claude Code loads it when a task matches its description.
Run `npx skills add seb1n/awesome-ai-agent-skills --skill context-retrieval -a codex`. Or copy the skill folder (context-engineering/context-retrieval in seb1n/awesome-ai-agent-skills) into .agents/skills/context-retrieval in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add seb1n/awesome-ai-agent-skills --skill context-retrieval -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/context-retrieval, .gemini/skills/context-retrieval, .github/skills/context-retrieval and .opencode/skills/context-retrieval in your project.
Going by SKILL.md and its folder, Context Retrieval needs credentials named JWT_SECRET. Our summary lists: A credential in JWT_SECRET.
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Context Retrieval is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.
About 2.1k tokens (SKILL.md is roughly 8.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Context Retrieval: Langchain4j RAG Implementation Patterns (giuseppe-trisciuoglio/developer-kit, 355 stars), RAG Pipeline (brightdata/skills, 264 stars), AWS Cloudformation Bedrock (giuseppe-trisciuoglio/developer-kit, 355 stars) and Blockify Integration (iternal-technologies-partners/blockify-agentic-data-optimization, 316 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
seb1n (a GitHub user) maintains it in seb1n/awesome-ai-agent-skills, which has 206 GitHub stars. The repository holds 91 skills in this directory. The repository was last updated on August 9, 2026.
Source: seb1n/awesome-ai-agent-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.