Knowledge Sources
Knowledge defines context sources that are loaded when the agent starts: files and URLs
(paths) and prompts (prompts) whose content is added to the agent's context. Resources that
tools read on demand are configured separately (see Resources).
agents:
research_assistant:
model: openai:gpt-5-mini
knowledge:
# Files and URLs (any fsspec / UPath location, glob patterns allowed)
paths:
- "docs/**/*.md"
- "https://example.com/api-docs.md"
- "s3://bucket/context.txt"
# Prompts whose content is loaded
prompts:
- type: file # From a file (text, markdown or jinja2)
path: prompts/context.md.j2
format: jinja2
description: Project context
- type: function # Returned by a Python function
import_path: myapp.prompts.generate_context
description: Live context
- type: text # Static messages
description: House rules
messages:
- role: system
content: "Answer in British English."
convert_to_markdown: true # Convert documents (PDF, HTML, ...) to markdown
Examples¶
Documentation Assistant¶
agents:
docs_helper:
model: openai:gpt-5-mini
knowledge:
paths: ["docs/**/*.md"]
prompts:
- type: file
path: prompts/docs_context.txt
description: How the docs are organized
Code Reviewer¶
Configuration Reference¶
Knowledge Configuration¶
Collection of context sources for an agent.
Supports both simple paths and rich resource types for content loading, plus AgentPool's prompt system for dynamic content generation.
Docs: https://phil65.github.io/agentpool/configuration/knowledge/
StaticPrompt¶
Static prompt defined by message list.
DynamicPrompt¶
Dynamic prompt loaded from callable.
FilePrompt¶
Prompt loaded from a file.
This type of prompt loads its content from a file, allowing for longer or more complex prompts to be managed in separate files. The file content is loaded and parsed according to the specified format.