Expand description
Core types and traits — available via brainwires::core::* or brainwires::prelude::*.
Modules§
- content_
source - Content source types for tracking where content originates.
- embedding
- Embedding provider trait for vector operations. Unified embedding abstraction
- error
- Framework error types and result aliases. Framework error types
- graph
- Knowledge graph types: entities, edges, and trait interfaces. Graph types and traits for knowledge graph abstraction.
- lifecycle
- Lifecycle hooks for intercepting framework events. Lifecycle Hooks
- message
- Message, role, and streaming types for AI conversations.
- output_
parser - Structured output parsers for LLM responses. Structured output parsing for LLM responses
- permission
- Permission mode definitions. Permission mode types
- plan
- Plan metadata, steps, budgets, and serializable plans.
- plan_
parser - Plan text parser for extracting steps from LLM output. Plan Parser - Extract tasks from plan content
- provider
- Provider configuration and chat options.
- task
- Task, priority, and agent response types.
- tool
- Tool definitions, schemas, contexts, and idempotency.
- vector_
store - Vector store trait for similarity search. Vector store abstraction
- working_
set - Working set for file context management with LRU eviction. Working Set for File Context Management
Structs§
- Agent
Response - Agent response after processing
- Chat
Options - Chat completion options
- Chat
Response - Response from a chat completion
- Commit
Result - Result returned by a successful
StagingBackend::commit. - Graph
Edge - An edge in the relationship graph.
- Graph
Node - A node in the relationship graph.
- Idempotency
Record - Record of a completed idempotent write operation.
- Idempotency
Registry - Shared registry that deduplicates mutating file-system tool calls within a run.
- Json
List Parser - Extracts a list of items from a JSON array in the LLM response.
- Json
Output Parser - Extracts JSON from LLM responses and deserializes into
T. - Message
- A message in the conversation
- Parsed
Step - A parsed step from plan content
- Plan
Budget - Budget constraints that a serializable plan must satisfy before execution
begins. Used in
TaskAgentConfig::plan_budget. - Plan
Metadata - Metadata for a persisted execution plan
- Plan
Step - A single step in a serializable pre-execution plan.
- Regex
Output Parser - Parses LLM output using a regex pattern with named capture groups.
- Serializable
Plan - A serializable execution plan produced by the agent before any side
effects occur. When
TaskAgentConfig::plan_budgetis set, the agent generates this plan in a separate provider call and validates it against the budget; if the budget is exceeded the run fails immediately withFailureCategory::PlanBudgetExceeded. - Staged
Write - A single write operation that has been staged but not yet committed.
- Task
- A task being executed by an agent (supports tree structure)
- Tool
- A tool that can be used by the AI agent
- Tool
Context - Execution context for a tool.
- Tool
Input Schema - JSON Schema for tool input
- Tool
Result - Result of a tool execution
- ToolUse
- A tool use request from the AI
- Usage
- Usage statistics for a chat completion
- Vector
Search Result - Result from a vector similarity search.
- Working
Set - Manages the set of files currently in the agent’s context
- Working
SetConfig - Working set configuration
- Working
SetEntry - A file entry in the working set
Enums§
- Content
Block - Content block for structured messages
- Content
Source - Trust level / origin of content injected into an agent’s context.
- Edge
Type - Types of edges in the relationship graph.
- Entity
Type - Types of entities tracked in the knowledge graph.
- Framework
Error - Core framework errors
- Image
Source - Image source for image content blocks
- Message
Content - Message content can be simple text or complex structured content
- Permission
Mode - Permission mode for tool execution
- Plan
Status - Status of a plan
- Role
- Role of the message sender
- Stream
Chunk - Streaming chunk from a chat completion
- Task
Priority - Task priority levels
- Task
Status - Task status
- Tool
Caller - Specifies which contexts can invoke a tool.
Implements Anthropic’s
allowed_callerspattern for programmatic tool calling. - Tool
Mode - Tool selection mode
Traits§
- Embedding
Provider - Trait for text embedding generation.
- Entity
StoreT - Trait for querying an entity store.
- Output
Parser - Trait for parsing structured output from LLM text responses.
- Provider
- Base provider trait for AI providers
- Relationship
GraphT - Trait for querying a relationship graph.
- Staging
Backend - Trait for staging write operations before committing to the filesystem.
- Vector
Store - Trait for vector database operations.
Functions§
- estimate_
tokens - Estimate tokens for a string (rough: ~4 chars per token)
- estimate_
tokens_ from_ size - Estimate tokens for a file by size
- parse_
plan_ steps - Parse plan content into structured steps
- serialize_
messages_ to_ stateless_ history - Serialize a slice of Messages into the STATELESS protocol format for conversation history.
- steps_
to_ tasks - Convert parsed steps into Task objects
Type Aliases§
- Framework
Result - Result type alias using FrameworkError