diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index fd2d6971..d28840cd 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -29,11 +29,17 @@ jobs: curl -sSL https://install.python-poetry.org | python3 - echo "$HOME/.local/bin" >> $GITHUB_PATH # Ensure Poetry's bin directory is in PATH + - name: Install package dependencies using Poetry + run: | + cd lightrag + poetry config virtualenvs.create false # Avoid creating a virtual environment + poetry install --all-extras --verbose # Install all optional dependencies + cd .. # Change back to the root directory + - name: Install documentation dependencies using Poetry run: | - cd docs poetry config virtualenvs.create false # Avoid creating a virtual environment - poetry install # Install only the doc dependencies as specified in pyproject.toml + poetry install --only doc # Install only the doc dependencies as specified in pyproject.toml - name: Build documentation using Makefile run: | diff --git a/.github/workflows/documentation_test.yml b/.github/workflows/documentation_test.yml new file mode 100644 index 00000000..8a8aef5a --- /dev/null +++ b/.github/workflows/documentation_test.yml @@ -0,0 +1,81 @@ +name: Documentation + +on: + push: + branches: + - merge-main-into-release # Trigger the workflow when changes are pushed to the release branch + +permissions: + contents: write + actions: read + +jobs: + build-and-deploy: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + 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 + + - name: Install Poetry + run: | + curl -sSL https://install.python-poetry.org | python3 - + echo "$HOME/.local/bin" >> $GITHUB_PATH # Ensure Poetry's bin directory is in PATH + + - name: Install documentation dependencies using Poetry + run: | + cd docs + poetry config virtualenvs.create false # Avoid creating a virtual environment + poetry install --with doc # Install only the doc dependencies as specified in pyproject.toml + pip install nest-asyncio # manually install nest-asyncio + pip install torch # manually install torch + # pip install transformers # manually install transformers + poetry show + poetry show lightrag + + + - name: Build documentation using Makefile + run: | + echo "Building documentation from: $(pwd)" + ls -l # Debug: List current directory contents + poetry run make html # Run Makefile in docs directory to build HTML docs + working-directory: ${{ github.workspace }}/docs + + - name: List built documentation + run: | + find ./docs/build/ -type f # List all files in the build directory + working-directory: ${{ github.workspace }} + + - name: Create .nojekyll file + run: | + 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 || true + working-directory: ${{ github.workspace }} + + - 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 + +# Uncomment below for debugging purposes +# - name: Debug Output +# run: | +# pwd # Print the current working directory +# ls -l ./build/ # List files in the build directory +# cat ./source/conf.py # Display the Sphinx configuration file +# working-directory: ${{ github.workspace }}/docs/build \ No newline at end of file diff --git a/README.md b/README.md index 3b93211f..8f3e608f 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,12 @@ -![LightRAG Logo](https://raw.githubusercontent.com/SylphAI-Inc/LightRAG/main/docs/source/_static/images/LightRAG-logo-doc.jpeg) + + + +
+ Documentation | + Models | + Retrievers | + Agents +
+ +
@@ -13,9 +30,6 @@ - - - @@ -33,22 +47,34 @@ --> + + + +
+ AdalFlow: The Library for Large Language Model Applications +
+ +AdalFlow helps developers build and optimize LLM task pipelines. +Embracing similar design pattern to PyTorch, AdalFlow is light, modular, and robust, with a 100% readable codebase. -### ⚡ The Lightning Library for Large Language Model Applications ⚡ +Note: We are in the progress of renaming to adalflow from lightrag. -*LightRAG* helps developers build and optimize *Retriever-Agent-Generator* pipelines. -Embracing similar design pattern to *PyTorch*, LightRAG is *light*, *modular*, and *robust*, with a 100% readable codebase. +# AdalFlow: A Tribute to Ada Lovelace +AdalFlow is named in honor of [Ada Lovelace](https://en.wikipedia.org/wiki/Ada_Lovelace), the pioneering female mathematician who first recognized that machines could do more than just calculations. As a female-led team, we aim to inspire more women to enter the AI field. -# Why LightRAG? +# Why AdalFlow? LLMs are like water; they can be shaped into anything, from GenAI applications such as chatbots, translation, summarization, code generation, and autonomous agents to classical NLP tasks like text classification and named entity recognition. They interact with the world beyond the model’s internal knowledge via retrievers, memory, and tools (function calls). Each use case is unique in its data, business logic, and user experience. Because of this, no library can provide out-of-the-box solutions. Users must build towards their own use case. This requires the library to be modular, robust, and have a clean, readable codebase. The only code you should put into production is code you either 100% trust or are 100% clear about how to customize and iterate. - + Further reading: [How We Started](https://www.linkedin.com/posts/li-yin-ai_both-ai-research-and-engineering-use-pytorch-activity-7189366364694892544-Uk1U?utm_source=share&utm_medium=member_desktop), @@ -81,7 +107,7 @@ class Net(nn.Module): x = self.fc1(x) return self.fc2(x) ``` --> -# LightRAG Task Pipeline +# AdalFlow Task Pipeline We will ask the model to respond with ``explanation`` and ``example`` of a concept. To achieve this, we will build a simple pipeline to get the structured output as ``QAOutput``. @@ -254,7 +280,7 @@ self.generator = Generator( # Quick Install -Install LightRAG with pip: +Install AdalFlow with pip: ```bash pip install lightrag @@ -267,13 +293,15 @@ Please refer to the [full installation guide](https://lightrag.sylph.ai/get_star # Documentation -LightRAG full documentation available at [lightrag.sylph.ai](https://lightrag.sylph.ai/): +AdalFlow full documentation available at [lightrag.sylph.ai](https://lightrag.sylph.ai/): - [How We Started](https://www.linkedin.com/posts/li-yin-ai_both-ai-research-and-engineering-use-pytorch-activity-7189366364694892544-Uk1U?utm_source=share&utm_medium=member_desktop) - [Introduction](https://lightrag.sylph.ai/) - [Full installation guide](https://lightrag.sylph.ai/get_started/installation.html) - [Design philosophy](https://lightrag.sylph.ai/tutorials/lightrag_design_philosophy.html) - [Class hierarchy](https://lightrag.sylph.ai/tutorials/class_hierarchy.html) - [Tutorials](https://lightrag.sylph.ai/tutorials/index.html) +- [Supported Models](https://lightrag.sylph.ai/apis/components/components.model_client.html) +- [Supported Retrievers](https://lightrag.sylph.ai/apis/components/components.retriever.html) - [API reference](https://lightrag.sylph.ai/apis/index.html) @@ -286,9 +314,9 @@ LightRAG full documentation available at [lightrag.sylph.ai](https://lightrag.sy # Citation ```bibtex -@software{Yin2024LightRAG, +@software{Yin2024AdalFlow, author = {Li Yin}, - title = {{LightRAG: The Lightning Library for Large Language Model (LLM) Applications}}, + title = {{AdalFlow: The Library for Large Language Model (LLM) Applications}}, month = {7}, year = {2024}, doi = {10.5281/zenodo.12639531}, diff --git a/docs/source/_static/css/custom.css b/docs/source/_static/css/custom.css index 38906a7e..95445edc 100644 --- a/docs/source/_static/css/custom.css +++ b/docs/source/_static/css/custom.css @@ -1,208 +1,347 @@ /* custom.css */ :root { - --pst-color-info: 23, 162, 184; - --pst-color-logo: #2EB5EB; - --bs-gray-500:#adb5bd; + --pst-color-info: 23, 162, 184; + --pst-color-logo: #2EB5EB; + --bs-gray-500: #adb5bd; } + .theme-switch-button { - display: none; + display: none; } + .theme-version { - display: none; + display: none; } + .bd-sidebar-primary { - width: 100%; /* Full width by default */ + width: 100%; + /* Full width by default */ } /* Adjust width for larger screens */ -@media (min-width: 768px) { /* Example breakpoint for tablets and larger */ - .bd-sidebar-primary { - width: 270px; /* Adjust the width for larger screens */ - } +@media (min-width: 768px) { + + /* Example breakpoint for tablets and larger */ + .bd-sidebar-primary { + width: 270px; + /* Adjust the width for larger screens */ + } } + .pre { - color: #0a7d91; /* Change the color of ```` blocks */ + color: #0a7d91; + /* Change the color of ```` blocks */ } + /* hide on this page */ /* #pst-page-navigation-heading-2 { - display: none; +display: none; } */ /* .copyright { - text-align: center; +text-align: center; } */ p { - font-size: 0.9em; - margin-bottom: 1.15rem; - } + font-size: 0.9em; + margin-bottom: 1.15rem; +} html[data-theme=light] { - --pst-color-secondary: #3d3d3d; /*change the secondary color, header link to gray */ - --pst-color-link-hover: #25262; /*change the side bar link color to black */ - --pst-color-table-row-hover-bg: #f8f9fa; /*change the table row hover color to light gray */ - --sd-color-secondary: gray; /*change the secondary color to black */ - --sd-color-secondary-highlight: gray; /*change the secondary highlight color to black */ - } + --pst-color-secondary: #3d3d3d; + /*change the secondary color, header link to gray */ + --pst-color-link-hover: #25262; + /*change the side bar link color to black */ + --pst-color-table-row-hover-bg: #f8f9fa; + /*change the table row hover color to light gray */ + --sd-color-secondary: gray; + /*change the secondary color to black */ + --sd-color-secondary-highlight: gray; + /*change the secondary highlight color to black */ +} .bd-main .bd-content .bd-article-container { - max-width: 100%; /* default is 60em */ - } + max-width: 100%; + /* default is 60em */ +} -h1{ - font-size: 2rem; /* make the h1 in the code smaller */ +h1 { + font-size: 2rem; + /* make the h1 in the code smaller */ } + /* .bd-page-width { - max-width: 100%; - } */ + max-width: 100%; +} */ .sig-name { - color: black; /* set the class name and attributes to black */ + color: black; + /* set the class name and attributes to black */ } + .caption-text { - font-size: 14px; /* Sets the smallest font size */ - color: gray; /* Sets the color to gray */ + font-size: 14px; + /* Sets the smallest font size */ + color: gray; + /* Sets the color to gray */ } + .bd-links__title { - /* remove the "section navigation" string*/ - display: none; + /* remove the "section navigation" string*/ + display: none; } table { - width: auto; /* Override fit-content which breaks Styler user guide ipynb */ + width: auto; + /* Override fit-content which breaks Styler user guide ipynb */ } /* Main index page overview cards */ .intro-card { - padding: 30px 10px 20px 10px; + padding: 30px 10px 20px 10px; } .intro-card .sd-card-img-top { - margin: 10px; - height: 52px; - background: none !important; + margin: 10px; + height: 52px; + background: none !important; } .intro-card .sd-card-title { - color: var(--pst-color-primary); - font-size: var(--pst-font-size-h5); - padding: 1rem 0rem 0.5rem 0rem; + color: var(--pst-color-primary); + font-size: var(--pst-font-size-h5); + padding: 1rem 0rem 0.5rem 0rem; } .intro-card .sd-card-footer { - border: none !important; + border: none !important; } .intro-card .sd-card-footer p.sd-card-text { - max-width: 220px; - margin-left: auto; - margin-right: auto; + max-width: 220px; + margin-left: auto; + margin-right: auto; } .intro-card .sd-btn-secondary { - background-color: #6c757d !important; - border-color: #6c757d !important; + background-color: #6c757d !important; + border-color: #6c757d !important; } .intro-card .sd-btn-secondary:hover { - background-color: #5a6268 !important; - border-color: #545b62 !important; + background-color: #5a6268 !important; + border-color: #545b62 !important; } -.card, .card img { - background-color: var(--pst-color-background); +.card, +.card img { + background-color: var(--pst-color-background); } /* Remove hover effect from table rows */ table tr:hover { - background-color: transparent !important; + background-color: transparent !important; } -/* .bd-header-announcement{ - display: none; -} */ -.announcement-banner { - background-color: #7acef0; /* Deep purple background */ - color: white; /* White text color */ - padding: 10px 20px; /* Padding inside the banner */ - position: fixed; /* Make it fixed at the top */ - width: 100%; /* Full width */ - z-index: 1000; /* Make sure it's on top of other content */ - top: 0; /* Stick to the top */ - left: 0; /* Align to the left */ - text-align: center; /* Center the text */ +/* Navigation bar style*/ +.navbar-header-items__end { + display: flex; + align-items: center; } -.announcement-banner p { - margin: 0; /* Remove default margin */ - color: white; /* White text color */ - display: inline; /* Display inline with the button */ +.navbar-icon-links { + display: flex; + align-items: center; + margin-right: 1rem; + /* Adjust as needed */ } -.announcement-banner a { - color: white !important; /* Ensures that this color override takes precedence */ +.search-container { + flex: 1; + display: flex; + justify-content: flex-end; } -.announcement-banner button { - background: none; - border: none; - color: white; - font-size: large; - cursor: pointer; - float: right; /* Align the button to the right */ +.DocSearch-Button { + display: flex; + align-items: center; + padding: 0.5rem 1rem; + border: 1px solid #ddd; + border-radius: 4px; + background-color: #fff; + color: #494a49; + cursor: pointer; } -.bd-header-announcement, -.bd-header-announcement__content { - background-color: transparent; /* Make background transparent */ - padding: 0; /* Remove padding if any */ - margin: 0; /* Remove margin if any */ +.DocSearch-Button-Container { + display: flex; + align-items: center; + margin-right: 0.5rem; } -.navbar-header-items__end { - display: flex; - align-items: center; +.DocSearch-Button-Placeholder { + margin-left: 0.5rem; } -.navbar-icon-links { - display: flex; - align-items: center; - margin-right: 1rem; /* Adjust as needed */ +/* Hide the duplicate search button */ +.search-button-field { + display: none !important; } -.search-container { - flex: 1; - display: flex; - justify-content: flex-end; +/* Default banner layout */ +.announcement-banner { + background-color: #7acef0; + /* Light blue background */ + color: white; + /* White text color */ + padding: 10px 20px; + position: fixed; + /* Fixed at the top */ + width: 100%; + /* Full width */ + z-index: 1000; + /* Make sure it's on top of other content */ + top: 0; + /* Stick to the top */ + left: 0; + /* Align to the left */ + text-align: center; + /* Center the text */ + display: flex; + /* Use Flexbox for layout */ + align-items: center; + /* Center items vertically */ + justify-content: center; + /* Center content horizontally */ + box-sizing: border-box; + /* Ensure padding is included in width calculation */ + flex-wrap: nowrap; + /* No wrapping */ + font-size: 16px; + /* Adjust font size for smaller screens */ } -.DocSearch-Button { - display: flex; - align-items: center; - padding: 0.5rem 1rem; - border: 1px solid #ddd; - border-radius: 4px; - background-color: #fff; - color: #494a49; - cursor: pointer; +.announcement-banner p { + margin: 0; + /* Remove default margin */ + color: white; + /* White text color */ + flex: 0 1 auto; + /* Do not allow the text to take up all available space */ + word-wrap: break-word; + /* Ensure long words break and wrap */ + text-align: center; + /* Center text */ + font-size: 16px; + /* Adjust font size for smaller screens */ } -.DocSearch-Button-Container { - display: flex; - align-items: center; - margin-right: 0.5rem; +.announcement-banner a { + color: white !important; + /* Ensures that this color override takes precedence */ } -.DocSearch-Button-Placeholder { - margin-left: 0.5rem; +.announcement-banner button { + background: none; + border: none; + color: white; + font-size: 16px; + cursor: pointer; + flex-shrink: 0; + /* Prevent the button from shrinking */ + display: flex; + align-items: center; + /* Center the button vertically */ + margin-left: 10px; + /* Space between text and button */ } -/* Hide the duplicate search button */ -.search-button-field { - display: none !important; -} +.bd-header-announcement, +.bd-header-announcement__content { + background-color: transparent; + /* Make background transparent */ + padding: 0; + /* Remove padding if any */ + margin: 0; + /* Remove margin if any */ +} + +/* Override styles for medium screens */ +@media (max-width: 1200px) { + .announcement-banner { + flex-direction: row; + /* Row layout for medium screens */ + align-items: center; + /* Align items to the center */ + } + + .announcement-banner p { + text-align: center; + /* Center text */ + width: auto; + /* Automatic width for text */ + } + + .announcement-banner button { + margin-left: 10px; + /* Add left margin */ + } +} + +/* Adjustments for even smaller screens */ +@media (max-width: 600px) { + .announcement-banner { + font-size: 14px; + /* Adjust font size for smaller screens */ + } + + .announcement-banner button { + font-size: 14px; + /* Adjust button size for smaller screens */ + } + + .announcement-banner p { + font-size: 14px; + /* Adjust text size for smaller screens */ + } +} + +/* Adjustments for smallest screens */ +@media (max-width: 500px) { + .announcement-banner { + font-size: 10px; + /* Further adjust font size for smaller screens */ + } + + .announcement-banner button { + font-size: 10px; + /* Further adjust button size for smaller screens */ + } + + .announcement-banner p { + font-size: 10px; + /* Further adjust text size for smaller screens */ + } +} + +@media (max-width: 380px) { + .announcement-banner { + font-size: 8px; + /* Further adjust font size for smallest screens */ + } + + .announcement-banner button { + font-size: 8px; + /* Further adjust button size for smallest screens */ + } + + .announcement-banner p { + font-size: 8px; + /* Further adjust text size for smallest screens */ + } +} \ No newline at end of file diff --git a/docs/source/_static/css/custom.js b/docs/source/_static/css/custom.js new file mode 100644 index 00000000..ab47b313 --- /dev/null +++ b/docs/source/_static/css/custom.js @@ -0,0 +1,16 @@ +document.addEventListener('DOMContentLoaded', function () { + var dismissed = localStorage.getItem('announcement-dismissed'); + var banner = document.getElementById('announcement-banner'); + + if (!dismissed) { + banner.style.display = 'block'; + } else { + banner.style.display = 'none'; + } +}); + +function dismissBanner() { + var banner = document.getElementById('announcement-banner'); + banner.style.display = 'none'; + localStorage.setItem('announcement-dismissed', 'true'); +} diff --git a/docs/source/_static/images/adalflow-logo.png b/docs/source/_static/images/adalflow-logo.png new file mode 100644 index 00000000..2cf13af4 Binary files /dev/null and b/docs/source/_static/images/adalflow-logo.png differ diff --git a/docs/source/conf.py b/docs/source/conf.py index 7452de4d..0fd644ff 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -52,12 +52,6 @@ "icon": "fa-brands fa-discord", }, ], - # https://pydata-sphinx-theme.readthedocs.io/en/stable/user_guide/announcements.html - # "announcement": """ """, - # dynamic announcement "announcement": """