What is a Corpus in LOTUS?
mainA Corpus is the fundamental input for all agentic operators in LOTUS. It acts as a normalization layer that converts various data formats (in-memory strings, files, DataFrames, or large text blocks) into a stream of units. These units can then be sharded into batches for parallel processing by agents.
Each unit is an atomic segment represented by a Unit dataclass containing:
id: A stable identifier (e.g., a file path or row index).content: The text content visible to the agent.metadata: A dictionary containing loader-specific information (e.g., file path, row number, or chunk index).
@dataclass
class Unit:
id: str # stable identifier (e.g. a file path or row index)
content: str # the text the agent sees
metadata: dict # loader-specific extras (path, row number, chunk index)