@agentlib/core
The core runtime engine for AgentLIB — a type-safe, extensible AI agent framework for Node.js.Installation
Overview
@agentlib/core provides the foundational building blocks for creating AI agents:
- Agent Creation: Factory functions and decorator-based agent definitions
- Tool System: Type-safe tool definitions and registry
- Reasoning Context: Execution context for reasoning engines
- Memory Utilities: Token estimation and budget management
- Middleware Pipeline: Extensible middleware system for agent lifecycle hooks
- Event System: Type-safe event emitter for agent events
- Terminal Utilities: Console prompting for interactive agents
Key Exports
Agent Factory
Tool Definition
Decorators
Middleware
Memory Utilities
Event System
Reasoning Context
Terminal Utilities
Core Types
All core types are exported from@agentlib/core:
AgentConfig- Agent configuration interfaceModelProvider- Model provider interfaceModelMessage,ModelRequest,ModelResponse- Message typesToolDefinition,ToolSchema- Tool typesMemoryProvider,MemoryEntry- Memory typesReasoningEngine,ReasoningContext,ReasoningStep- Reasoning typesMiddleware,MiddlewareContext- Middleware typesExecutionContext,ExecutionState- Runtime context typesAgentPolicy- Policy configurationRunOptions,RunResult- Execution types
Engine Registry
Requirements
- Node.js: >= 18.0.0
- Peer Dependencies:
dotenv(optional)
Dependencies
reflect-metadata: For decorator support@agentlib/utils: Shared utilities
Related Packages
- @agentlib/openai - OpenAI model provider
- @agentlib/memory - Memory implementations
- @agentlib/reasoning - Reasoning engines
- @agentlib/logger - Logging middleware