Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
elpham6 committed Apr 23, 2024
1 parent 99ca1f5 commit eeb8af5
Show file tree
Hide file tree
Showing 58 changed files with 211 additions and 102 deletions.
11 changes: 9 additions & 2 deletions cookbook/Basic-RAG/BasicRAG_refine.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
"""Refine Chain
=======================
This cookbook demonstrates how to use the refine chain for BasicRAG.
.. image:: src/docs/_static/refine_chain_langchain_illustration.jpg
:width: 400
For more information, refer to `RAG-PIPELINES <https://github.com/arjbingly/Capstone_5/blob/main/cookbook/Basic-RAG/RAG-PIPELINES.md
/>`_.
.. figure:: ../../_static/refine_chain_langchain_illustration.jpg
:width: 800
:alt: Refine Documents Chain Process
:align: center
Illustration of refine chain (Source: LangChain)
"""

from grag.components.multivec_retriever import Retriever
Expand Down
11 changes: 9 additions & 2 deletions cookbook/Basic-RAG/BasicRAG_stuff.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
"""Stuff Chain
=======================
This cookbook demonstrates how to use the stuff chain for BasicRAG.
.. image:: src/docs/_static/stuff_chain_langchain_illustration.jpg
:width: 400
For more information, refer to `RAG-PIPELINES <https://github.com/arjbingly/Capstone_5/blob/main/cookbook/Basic-RAG/RAG-PIPELINES.md
/>`_.
.. figure:: ../../_static/stuff_chain_langchain_illustration.jpg
:width: 800
:alt: Stuff Documents Chain Process
:align: center
Illustration of stuff chain (Source: LangChain)
"""

from grag.components.multivec_retriever import Retriever
Expand Down
8 changes: 4 additions & 4 deletions cookbook/Basic-RAG/RAG-PIPELINES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# RAG Piplines
# RAG Pipelines

In very basic terms, a RAG pipeline is a system where relevant context is provided to the LLM along with the query. Typically a vector database is leveraged for this task.
In very basic terms, a RAG pipeline is a system where relevant context is provided to the LLM along with the query. Typically, a vector database is leveraged for this task.

## Benefits of RAG

Expand Down Expand Up @@ -77,8 +77,8 @@ eg. The Llama model takes system prompts

# Other Hyperparameters

- **Chunk Sizes** - generally the smallest chunk size you can get away with.
- **Similarity score** - eg cosine similarity
- **Chunk Sizes** - generally, the smallest chunk size you can get away with.
- **Similarity score** - e.g. cosine similarity
- **Embedding**

# Sources
Expand Down
Binary file not shown.
Binary file not shown.
Binary file modified src/docs/_build/doctrees/auto_examples/Basic-RAG/index.doctree
Binary file not shown.
Binary file modified src/docs/_build/doctrees/environment.pickle
Binary file not shown.
Binary file modified src/docs/_build/doctrees/get_started.doctree
Binary file not shown.
Binary file modified src/docs/_build/doctrees/get_started.introduction.doctree
Binary file not shown.
Binary file modified src/docs/_build/doctrees/get_started.llms.doctree
Binary file not shown.
Binary file modified src/docs/_build/doctrees/get_started.vectordb.doctree
Binary file not shown.
2 changes: 1 addition & 1 deletion src/docs/_build/html/.buildinfo
Original file line number Diff line number Diff line change
@@ -1,4 +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: d4c21b77045124631c4c68a22a4bc3b5
config: 33176d1a0fbc2e489b6d5201070d328e
tags: 645f666f9bcd5a90fca523b33c5a78b7
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
"""Stuff Chain
=======================
This cookbook demonstrates how to use the stuff chain for BasicRAG.
.. image:: src/docs/_static/stuff_chain_langchain_illustration.jpg
:width: 400
For more information, refer to `RAG-PIPELINES <https://github.com/arjbingly/Capstone_5/blob/main/cookbook/Basic-RAG/RAG-PIPELINES.md
/>`_.
.. figure:: ../../_static/stuff_chain_langchain_illustration.jpg
:width: 800
:alt: Stuff Documents Chain Process
:align: center
Illustration of stuff chain (Source: LangChain)
"""

from grag.components.multivec_retriever import Retriever
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# Stuff Chain\nThis cookbook demonstrates how to use the stuff chain for BasicRAG.\n<img src=\"file://src/docs/_static/stuff_chain_langchain_illustration.jpg\" width=\"400\" alt=\"Stuff Documents Chain Process\">\n"
"# Stuff Chain\nThis cookbook demonstrates how to use the stuff chain for BasicRAG.\nFor more information, refer to [RAG-PIPELINES](https://github.com/arjbingly/Capstone_5/blob/main/cookbook/Basic-RAG/RAG-PIPELINES.md\n/).\n\n.. figure:: ../../_static/stuff_chain_langchain_illustration.jpg\n :width: 800\n :alt: Stuff Documents Chain Process\n :align: center\n\n Illustration of stuff chain (Source: LangChain)\n"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# Refine Chain\nThis cookbook demonstrates how to use the refine chain for BasicRAG.\n<img src=\"file://src/docs/_static/refine_chain_langchain_illustration.jpg\" width=\"400\" alt=\"Refine Documents Chain Process\">\n"
"# Refine Chain\nThis cookbook demonstrates how to use the refine chain for BasicRAG.\nFor more information, refer to [RAG-PIPELINES](https://github.com/arjbingly/Capstone_5/blob/main/cookbook/Basic-RAG/RAG-PIPELINES.md\n/).\n\n.. figure:: ../../_static/refine_chain_langchain_illustration.jpg\n :width: 800\n :alt: Refine Documents Chain Process\n :align: center\n\n Illustration of refine chain (Source: LangChain)\n"
]
},
{
Expand Down
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
"""Refine Chain
=======================
This cookbook demonstrates how to use the refine chain for BasicRAG.
.. image:: src/docs/_static/refine_chain_langchain_illustration.jpg
:width: 400
For more information, refer to `RAG-PIPELINES <https://github.com/arjbingly/Capstone_5/blob/main/cookbook/Basic-RAG/RAG-PIPELINES.md
/>`_.
.. figure:: ../../_static/refine_chain_langchain_illustration.jpg
:width: 800
:alt: Refine Documents Chain Process
:align: center
Illustration of refine chain (Source: LangChain)
"""

from grag.components.multivec_retriever import Retriever
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,17 @@
Refine Chain
=======================
This cookbook demonstrates how to use the refine chain for BasicRAG.
.. image:: src/docs/_static/refine_chain_langchain_illustration.jpg
:width: 400
For more information, refer to `RAG-PIPELINES <https://github.com/arjbingly/Capstone_5/blob/main/cookbook/Basic-RAG/RAG-PIPELINES.md
/>`_.

.. figure:: ../../_static/refine_chain_langchain_illustration.jpg
:width: 800
:alt: Refine Documents Chain Process
:align: center

Illustration of refine chain (Source: LangChain)

.. GENERATED FROM PYTHON SOURCE LINES 8-21
.. GENERATED FROM PYTHON SOURCE LINES 15-28
.. code-block:: Python
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,17 @@
Stuff Chain
=======================
This cookbook demonstrates how to use the stuff chain for BasicRAG.
.. image:: src/docs/_static/stuff_chain_langchain_illustration.jpg
:width: 400
For more information, refer to `RAG-PIPELINES <https://github.com/arjbingly/Capstone_5/blob/main/cookbook/Basic-RAG/RAG-PIPELINES.md
/>`_.

.. figure:: ../../_static/stuff_chain_langchain_illustration.jpg
:width: 800
:alt: Stuff Documents Chain Process
:align: center

Illustration of stuff chain (Source: LangChain)

.. GENERATED FROM PYTHON SOURCE LINES 8-22
.. GENERATED FROM PYTHON SOURCE LINES 15-29
.. code-block:: Python
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Below is a gallery of examples, demonstrating the use of Basic-RAG.

.. raw:: html

<div class="sphx-glr-thumbcontainer" tooltip="Refine Chain">
<div class="sphx-glr-thumbcontainer" tooltip=" Illustration of refine chain (Source: LangChain)">

.. only:: html

Expand All @@ -50,7 +50,7 @@ Below is a gallery of examples, demonstrating the use of Basic-RAG.

.. raw:: html

<div class="sphx-glr-thumbcontainer" tooltip="Stuff Chain">
<div class="sphx-glr-thumbcontainer" tooltip=" Illustration of stuff chain (Source: LangChain)">

.. only:: html

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ GRAG Overview
=============

GRAG provides an implementation of Retrieval-Augmented Generation that is completely open-sourced.
Since it does not use any external services or APIs, this enables a cost-saving solution as well a solution to data privacy concerns.
For more information, refer to :ref:`Test <Vector Stores>`.

Retrieval-Augmented Generation
###############################
##############################

Re
2 changes: 1 addition & 1 deletion src/docs/_build/html/_sources/get_started.llms.rst.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
LLMs
`LLMs
=====

GRAG offers two ways to run LLMs locally:
Expand Down
2 changes: 2 additions & 0 deletions src/docs/_build/html/_sources/get_started.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ Get Started
.. toctree::
:maxdepth: 2

get_started.introduction
get_started.installation
get_started.llms
get_started.vectordb

2 changes: 2 additions & 0 deletions src/docs/_build/html/_sources/get_started.vectordb.rst.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.. _Vector Stores:

Vector Stores
===============

Expand Down
18 changes: 7 additions & 11 deletions src/docs/_build/html/auto_examples/Basic-RAG/BasicRAG_refine.html
Original file line number Diff line number Diff line change
Expand Up @@ -100,17 +100,13 @@
<section class="sphx-glr-example-title" id="refine-chain">
<span id="sphx-glr-auto-examples-basic-rag-basicrag-refine-py"></span><h1>Refine Chain<a class="headerlink" href="#refine-chain" title="Link to this heading"></a></h1>
<p>This cookbook demonstrates how to use the refine chain for BasicRAG.
.. image:: src/docs/_static/refine_chain_langchain_illustration.jpg</p>
<blockquote>
<div><dl class="field-list simple">
<dt class="field-odd">width<span class="colon">:</span></dt>
<dd class="field-odd"><p>400</p>
</dd>
<dt class="field-even">alt<span class="colon">:</span></dt>
<dd class="field-even"><p>Refine Documents Chain Process</p>
</dd>
</dl>
</div></blockquote>
For more information, refer to <a class="reference external" href="https://github.com/arjbingly/Capstone_5/blob/main/cookbook/Basic-RAG/RAG-PIPELINES.md/">RAG-PIPELINES</a>.</p>
<figure class="align-center" id="id1">
<a class="reference internal image-reference" href="../../_images/refine_chain_langchain_illustration.jpg"><img alt="Refine Documents Chain Process" src="../../_images/refine_chain_langchain_illustration.jpg" style="width: 800px;" /></a>
<figcaption>
<p><span class="caption-text">Illustration of refine chain (Source: LangChain)</span><a class="headerlink" href="#id1" title="Link to this image"></a></p>
</figcaption>
</figure>
<div class="highlight-Python notranslate"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">grag.components.multivec_retriever</span> <span class="kn">import</span> <span class="n">Retriever</span>
<span class="kn">from</span> <span class="nn">grag.components.vectordb.deeplake_client</span> <span class="kn">import</span> <span class="n">DeepLakeClient</span>
<span class="kn">from</span> <span class="nn">grag.rag.basic_rag</span> <span class="kn">import</span> <span class="n">BasicRAG</span>
Expand Down
18 changes: 7 additions & 11 deletions src/docs/_build/html/auto_examples/Basic-RAG/BasicRAG_stuff.html
Original file line number Diff line number Diff line change
Expand Up @@ -100,17 +100,13 @@
<section class="sphx-glr-example-title" id="stuff-chain">
<span id="sphx-glr-auto-examples-basic-rag-basicrag-stuff-py"></span><h1>Stuff Chain<a class="headerlink" href="#stuff-chain" title="Link to this heading"></a></h1>
<p>This cookbook demonstrates how to use the stuff chain for BasicRAG.
.. image:: src/docs/_static/stuff_chain_langchain_illustration.jpg</p>
<blockquote>
<div><dl class="field-list simple">
<dt class="field-odd">width<span class="colon">:</span></dt>
<dd class="field-odd"><p>400</p>
</dd>
<dt class="field-even">alt<span class="colon">:</span></dt>
<dd class="field-even"><p>Stuff Documents Chain Process</p>
</dd>
</dl>
</div></blockquote>
For more information, refer to <a class="reference external" href="https://github.com/arjbingly/Capstone_5/blob/main/cookbook/Basic-RAG/RAG-PIPELINES.md/">RAG-PIPELINES</a>.</p>
<figure class="align-center" id="id1">
<a class="reference internal image-reference" href="../../_images/stuff_chain_langchain_illustration.jpg"><img alt="Stuff Documents Chain Process" src="../../_images/stuff_chain_langchain_illustration.jpg" style="width: 800px;" /></a>
<figcaption>
<p><span class="caption-text">Illustration of stuff chain (Source: LangChain)</span><a class="headerlink" href="#id1" title="Link to this image"></a></p>
</figcaption>
</figure>
<div class="highlight-Python notranslate"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">grag.components.multivec_retriever</span> <span class="kn">import</span> <span class="n">Retriever</span>
<span class="kn">from</span> <span class="nn">grag.components.vectordb.deeplake_client</span> <span class="kn">import</span> <span class="n">DeepLakeClient</span>
<span class="kn">from</span> <span class="nn">grag.rag.basic_rag</span> <span class="kn">import</span> <span class="n">BasicRAG</span>
Expand Down
4 changes: 2 additions & 2 deletions src/docs/_build/html/auto_examples/Basic-RAG/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,10 @@
<div class="sphx-glr-thumbnails"><div class="sphx-glr-thumbcontainer" tooltip="Custom Prompts"><img alt="" src="../../_images/sphx_glr_BasicRAG_CustomPrompt_thumb.png" />
<p><a class="reference internal" href="BasicRAG_CustomPrompt.html#sphx-glr-auto-examples-basic-rag-basicrag-customprompt-py"><span class="std std-ref">Custom Prompts</span></a></p>
<div class="sphx-glr-thumbnail-title">Custom Prompts</div>
</div><div class="sphx-glr-thumbcontainer" tooltip="Refine Chain"><img alt="" src="../../_images/sphx_glr_BasicRAG_refine_thumb.png" />
</div><div class="sphx-glr-thumbcontainer" tooltip=" Illustration of refine chain (Source: LangChain)"><img alt="" src="../../_images/sphx_glr_BasicRAG_refine_thumb.png" />
<p><a class="reference internal" href="BasicRAG_refine.html#sphx-glr-auto-examples-basic-rag-basicrag-refine-py"><span class="std std-ref">Refine Chain</span></a></p>
<div class="sphx-glr-thumbnail-title">Refine Chain</div>
</div><div class="sphx-glr-thumbcontainer" tooltip="Stuff Chain"><img alt="" src="../../_images/sphx_glr_BasicRAG_stuff_thumb.png" />
</div><div class="sphx-glr-thumbcontainer" tooltip=" Illustration of stuff chain (Source: LangChain)"><img alt="" src="../../_images/sphx_glr_BasicRAG_stuff_thumb.png" />
<p><a class="reference internal" href="BasicRAG_stuff.html#sphx-glr-auto-examples-basic-rag-basicrag-stuff-py"><span class="std std-ref">Stuff Chain</span></a></p>
<div class="sphx-glr-thumbnail-title">Stuff Chain</div>
</div><div class="sphx-glr-thumbcontainer" tooltip="Document Ingestion"><img alt="" src="../../_images/sphx_glr_BasicRAG_ingest_thumb.png" />
Expand Down
18 changes: 12 additions & 6 deletions src/docs/_build/html/get_started.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<script src="_static/js/theme.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="Installation" href="get_started.installation.html" />
<link rel="next" title="GRAG Overview" href="get_started.introduction.html" />
<link rel="prev" title="Welcome to GRAG’s documentation!" href="index.html" />
</head>

Expand All @@ -51,8 +51,10 @@
<p class="caption" role="heading"><span class="caption-text">Contents:</span></p>
<ul class="current">
<li class="toctree-l1 current"><a class="current reference internal" href="#">Get Started</a><ul>
<li class="toctree-l2"><a class="reference internal" href="get_started.introduction.html">GRAG Overview</a></li>
<li class="toctree-l2"><a class="reference internal" href="get_started.installation.html">Installation</a></li>
<li class="toctree-l2"><a class="reference internal" href="get_started.llms.html">LLMs</a></li>
<li class="toctree-l2"><a class="reference internal" href="get_started.llms.html">To run LLMs using HuggingFace</a></li>
<li class="toctree-l2"><a class="reference internal" href="get_started.llms.html#to-run-llms-using-llamacpp">To run LLMs using LlamaCPP</a></li>
<li class="toctree-l2"><a class="reference internal" href="get_started.vectordb.html">Vector Stores</a></li>
</ul>
</li>
Expand Down Expand Up @@ -88,10 +90,14 @@
<h1>Get Started<a class="headerlink" href="#get-started" title="Link to this heading"></a></h1>
<div class="toctree-wrapper compound">
<ul>
<li class="toctree-l1"><a class="reference internal" href="get_started.introduction.html">GRAG Overview</a><ul>
<li class="toctree-l2"><a class="reference internal" href="get_started.introduction.html#retrieval-augmented-generation">Retrieval-Augmented Generation</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="get_started.installation.html">Installation</a></li>
<li class="toctree-l1"><a class="reference internal" href="get_started.llms.html">LLMs</a><ul>
<li class="toctree-l2"><a class="reference internal" href="get_started.llms.html#to-run-llms-using-huggingface">To run LLMs using HuggingFace</a></li>
<li class="toctree-l2"><a class="reference internal" href="get_started.llms.html#to-run-llms-using-llamacpp">To run LLMs using LlamaCPP</a></li>
<li class="toctree-l1"><a class="reference internal" href="get_started.llms.html">To run LLMs using HuggingFace</a></li>
<li class="toctree-l1"><a class="reference internal" href="get_started.llms.html#to-run-llms-using-llamacpp">To run LLMs using LlamaCPP</a><ul>
<li class="toctree-l2"><a class="reference internal" href="get_started.llms.html#how-to-quantize-models">How to quantize models.</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="get_started.vectordb.html">Vector Stores</a><ul>
Expand All @@ -109,7 +115,7 @@ <h1>Get Started<a class="headerlink" href="#get-started" title="Link to this hea
</div>
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
<a href="index.html" class="btn btn-neutral float-left" title="Welcome to GRAG’s documentation!" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
<a href="get_started.installation.html" class="btn btn-neutral float-right" title="Installation" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
<a href="get_started.introduction.html" class="btn btn-neutral float-right" title="GRAG Overview" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
</div>

<hr/>
Expand Down
12 changes: 7 additions & 5 deletions src/docs/_build/html/get_started.installation.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
<script src="_static/js/theme.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="LLMs" href="get_started.llms.html" />
<link rel="prev" title="Get Started" href="get_started.html" />
<link rel="next" title="To run LLMs using HuggingFace" href="get_started.llms.html" />
<link rel="prev" title="GRAG Overview" href="get_started.introduction.html" />
</head>

<body class="wy-body-for-nav">
Expand All @@ -51,8 +51,10 @@
<p class="caption" role="heading"><span class="caption-text">Contents:</span></p>
<ul class="current">
<li class="toctree-l1 current"><a class="reference internal" href="get_started.html">Get Started</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="get_started.introduction.html">GRAG Overview</a></li>
<li class="toctree-l2 current"><a class="current reference internal" href="#">Installation</a></li>
<li class="toctree-l2"><a class="reference internal" href="get_started.llms.html">LLMs</a></li>
<li class="toctree-l2"><a class="reference internal" href="get_started.llms.html">To run LLMs using HuggingFace</a></li>
<li class="toctree-l2"><a class="reference internal" href="get_started.llms.html#to-run-llms-using-llamacpp">To run LLMs using LlamaCPP</a></li>
<li class="toctree-l2"><a class="reference internal" href="get_started.vectordb.html">Vector Stores</a></li>
</ul>
</li>
Expand Down Expand Up @@ -100,8 +102,8 @@ <h1>Installation<a class="headerlink" href="#installation" title="Link to this h
</div>
</div>
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
<a href="get_started.html" class="btn btn-neutral float-left" title="Get Started" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
<a href="get_started.llms.html" class="btn btn-neutral float-right" title="LLMs" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
<a href="get_started.introduction.html" class="btn btn-neutral float-left" title="GRAG Overview" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
<a href="get_started.llms.html" class="btn btn-neutral float-right" title="To run LLMs using HuggingFace" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
</div>

<hr/>
Expand Down
Loading

0 comments on commit eeb8af5

Please sign in to comment.