# Agent Knowledge

> Retrieve from knowledge bases explicitly configured on the current Agent.

- Skill: `zgiai/agent-knowledge` (Agent Skill)
- Install (CLI): `npx skillmds@latest add zgiai/agent-knowledge`
- Raw SKILL.md: https://api.skillmd.com/api/skills/zgiai/agent-knowledge/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- Author: zgiai (https://skillmd.com/u/zgiai)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/zgiai/agent-knowledge

---


# Agent Knowledge Skill

Use this skill to retrieve context only from knowledge bases configured on the current Agent.
Knowledge access is authorized when the editor binds the knowledge bases to the Agent, and runtime retrieval uses that Agent binding grant.

## Workflow

1. Call `retrieve_agent_knowledge` when the answer depends on the Agent's configured knowledge, product facts, policy, documentation, or other long-lived source material.
2. Use a concise query derived from the user's intent. Do not enumerate all user-accessible knowledge bases.
3. Do not ask for, guess, or pass dataset IDs. The backend reads configured knowledge bases from the Agent config.
4. Inspect `status`, `source_summary`, `context_blocks`, and scores before answering:
   - If `status` is `success` and the retrieved blocks answer the user, answer from those blocks.
   - If results are missing, weak, or off-topic, rewrite the query once using clearer entities, synonyms, or constraints from the user question and retry.
   - After two retrieval attempts, if the relevant answer is still unclear, ask the user for clarification or say that no configured relevant knowledge was found.
5. When the user asks for original wording, definitions, synopsis text, policy clauses, exact wording, or "what does it say", quote or closely excerpt the retrieved source text first and cite the source. Summarize only when the user asks for a summary or the original text is too long.
6. When retrieved context is used, cite source names from `source_summary` or `retriever_resources` when useful.
7. Never expose internal IDs such as dataset ID, document ID, or segment ID to the user.
8. Never invent a knowledge-base answer when no relevant configured context was found.

## Tool Usage

`retrieve_agent_knowledge` accepts:

- `query`: the user question or refined search query.
- `top_k`: optional maximum retrieved chunks. Defaults to 5 and is capped at 20.
- `retrieval_mode`: optional `hybrid`, `vector`, or `graph`. Omit it for the default hybrid mode; use `graph` only for relationship or entity questions.

