Skip to content

Commit

Permalink
add integrations and githubchat in docs
Browse files Browse the repository at this point in the history
  • Loading branch information
fm1320 committed Dec 29, 2024
1 parent 9c3e5cf commit a7f055c
Show file tree
Hide file tree
Showing 3 changed files with 137 additions and 45 deletions.
62 changes: 17 additions & 45 deletions docs/source/get_started/integrations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,6 @@ Model Providers
<span>Anthropic</span>
</a>
</div>
<div class="integration-item">
<a href="https://mistral.ai/" target="_blank">
<img src="../_static/logos/mistral.png" alt="Mistral AI">
<span>Mistral AI</span>
</a>
</div>
<div class="integration-item">
<a href="https://aws.amazon.com/bedrock/" target="_blank">
<img src="../_static/logos/aws-bedrock.png" alt="Amazon Bedrock">
<span>Amazon Bedrock</span>
</a>
</div>
<div class="integration-item">
<a href="https://groq.com/" target="_blank">
<img src="../_static/logos/groq.png" alt="Groq">
Expand All @@ -61,22 +49,10 @@ Vector Databases
<span>LanceDB</span>
</a>
</div>
<div class="integration-item">
<a href="https://www.pinecone.io/" target="_blank">
<img src="../_static/logos/pinecone.png" alt="Pinecone">
<span>Pinecone</span>
</a>
</div>
<div class="integration-item">
<a href="https://www.milvus.io/" target="_blank">
<img src="../_static/logos/milvus.png" alt="Milvus">
<span>Milvus</span>
</a>
</div>
</div>

Embedding Models
--------------
Embedding and Reranking Models
---------------------------

.. raw:: html

Expand All @@ -93,6 +69,12 @@ Embedding Models
<span>OpenAI Embeddings</span>
</a>
</div>
<div class="integration-item">
<a href="https://cohere.com/rerank" target="_blank">
<img src="../_static/logos/cohere.png" alt="Cohere Rerank">
<span>Cohere Rerank</span>
</a>
</div>
</div>

.. raw:: html
Expand Down Expand Up @@ -132,26 +114,16 @@ Embedding Models
}
</style>

Quick Start
----------

To use any of these integrations, first install AdalFlow with the appropriate extras:

.. code-block:: bash
# For model providers
pip install "adalflow[openai,anthropic,mistral,bedrock,groq]"
# For vector databases
pip install "adalflow[qdrant,lancedb]"
See the :ref:`installation guide <get_started-installation>` for more details.

Usage Examples
------------

Check out our tutorials for detailed examples of using these integrations:
Have a look at our comprehensive :ref:`tutorials <tutorials-index>` featuring all of these integrations, including:

- Model Clients and LLM Integration
- Vector Databases and RAG
- Embeddings and Reranking
- Agent Development
- Evaluation and Optimization
- Logging and Tracing

- :ref:`Model Clients <tutorials-model_client>`
- :ref:`Vector Databases <tutorials-database>`
- :ref:`Embeddings <tutorials-embedder>`
Each tutorial provides practical examples and best practices for building production-ready LLM applications.
3 changes: 3 additions & 0 deletions docs/source/tutorials/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,8 @@ Putting it all together
- Description
* - :doc:`rag_playbook`
- Comprehensive RAG playbook according to the sota research and the best practices in the industry.
* - :doc:`rag_with_memory`
- Building RAG systems with conversation memory for enhanced context retention and follow-up handling.


.. toctree::
Expand All @@ -182,6 +184,7 @@ Putting it all together
text_splitter
db
rag_playbook
rag_with_memory



Expand Down
117 changes: 117 additions & 0 deletions docs/source/tutorials/rag_with_memory.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
.. _tutorials-rag_with_memory:

RAG with Memory
==============

This guide demonstrates how to implement a RAG system with conversation memory using AdalFlow, based on our `github_chat <https://github.com/SylphAI-Inc/github_chat>`_ reference implementation.

Overview
--------

The github_chat project is a practical RAG implementation that allows you to chat with GitHub repositories while maintaining conversation context. It demonstrates:

- Code-aware responses using RAG
- Memory management for conversation context
- Support for multiple programming languages
- Both web and command-line interfaces

Architecture
-----------

The system is built with several key components:

Data Pipeline
^^^^^^^^^^^^

.. code-block:: text
Input Documents → Text Splitter → Embedder → Vector Database
The data pipeline processes repository content through:

1. Document reading and preprocessing
2. Text splitting for optimal chunk sizes
3. Embedding generation
4. Storage in vector database

RAG System
^^^^^^^^^^

.. code-block:: text
User Query → RAG Component → [FAISS Retriever, Generator, Memory]
Response
The RAG system includes:

- FAISS-based retrieval for efficient similarity search
- LLM-based response generation
- Memory component for conversation history

Memory Management
---------------

The memory system maintains conversation context through:

1. Dialog turn tracking
2. Context preservation
3. Dynamic memory updates

This enables:

- Follow-up questions
- Reference to previous context
- More coherent conversations

Quick Start
----------

1. Installation:

.. code-block:: bash
git clone https://github.com/SylphAI-Inc/github_chat
cd github_chat
poetry install
2. Set up your OpenAI API key:

.. code-block:: bash
mkdir -p .streamlit
echo 'OPENAI_API_KEY = "your-key-here"' > .streamlit/secrets.toml
3. Run the application:

.. code-block:: bash
# Web interface
poetry run streamlit run app.py
# Repository analysis
poetry run streamlit run app_repo.py
Example Usage
-----------

Here are some example queries you can try:

.. code-block:: text
"What does the RAG class do?"
"Can you explain how the memory system works?"
"Show me the implementation of text splitting"
"How is the conversation context maintained?"
Implementation Details
-------------------

The system uses AdalFlow's components:

- :class:`core.embedder.Embedder` for document embedding
- :class:`core.retriever.Retriever` for similarity search
- :class:`core.generator.Generator` for response generation
- Custom memory management for conversation tracking

For detailed implementation examples, check out the `github_chat repository <https://github.com/SylphAI-Inc/github_chat>`_.

0 comments on commit a7f055c

Please sign in to comment.