Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
Alleria1809 committed Jul 4, 2024
2 parents 978c331 + 8ff2ef1 commit 101b2b9
Show file tree
Hide file tree
Showing 84 changed files with 2,347 additions and 325 deletions.
21 changes: 12 additions & 9 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Documentation
on:
push:
branches:
- release # Trigger the workflow when changes are pushed to the release branch
- release # Trigger the workflow when changes are pushed to the release branch

permissions:
contents: write
Expand All @@ -17,12 +17,12 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for all branches and tags
fetch-depth: 0 # Fetch all history for all branches and tags

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11' # Ensure the Python version is correct
python-version: '3.11' # Ensure the Python version is correct

- name: Install Poetry
run: |
Expand Down Expand Up @@ -51,15 +51,18 @@ jobs:
touch .nojekyll # Prevent GitHub Pages from ignoring files that start with an underscore
working-directory: ${{ github.workspace }}/docs/build

- name: Copy CNAME file
run: |
cp ${{ github.workspace }}/CNAME ${{ github.workspace }}/docs/build/CNAME
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }} # GitHub token for authentication
publish_branch: gh-pages # Target branch for GitHub Pages deployment
publish_dir: ./docs/build/ # Directory containing the built documentation
user_name: github-actions[bot] # Username for the commit
user_email: github-actions[bot]@users.noreply.github.com # Email for the commit
force_orphan: true # Force the use of an orphan branch, removing all previous history
github_token: ${{ secrets.GITHUB_TOKEN }} # GitHub token for authentication
publish_branch: gh-pages # Target branch for GitHub Pages deployment
publish_dir: ./docs/build/ # Directory containing the built documentation
user_name: github-actions[bot] # Username for the commit
user_email: github-actions[bot]@users.noreply.github.com # Email for the commit

# Uncomment below for debugging purposes
# - name: Debug Output
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/documentation_li.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ jobs:
touch .nojekyll
working-directory: ${{ github.workspace }}/docs/build

- name: Copy CNAME file
run: |
cp ${{ github.workspace }}/CNAME ${{ github.workspace }}/docs/build/CNAME
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
Expand Down
1 change: 1 addition & 0 deletions CNAME
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lightrag.sylph.ai
78 changes: 40 additions & 38 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
# Introduction
![LightRAG Logo](https://raw.githubusercontent.com/SylphAI-Inc/LightRAG/main/docs/source/_static/images/LightRAG-logo-doc.jpeg)

## ⚡⚡⚡ The PyTorch Library for Large language Model (LLM) Applications ⚡⚡⚡

*LightRAG* helps developers with both building and optimizing *Retriever-Agent-Generator (RAG)* pipelines.
It is *light*, *modular*, and *robust*.


LightRAG is the `PyTorch` library for building large language model (LLM) applications. We help developers with both building and optimizing `Retriever`-`Agent`-`Generator` (RAG) pipelines.
It is light, modular, and robust.

**PyTorch**

Expand Down Expand Up @@ -34,7 +38,6 @@ class Net(nn.Module):

from lightrag.core import Component, Generator
from lightrag.components.model_client import GroqAPIClient
from lightrag.utils import setup_env #noqa

class SimpleQA(Component):
def __init__(self):
Expand All @@ -58,46 +61,45 @@ class SimpleQA(Component):
return await self.generator.acall({"input_str": query})
```

## Simplicity
## Quick Install

Install LightRAG with pip:

Developers who are building real-world Large Language Model (LLM) applications are the real heroes.
As a library, we provide them with the fundamental building blocks with 100% clarity and simplicity.
```bash
pip install lightrag
```

* Two fundamental and powerful base classes: Component for the pipeline and DataClass for data interaction with LLMs.
* We end up with less than two levels of subclasses. Class Hierarchy Visualization.
* The result is a library with bare minimum abstraction, providing developers with maximum customizability.
Please refer to the [full installation guide](https://lightrag.sylph.ai/get_started/installation.html) for more details.

Similar to the PyTorch module, our Component provides excellent visualization of the pipeline structure.

```
SimpleQA(
(generator): Generator(
model_kwargs={'model': 'llama3-8b-8192'},
(prompt): Prompt(
template: <SYS>
You are a helpful assistant.
</SYS>
User: {{input_str}}
You:
, prompt_variables: ['input_str']
)
(model_client): GroqAPIClient()
)
)
```

## Controllability

Our simplicity did not come from doing 'less'.
On the contrary, we have to do 'more' and go 'deeper' and 'wider' on any topic to offer developers maximum control and robustness.
# Documentation

* LLMs are sensitive to the prompt. We allow developers full control over their prompts without relying on API features such as tools and JSON format with components like Prompt, OutputParser, FunctionTool, and ToolManager.
* Our goal is not to optimize for integration, but to provide a robust abstraction with representative examples. See this in ModelClient and Retriever.
* All integrations, such as different API SDKs, are formed as optional packages but all within the same library. You can easily switch to any models from different providers that we officially support.
LightRAG full documentation available at [lightrag.sylph.ai](https://lightrag.sylph.ai/):

## Future of LLM Applications
- [Introduction](https://lightrag.sylph.ai/)
- [Full installation guide](https://lightrag.sylph.ai/get_started/installation.html)
- [Design philosophy](https://lightrag.sylph.ai/developer_notes/lightrag_design_philosophy.html): Design based on three principles: Simplicity over complexity, Quality over quantity, and Optimizing over building.
- [Class hierarchy](https://lightrag.sylph.ai/developer_notes/class_hierarchy.html): We have no more than two levels of subclasses. The bare minimum abstraction will developers with maximum customizability and simplicity.
- [Tutorials](https://lightrag.sylph.ai/developer_notes/index.html): Learn the `why` and `how-to` (customize and integrate) behind each core part within the `LightRAG` library.
- [API reference](https://lightrag.sylph.ai/apis/index.html)

On top of the easiness to use, we in particular optimize the configurability of components for researchers to build their solutions and to benchmark existing solutions.
Like how PyTorch has united both researchers and production teams, it enables smooth transition from research to production.
With researchers building on LightRAG, production engineers can easily take over the method and test and iterate on their production data.
Researchers will want their code to be adapted into more products too.



## Contributors

[![contributors](https://contrib.rocks/image?repo=SylphAI-Inc/LightRAG&max=2000)](https://github.com/SylphAI-Inc/LightRAG/graphs/contributors)

# Citation

```bibtex
@software{Yin-LightRAG-2024,
author = {Yin, Li},
title = {{LightRAG: The PyTorch Library for Large language Model (LLM) Applications}},
month = {7},
year = {2024},
url = {https://github.com/SylphAI-Inc/LightRAG}
}
```
Loading

0 comments on commit 101b2b9

Please sign in to comment.