Architecture
Last updated
Last updated
For detailed visual representations of the system architecture, see .
Liz uses an Express-style middleware architecture where each request flows through a series of middleware functions. This approach provides a clear, predictable processing pipeline that's easy to understand and extend.
validateInput: Ensures required fields are present
loadMemories: Retrieves relevant conversation history
wrapContext: Builds the context for LLM interactions
createMemoryFromInput: Stores the user's input
router: Determines and executes the appropriate route handler
The AgentFramework class in src/framework orchestrates the middleware pipeline and handles request processing:
Defines personality and capabilities
Holds system prompt and style context
Manages route definitions
Provides agent-specific context
Handles request processing
Manages memory operations
Builds context for LLM
Routes requests to handlers
Routes define how an agent handles different types of interactions. The router middleware uses LLM to select the most appropriate handler: