skills/ai-agent-development/agent-context/SKILL.md
Guides context management for AI agents: RAG pipelines, knowledge graphs, embeddings, conversation memory, and context window strategies. Use when adding external knowledge to agents or managing long conversations.
npx skillsauth add pkuppens/pkuppens agent-contextInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Patterns for providing agents with knowledge beyond the LLM's training data. Covers retrieval-augmented generation (RAG), knowledge graphs, embedding strategies, conversation memory, and context window management.
Documents → Ingestion → Chunking → Embedding → Vector Store
│
User query → Embedding → Similarity search ──────────┘
│
Retrieved chunks
│
System prompt + chunks + query → LLM → Response
| Strategy | Description | Best for | |----------|-------------|----------| | Fixed-size | Split by character/token count with overlap | General purpose, predictable chunk sizes | | Recursive | Split by structure (paragraphs, sentences, words) with fallback | Structured documents | | Semantic | Group by topic similarity using embeddings | Topic-coherent retrieval | | Document-aware | Respect headings, sections, tables | Technical documentation |
| Model | Dimensions | On-premises | Notes |
|-------|-----------|-------------|-------|
| all-MiniLM-L6-v2 | 384 | Yes (sentence-transformers) | Fast, good baseline |
| nomic-embed-text | 768 | Yes (Ollama) | Strong open-source option |
| text-embedding-3-small | 1536 | No (OpenAI API) | High quality, cloud-only |
| text-embedding-3-large | 3072 | No (OpenAI API) | Highest quality, cloud-only |
| Strategy | Mechanism | Strengths | |----------|-----------|-----------| | Dense (vector) | Cosine similarity on embeddings | Semantic matching | | Sparse (BM25) | Term frequency–inverse document frequency | Exact keyword matches | | Hybrid | Weighted combination of dense + sparse | Best of both approaches | | Re-ranking | Score initial results with a cross-encoder | Higher precision at retrieval time |
Use a knowledge graph when relationships between entities matter more than text similarity.
| Pattern | Description | Use when | |---------|-------------|----------| | Full history | Include all messages in prompt | Short conversations, small context windows | | Sliding window | Keep last N messages | Long conversations with recent-context focus | | Summarisation | Periodically summarise older messages | Very long sessions, memory-constrained | | Semantic memory | Store and retrieve relevant past messages by similarity | Agents that recall across sessions |
tiktoken for OpenAI, model-specific tokenisers for others)testing
Syncs remote default branch locally (checkout, fetch --prune, pull) and returns to the previous branch when it still exists. Reports stashes and worktrees not yet handled. Use when the user asks to sync main, update default branch, fetch/pull origin, or run /sync-branch.
tools
Creates, queries, updates, and links Azure Boards work items via az boards CLI. Use when filing ADO work items, running WIQL queries, or setting area path, iteration, tags, and assignee.
tools
Creates, reviews, and completes Azure Repos pull requests and branch policies via az repos CLI. Use when opening ADO PRs, setting required reviewers, or configuring build validation policies.
development
Guides Azure Pipelines YAML structure, build validation on PRs, and staged deployment with environments and approvals. Use when authoring azure-pipelines.yml or configuring CI/CD on Azure DevOps.