Core#

Core building blocks for RAG and more advanced functionalities, such as agents.

Overview#

core.base_data_class

A base class that provides an easy way for data to interact with LLMs.

core.component

Base building block for building LLM task pipelines.

core.container

Container component for composing multiple components, such as Sequential.

core.default_prompt_template

This is the default system prompt template used in the LightRAG.

core.embedder

The component that orchestrates model client (Embedding models in particular) and output processors.

core.generator

Generator is a user-facing orchestration component with a simple and unified interface for LLM prediction.

core.model_client

ModelClient is the protocol and base class for all models(either via APIs or local models) to communicate with components.

core.prompt_builder

Class prompt builder for LightRAG system prompt.

core.retriever

The base class for all retrievers who in particular retrieve documents from a given database.

core.string_parser

Extract and convert common string to Python objects.

core.func_tool

Tool is LLM's extended capability which is one of the core design pattern of Agent.

core.tool_manager

The ToolManager manages a list of tools, context, and all ways to execute functions.

core.types

Functional data classes to support functional components like Generator, Retriever, and Assistant.

core.db

LocalDB to perform in-memory storage and data persistence(pickle or any filesystem) for data models like documents and dialogturn.

core.functional

Functional interface.

core.tokenizer

Tokenizer from tiktoken.