Expand description
§cognisagent
Batteries-included, high-level agent framework built on cognis and cognisgraph.
Provides zero-boilerplate agent creation with pluggable middleware and backends.
§Overview
The primary entry point is create_deep_agent, which constructs a compiled
LangGraph CompiledStateGraph with
middleware hooks around model and tool invocations.
§Quick Start
use cognisagent::config::DeepAgentConfig;
use cognisagent::create_deep_agent;
let config = DeepAgentConfig::default();
let graph = create_deep_agent(config).unwrap();
let result = graph.invoke(serde_json::json!({"messages": []})).await.unwrap();§Middleware
The middleware::Middleware trait provides before/after hooks for model calls
and tool executions. Built-in middleware:
middleware::filesystem::FilesystemMiddleware– file read, write, list, glob, grepmiddleware::memory::MemoryMiddleware– inject persistent memory into contextmiddleware::subagent::SubAgentMiddleware– isolated sub-agent delegationmiddleware::summarization::SummarizationMiddleware– context window managementmiddleware::skills::SkillsMiddleware– custom skill loadingmiddleware::patch_tool_calls::PatchToolCallsMiddleware– tool call correctionmiddleware::rate_limiter::RateLimiterMiddleware– token bucket rate limitingmiddleware::logging::LoggingMiddleware– structured logging with redactionmiddleware::context::ContextMiddleware– dynamic context injectionmiddleware::planning::PlanningMiddleware– plan-then-execute with step tracking
§Tool Registry
The tool_registry::ToolRegistry provides centralized tool management with
permission levels, call counting, enable/disable control, and filtering.
§Backends
The backends::Backend trait abstracts session state persistence:
backends::StateBackend– in-memory (default)backends::FilesystemBackend– local disk storagebackends::SandboxBackend– isolated execution with resource limits
§Events
The events module provides a typed event bus system with handlers and
lifecycle tracking for observing and reacting to agent execution events.
§Conversation
The conversation module provides a conversation manager with context
windowing, message history management, and export/serialization support.
§Presets
The presets module provides ready-made agent configurations via a preset
registry and customizer pattern for common agent types.
Re-exports§
pub use agent::create_deep_agent;
Modules§
- agent
- Deep Agent factory — builds a LangGraph
CompiledStateGraphwith middleware hooks. - backends
- Backend system for persisting agent state.
- builder
- Comprehensive agent builder with fluent API, templates, and directory.
- collaboration
- Collaboration protocols for deep agents.
- communication
- Inter-agent communication system for message passing, shared state, and coordination.
- config
- Configuration for the Deep Agent.
- context
- Context management for deep agents.
- conversation
- Conversation manager for orchestrating multi-turn interactions.
- evaluation
- Evaluation and benchmarking framework for DeepAgents.
- events
- Event bus system for agent lifecycle observability.
- factory
- Agent factory for creating, managing, and tracking agent instances.
- health
- Health check and diagnostics system for agent components.
- lifecycle
- Lifecycle management for deep agents.
- logging
- Structured logging system for DeepAgents execution.
- memory
- Memory system for DeepAgents with short-term, long-term, and indexed memory.
- middleware
- Middleware system for Deep Agents.
- multi_
agent - Multi-agent orchestration patterns for coordinating teams of agents.
- observability
- Observability and diagnostics for agent execution.
- orchestrator
- Tool orchestrator for coordinating multiple tool executions with dependency resolution, parallel execution, and result aggregation.
- planning
- Planning capabilities for deep agents.
- plugins
- Plugin system for extending agent capabilities at runtime.
- presets
- Pre-configured agent presets for common use cases.
- rate_
limiting - Advanced rate limiting for agent operations.
- recovery
- Error recovery system for agents.
- sandbox
- Sandbox backend for isolated agent execution.
- session
- Session management system for tracking agent execution sessions.
- skills
- Skill system for loading and managing reusable agent skills.
- summarization
- Summarization middleware for context window management.
- telemetry
- Telemetry and observability system for tracking agent execution metrics, token usage, and performance.
- tool_
registry - Tool registry for managing tool availability, permissions, and discovery.
- tooling
- Built-in tooling system for DeepAgents.
- workflow
- Workflow engine for multi-step agent workflows with dependency resolution.