Skip to content

Commit

Permalink
feat: add langchain and cohere overview
Browse files Browse the repository at this point in the history
  • Loading branch information
gautamgambhir97 committed Nov 25, 2024
1 parent e929acd commit a177f85
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion pages/guides/agents/intermediate/langchain-rag-agent.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ The uAgents and AI Engine libraries offer a decentralized and modular framework

<Callout type="info" emoji="ℹ️">
Also, rememeber that you can have a look and eventually download the source code used within this guide from Github [here ↗️](https://github.com/fetchai/uAgent-Examples/tree/main/1-uagents/examples/intermediate/langchain-rag/src).
</Callout>
</Callout>

**Let's dive into the LangChain RAG Agents development!**

Expand All @@ -39,6 +39,27 @@ Make sure you have read the following resources before going on with this guide:
- [Agentverse Functions ↗️](/guides/agents/intermediate/agent-functions)
- [Register an Agent Function on the Agentverse ↗️](/guides/agentverse/agentverse-functions/registering-agent-services)

### LangChain and Cohere Overview

#### LangChain

In the context of a RAG agent, LangChain helps by:

- **Document Loading and Parsing**: It processes and structures data from web pages.
- **Vector Storage**: LangChain indexes documents into vectors, making it easier to perform similarity searches.
- **Question Answering**: It generates answers by querying the indexed data, providing context-aware responses.

#### Cohere

Cohere offers **advanced NLP models** that assist in refining the answers generated by LangChain:

- **Contextual Compression**: It filters and prioritizes data based on relevance, ensuring that the agent focuses on the most important information.
- **Enhanced Accuracy**: Cohere's NLP models improve the quality of the generated answers by understanding the context of the query more effectively.

#### How These Work Together in a RAG Agent

By combining **LangChain** for document retrieval and **Cohere** for NLP enhancement, this setup allows our uagents to process complex queries with context-aware responses, improving accuracy and user experience. LangChain handles the heavy lifting of document parsing and information retrieval, while Cohere fine-tunes the response to ensure high-quality, relevant answers.

## API KEYs

You will need **two API keys** to correctly go through this guide:
Expand Down

0 comments on commit a177f85

Please sign in to comment.