Skip to main content

Crate agentkit_context

Crate agentkit_context 

Source
Expand description

Context loaders for workspace-local agent instructions.

This crate discovers and loads AGENTS.md files (project-level instructions) into agentkit_core::Items with ItemKind::Context. The resulting items slot directly into a transcript alongside system, user, and assistant messages, so the agent loop and providers do not need a separate context path.

§Overview

§Example

use agentkit_context::{AgentsMd, ContextLoader};

let items = ContextLoader::new()
    .with_source(AgentsMd::discover("."))
    .load()
    .await?;

Structs§

AgentsMd
Discovers and loads AGENTS.md files by walking ancestor directories.
ContextLoader
Composable loader that gathers context Items from multiple ContextSource implementations.

Enums§

AgentsMdMode
Controls how many AGENTS.md files AgentsMd returns during ancestor discovery.
ContextError
Errors that can occur while discovering or reading context files.

Traits§

ContextSource
A source of context Items.