-
Notifications
You must be signed in to change notification settings - Fork 217
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deploy documentation updates [skip ci]
- Loading branch information
1 parent
683bec8
commit e1d2455
Showing
193 changed files
with
42,150 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Sphinx build info version 1 | ||
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. | ||
config: d715baa215c7ec41736a2dbe475a89ad | ||
tags: 645f666f9bcd5a90fca523b33c5a78b7 |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
.. _agent_prompt: | ||
|
||
.. _DEFAULT_REACT_AGENT_SYSTEM_PROMPT: | ||
|
||
DEFAULT_REACT_AGENT_SYSTEM_PROMPT | ||
---------------------------------- | ||
|
||
This is the default prompt used by the system to interact with the agents. It contains the following structure: | ||
|
||
.. code-block:: python | ||
DEFAULT_REACT_AGENT_SYSTEM_PROMPT = r""" | ||
{# role/task description #} | ||
You task is to answer user's query with minimum steps and maximum accuracy using the tools provided. | ||
{# REACT instructions #} | ||
Each step you will read the previous Thought, Action, and Observation(execution result of the action)steps and then provide the next Thought and Action. | ||
You only have access to the following tools: | ||
{# tools #} | ||
{% for tool in tools %} | ||
{{ loop.index }}. ToolName: {{ tool.metadata.name }} | ||
Tool Description: {{ tool.metadata.description }} | ||
Tool Parameters: {{ tool.metadata.fn_schema_str }} {#tool args can be misleading, especially if we already have type hints and docstring in the function#} | ||
{% endfor %} | ||
{# output is always more robust to use json than string #} | ||
--- | ||
Your output must be in valid JSON format(raw Python string format) with two keys: | ||
{ | ||
"thought": "<Why you are taking this action>", | ||
"action": "ToolName(<args>, <kwargs>)" | ||
} | ||
- Must double quote the JSON str. | ||
- Inside of the JSON str, Must use escape double quote and escape backslash for string. | ||
For example: | ||
"action": "finish(\"John's.\")" | ||
--- | ||
{# Specifications TODO: preference between the usage of llm tool vs the other tool #} | ||
Process: | ||
- Step 1: Read the user query and potentially divide it into subqueries. And get started with the first subquery. | ||
- Call one available tool at a time to solve each subquery/subquestion. \ | ||
- At step 'finish', join all subqueries answers and finish the task. | ||
Remember: | ||
- Action must call one of the above tools with Took Name. It can not be empty. | ||
- Read the Tool Description and ensure your args and kwarg follow what each tool expects in types. e.g. (a=1, b=2) if it is keyword argument or (1, 2) if it is positional. | ||
- You will always end with 'finish' action to finish the task. The answer can be the final answer or failure message. | ||
- When the initial query is simple, use minimum steps to answer the query. | ||
{#Examples can be here#} | ||
{# Check if there are any examples #} | ||
{% if examples %} | ||
<EXAMPLES> | ||
{% for example in examples %} | ||
{{ example }} | ||
{% endfor %} | ||
</EXAMPLES> | ||
{% endif %} | ||
<</SYS>> | ||
----------------- | ||
{# History #} | ||
{% for history in step_history %} | ||
Step {{history.step}}: | ||
{ | ||
"thought": "{{history.thought}}", | ||
"action": "{{history.action}}", | ||
} | ||
"observation": "{{history.observation}}" | ||
{% endfor %} | ||
{% if input_str %} | ||
User query: | ||
{{ input_str }} | ||
{% endif %} | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
Components | ||
============== | ||
|
||
The components section of the LightRAG API documentation outlines the detailed specifications and functionalities of various API components. Each component plays a crucial role in the LightRAG framework, providing specialized capabilities and interactions. | ||
|
||
Overview | ||
---------- | ||
.. autosummary:: | ||
|
||
components.agent | ||
components.model_client | ||
components.data_process | ||
|
||
.. components.reasoning | ||
components.retriever | ||
components.output_parsers | ||
|
||
|
||
Output Parsers | ||
-------------- | ||
.. toctree:: | ||
:maxdepth: 1 | ||
|
||
components.output_parsers | ||
|
||
Agents | ||
------ | ||
.. toctree:: | ||
:maxdepth: 1 | ||
|
||
components.agent | ||
|
||
Model Clients | ||
----------------- | ||
.. toctree:: | ||
:maxdepth: 1 | ||
|
||
components.model_client | ||
|
||
Data Process | ||
---------------- | ||
.. toctree:: | ||
:maxdepth: 1 | ||
|
||
components.data_process | ||
|
||
.. Embedders | ||
.. --------- | ||
.. .. toctree:: | ||
.. :maxdepth: 1 | ||
.. components.embedder | ||
.. Reasoners | ||
.. --------- | ||
.. .. toctree:: | ||
.. :maxdepth: 1 | ||
.. components.reasoning | ||
Retrievers | ||
---------- | ||
.. toctree:: | ||
:maxdepth: 1 | ||
|
||
components.retriever | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
Core | ||
=================== | ||
|
||
The core section of the LightRAG API documentation provides detailed information about the foundational components of the LightRAG system. These components are essential for the basic operations and serve as the building blocks for higher-level functionalities. | ||
|
||
Overview | ||
---------- | ||
.. autosummary:: | ||
|
||
core.base_data_class | ||
core.component | ||
core.db | ||
core.default_prompt_template | ||
core.embedder | ||
core.functional | ||
core.generator | ||
core.memory | ||
core.model_client | ||
core.parameter | ||
core.prompt_builder | ||
core.retriever | ||
core.string_parser | ||
core.tokenizer | ||
core.func_tool | ||
core.tool_manager | ||
core.types | ||
|
||
|
||
Model Client | ||
--------------- | ||
.. toctree:: | ||
:maxdepth: 1 | ||
|
||
core.model_client | ||
|
||
Component | ||
-------------- | ||
.. toctree:: | ||
:maxdepth: 1 | ||
|
||
core.component | ||
|
||
Data Handling | ||
------------- | ||
.. toctree:: | ||
:maxdepth: 1 | ||
|
||
core.base_data_class | ||
core.types | ||
|
||
core.db | ||
|
||
Prompts and Templates | ||
--------------------- | ||
.. toctree:: | ||
:maxdepth: 1 | ||
|
||
core.default_prompt_template | ||
core.prompt_builder | ||
|
||
.. Document Processing | ||
.. ------------------- | ||
.. .. toctree:: | ||
.. :maxdepth: 1 | ||
.. core.document_splitter | ||
core.text_splitter | ||
Embedding and Retrieval | ||
----------------------- | ||
.. toctree:: | ||
:maxdepth: 1 | ||
|
||
core.embedder | ||
core.retriever | ||
|
||
Generation and Utilities | ||
------------------------ | ||
.. toctree:: | ||
:maxdepth: 1 | ||
|
||
core.generator | ||
core.functional | ||
core.memory | ||
|
||
------------------------ | ||
.. toctree:: | ||
:maxdepth: 1 | ||
|
||
core.string_parser | ||
core.tokenizer | ||
core.func_tool | ||
|
||
Parameters | ||
------------------------ | ||
.. toctree:: | ||
:maxdepth: 1 | ||
|
||
core.parameter |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
Evaluation | ||
============== | ||
|
||
Overview | ||
---------- | ||
.. autosummary:: | ||
|
||
eval.answer_match_acc | ||
eval.retriever_recall | ||
eval.retriever_relevance | ||
eval.llm_as_judge | ||
|
||
Evaluator | ||
---------- | ||
.. toctree:: | ||
:maxdepth: 1 | ||
|
||
eval.answer_match_acc | ||
eval.retriever_recall | ||
eval.retriever_relevance | ||
eval.llm_as_judge |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,128 @@ | ||
API Reference | ||
============= | ||
|
||
Welcome to the LightRAG API reference! This section provides detailed documentation of the internal APIs that make up the LightRAG framework. Explore the APIs to understand how to effectively utilize and integrate LightRAG components into your projects. | ||
|
||
|
||
Core | ||
---------- | ||
|
||
The core section of the LightRAG API documentation provides detailed information about the foundational components of the LightRAG system. These components are essential for the basic operations and serve as the building blocks for higher-level functionalities. | ||
|
||
.. autosummary:: | ||
|
||
core.base_data_class | ||
core.model_client | ||
core.component | ||
core.data_components | ||
core.db | ||
core.default_prompt_template | ||
core.embedder | ||
core.functional | ||
core.generator | ||
core.memory | ||
core.parameter | ||
core.prompt_builder | ||
core.retriever | ||
core.string_parser | ||
core.tokenizer | ||
core.func_tool | ||
core.tool_manager | ||
core.types | ||
|
||
|
||
Components | ||
----------- | ||
|
||
The components section of the LightRAG API documentation outlines the detailed specifications and functionalities of various API components. Each component plays a crucial role in the LightRAG framework, providing specialized capabilities and interactions. | ||
|
||
.. autosummary:: | ||
|
||
components.agent | ||
components.model_client | ||
componnets.data_process | ||
.. components.reasoning | ||
components.retriever | ||
components.output_parsers | ||
|
||
|
||
Evaluation | ||
---------- | ||
.. autosummary:: | ||
|
||
eval.answer_match_acc | ||
eval.retriever_recall | ||
eval.retriever_relevance | ||
eval.llm_as_judge | ||
|
||
|
||
Optimizer | ||
---------- | ||
.. autosummary:: | ||
:maxdepth: 2 | ||
|
||
optim.optimizer | ||
optim.sampler | ||
optim.few_shot_optimizer | ||
optim.llm_augment | ||
optim.llm_optimizer | ||
|
||
|
||
Tracing | ||
---------- | ||
.. autosummary:: | ||
|
||
tracing.decorators | ||
tracing.generator_state_logger | ||
tracing.generator_call_logger | ||
|
||
|
||
Utils | ||
---------- | ||
.. autosummary:: | ||
|
||
utils.logger | ||
utils.serialization | ||
utils.config | ||
utils.registry | ||
utils.setup_env | ||
|
||
|
||
.. toctree:: | ||
:maxdepth: 2 | ||
:hidden: | ||
|
||
core/index | ||
|
||
|
||
.. toctree:: | ||
:maxdepth: 2 | ||
:hidden: | ||
|
||
components/index | ||
|
||
|
||
.. toctree:: | ||
:maxdepth: 2 | ||
:hidden: | ||
|
||
optim/index | ||
|
||
.. toctree:: | ||
:maxdepth: 2 | ||
:hidden: | ||
|
||
tracing/index | ||
|
||
.. toctree:: | ||
:maxdepth: 2 | ||
:hidden: | ||
|
||
eval/index | ||
|
||
.. toctree:: | ||
:maxdepth: 2 | ||
:hidden: | ||
|
||
utils/index |
Oops, something went wrong.