Eino: Components
The most significant difference between LLM application development and traditional application development lies in the two core capabilities of LLMs:
- Semantic Text Processing Capability: The ability to understand and generate human language, handling the semantic relationships of unstructured content
- Intelligent Decision-Making Capability: The ability to reason and judge based on context, making corresponding behavioral decisions
These two core capabilities have given rise to three main application models:
- Direct Dialogue Model: Processing user input and generating corresponding responses
- Knowledge Processing Model: Semantic processing, storage, and retrieval of text documents
- Tool Invocation Model: Making decisions based on context and invoking corresponding tools
These models succinctly summarize the current major scenarios of LLM applications, providing us with a foundation for abstraction and standardization. Based on this, Eino abstracts these commonly used capabilities into reusable “Components.”
The relationship between component abstraction and these models corresponds as follows:
Dialogue Processing Components:
- The component abstraction for templated processing and LLM interaction parameters:
ChatTemplate
- The component abstraction for direct interaction with LLMs:
ChatModel
Text Semantic Processing Components:
- The component abstraction for obtaining and processing text documents:
Document.Loader
,Document.Transformer
See Eino: Document Loader guide, Eino: Document Transformer guide
- The component abstraction for semantic processing of text documents:
Embedding
- The component abstraction for storing the indexed data after embedding:
Indexer
- Component abstraction for indexing and retrieving semantically related text documents:
Retriever
Decision Execution Components:
- Component abstraction allowing the LLM to make decisions and call tools:
ToolsNode
Custom Components:
- Component abstraction for user-defined code logic:
Lambda
Components are the providers of LLM application capabilities and serve as the building blocks in the construction of LLM applications. The quality of component abstraction determines the complexity of developing LLM applications. Eino’s component abstractions adhere to the following design principles:
- Modularity and Standardization: Abstract a series of capabilities with similar functions into unified modules. The components have clear responsibilities and boundaries, supporting flexible composition.
- Extensibility: The interface design maintains minimal module capability constraints, making it convenient for developers to create custom components.
- Reusability: Encapsulate the most commonly used capabilities and implementations, providing developers with out-of-the-box tools.
Component abstraction allows the development of LLM applications to form a relatively fixed paradigm, reducing cognitive complexity, and enhancing collaborative efficiency. By encapsulating components, developers can focus on implementing business logic, avoiding the reinvention of the wheel, and quickly building high-quality LLM applications.