Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add skills/artesiana/agent2/adding-knowledgenpx skills add Artesiana/agent2 --skill adding-knowledgegit clone --depth 1 https://github.com/Artesiana/agent2What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00044 | $0.01064 |
| Opus 5 | $0.00022 | $0.00532 |
| Sonnet 5 | $0.00009 | $0.00213 |
| Haiku 4.5 | $0.00004 | $0.00106 |
Grade A, and why
adding-knowledge scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 149 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Adding Knowledge to Agents
Overview
Agent2 agents access knowledge through R2R (hybrid search) via Knowledge MCP. You add PDFs or documents to a collection, the agent searches them at runtime. No hardcoding of domain rules — the agent learns from books.
When to Activate
- Agent needs to look up rules, standards, or reference material
- User says "add knowledge", "add books", "ingest documents", "RAG"
- Agent needs different knowledge per client/tenant/context
- User wants to replace hardcoded lookup tables with searchable knowledge
Architecture
PDFs / Documents
→ R2R ingestion (chunking, embedding, indexing)
→ Searchable collection
→ Knowledge MCP server (FastMCP wrapper)
→ Agent calls search() and get_passage() via toolsets=
Step-by-Step
1. Create Collection Directory
mkdir -p knowledge/books/my-collection/
# Place PDFs, markdown, or text files here
2. Register in collections.yaml
# knowledge/collections.yaml
collections:
my-collection:
description: "What these documents contain"
books_dir: books/my-collection/
agents:
- my-agent
3. Ingest Documents
# Start the full stack (includes R2R)
docker compose --profile full up -d
# Ingest all collections
python -m shared.ingest --all
# Or a specific collection
python -m shared.ingest --collection my-collection --dir knowledge/books/my-collection/
4. Wire Agent to Knowledge MCP
# agents/my-agent/agent.py
from pydantic_ai.mcp import MCPServerStreamableHTTP
knowledge_mcp_url = os.environ.get("KNOWLEDGE_MCP_URL", "http://localhost:9090/mcp")
knowledge_server = MCPServerStreamableHTTP(knowledge_mcp_url)
agent = create_agent(
name="my-agent",
output_type=MySchema,
instructions="... Use search() to look up relevant information ...",
toolsets=[knowledge_server],
)
For concurrent or request-scoped agents, create fresh MCPServerStreamableHTTP
instances in before_run() and return them as _toolsets; Agent2 passes them to
Agent.run(toolsets=...).
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 2d ago First seen · 149 lines · 44 tokens per session scan A c877462101da
adding-knowledge is a skill published in the GitHub repository Artesiana/agent2 (36 stars, last pushed 3mo ago), licensed MIT. It adds 44 tokens to every session and 1,064 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
fastapi-modern-patterns
Curated Knowledge API for AI Agents — 68 MCP tools, 200+ skill packs, 46K chunks, semantic search over 670K vectors, 5-layer validation pipeline. Works with Claude Code, Cursor, Cline, Windsurf.
fastapi-microservices-development
Comprehensive guide for building production-ready microservices with FastAPI including REST API patterns, async operations, dependency injection, and deployment strategies.
datamodel-code-generator
Use this skill when the user wants Python data models, Pydantic models, dataclasses, TypedDicts, msgspec structs, or type-safe Python classes generated from OpenAPI, AsyncAPI, JSON Schema, GraphQL, JSON/YAML/CSV sample data, MCP tool schemas, Protocol Buffers, XML Schema, Apache Avro, or existing Python model objects.…
openai-docs
Use when the user asks how to build with OpenAI products or APIs and needs up-to-date official documentation with citations (for example: Codex, Responses API, Chat Completions, Apps SDK, Agents SDK, Realtime, model capabilities or limits); prioritize OpenAI docs MCP tools and restrict any fallback browsing to…
training-llms-megatron
Trains large language models (2B-462B parameters) using NVIDIA Megatron-Core with advanced parallelism strategies. Use when training models >1B parameters, need maximum GPU efficiency (47% MFU on H100), or require tensor/pipeline/sequence/context/expert parallelism. Production-ready framework used for Nemotron, LLaMA…
environment-discovery
Systematic exploration of unknown environments before starting work.