agentkit-context loads prompt/context material into normalized Items.
Use AgentsMd for repository or workspace instructions.
Supported modes:
AgentsMd::discover(path)- nearest ancestor
AGENTS.md
- nearest ancestor
AgentsMd::discover_all(path)- stacked ancestor
AGENTS.mdfiles from root to nearest match
- stacked ancestor
Supported configuration:
with_file_name(...)with_search_dir(...)with_path(...)with_mode(...)
This makes it possible to combine:
- ancestor discovery
- explicit extra search directories
- explicit file paths
without hardcoding lookup logic in the host application.
Use ContextLoader to combine multiple context sources:
let items = ContextLoader::new()
.with_source(AgentsMd::discover_all(workspace_root))
.load()
.await?;The resulting items are ordinary ItemKind::Context transcript entries, so the loop and providers do not need a separate context path.