Skip to content

Commit

Permalink
Deploy documentation updates [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Jun 28, 2024
1 parent 683bec8 commit e1d2455
Show file tree
Hide file tree
Showing 193 changed files with 42,150 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .buildinfo
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 added .doctrees/apis/components/agent_prompt.doctree
Binary file not shown.
Binary file added .doctrees/apis/components/index.doctree
Binary file not shown.
Binary file added .doctrees/apis/core/index.doctree
Binary file not shown.
Binary file added .doctrees/apis/eval/index.doctree
Binary file not shown.
Binary file added .doctrees/apis/index.doctree
Binary file not shown.
Binary file added .doctrees/apis/optim/index.doctree
Binary file not shown.
Binary file added .doctrees/apis/tracing/index.doctree
Binary file not shown.
Binary file added .doctrees/apis/utils/index.doctree
Binary file not shown.
Binary file not shown.
Binary file added .doctrees/contributor/contribution_guide.doctree
Binary file not shown.
Binary file added .doctrees/contributor/index.doctree
Binary file not shown.
Binary file added .doctrees/developer_notes/agent.doctree
Binary file not shown.
Binary file added .doctrees/developer_notes/base_data_class.doctree
Binary file not shown.
Binary file added .doctrees/developer_notes/component.doctree
Binary file not shown.
Binary file added .doctrees/developer_notes/data_pipeline.doctree
Binary file not shown.
Binary file added .doctrees/developer_notes/db.doctree
Binary file not shown.
Binary file added .doctrees/developer_notes/embedder.doctree
Binary file not shown.
Binary file added .doctrees/developer_notes/embedder_xy.doctree
Binary file not shown.
Binary file added .doctrees/developer_notes/evaluation.doctree
Binary file not shown.
Binary file added .doctrees/developer_notes/generator.doctree
Binary file not shown.
Binary file added .doctrees/developer_notes/index.doctree
Binary file not shown.
Binary file not shown.
Binary file added .doctrees/developer_notes/llm_intro.doctree
Binary file not shown.
Binary file added .doctrees/developer_notes/logging.doctree
Binary file not shown.
Binary file added .doctrees/developer_notes/logging_tracing.doctree
Binary file not shown.
Binary file added .doctrees/developer_notes/model_client.doctree
Binary file not shown.
Binary file added .doctrees/developer_notes/optimizer.doctree
Binary file not shown.
Binary file added .doctrees/developer_notes/parameter.doctree
Binary file not shown.
Binary file added .doctrees/developer_notes/prompt.doctree
Binary file not shown.
Binary file added .doctrees/developer_notes/rag.doctree
Binary file not shown.
Binary file added .doctrees/developer_notes/react_agent_xy.doctree
Binary file not shown.
Binary file added .doctrees/developer_notes/retriever.doctree
Binary file not shown.
Binary file added .doctrees/developer_notes/retriever_xy.doctree
Binary file not shown.
Binary file added .doctrees/developer_notes/text_splitter.doctree
Binary file not shown.
Binary file added .doctrees/developer_notes/tool_helper.doctree
Binary file not shown.
Binary file added .doctrees/environment.pickle
Binary file not shown.
Binary file added .doctrees/get_started/community.doctree
Binary file not shown.
Binary file added .doctrees/get_started/index.doctree
Binary file not shown.
Binary file added .doctrees/get_started/installation.doctree
Binary file not shown.
Binary file added .doctrees/get_started/introduction.doctree
Binary file not shown.
Binary file not shown.
Binary file added .doctrees/index.doctree
Binary file not shown.
Binary file added .doctrees/resources/index.doctree
Binary file not shown.
Binary file added .doctrees/resources/resources.doctree
Binary file not shown.
Binary file added .doctrees/tutorials/eval_a_rag.doctree
Binary file not shown.
Binary file added .doctrees/tutorials/index.doctree
Binary file not shown.
Binary file not shown.
Binary file added .doctrees/tutorials/logging.doctree
Binary file not shown.
Empty file added .nojekyll
Empty file.
Binary file added _images/ReAct.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
71 changes: 71 additions & 0 deletions _sources/apis/components/agent_prompt.rst.txt
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 %}
"""
68 changes: 68 additions & 0 deletions _sources/apis/components/index.rst.txt
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

99 changes: 99 additions & 0 deletions _sources/apis/core/index.rst.txt
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
21 changes: 21 additions & 0 deletions _sources/apis/eval/index.rst.txt
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
128 changes: 128 additions & 0 deletions _sources/apis/index.rst.txt
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
Loading

0 comments on commit e1d2455

Please sign in to comment.