- clarifai
- rag-template
rag-agent-gpt4-turbo-React-few-shot
RAG Agent uses GPT-4 Turbo LLM model with ReAct prompting, optimizing dynamic reasoning and action planning.
Notes
RAG Agent
This RAG Agent uses GPT-4 Turbo LLM model with ReAct prompting, optimizing dynamic reasoning and action planning.
ReAct
What is ReAct prompting?
ReAct is a prompting framework where LLMs are used to generate both reasoning traces and task-specific actions in an interleaved manner.
Generating reasoning traces allow the model to induce, track, and update action plans, and even handle exceptions.
How it Works?
ReAct is a general paradigm that combines reasoning and acting with LLMs. ReAct prompts LLMs to generate verbal reasoning traces and actions for a task. This allows the system to perform dynamic reasoning to create, maintain, and adjust plans for acting into the reasoning.
How to Use this RAG Agent?
Using Clarifai SDK
Export your PAT as an environment variable. Then, import and initialize the API Client.
Find your PAT in your security settings.
export CLARIFAI_PAT={your personal access token}
Upload your Data
Upload you data in the Clarifai App to chat with RAG Agent.
from clarifai.rag import RAG
rag_agent = RAG.setup(
app_url= "https://clarifai.com/clarifai/rag-template",)
rag_agent.upload(folder_path = "/app/files", chunk_size= 512, chunk_overlap= 50)
folder_path Folder path to the documents.
chunk_size: Chunk size for splitting the document.
chunk_overlap: The token overlap of each chunk when splitting.
Chat with the your Data using RAG Agent
from clarifai.rag import RAG
rag_agent = RAG(workflow_url='https://clarifai.com/clarifai/rag-template/workflows/rag-agent-gpt4-turbo-React-few-shot')
rag_agent.chat(messages=[{"role":"human", "content":"What is Clarifai"}])
Using Workflow
To utilize RAG Agents, you can input a query through the Blue Plus Try your own Input button. This incorporates all the documents in the Inputs as external data in RAG.
- Workflow IDrag-agent-gpt4-turbo-React-few-shot
- DescriptionRAG Agent uses GPT-4 Turbo LLM model with ReAct prompting, optimizing dynamic reasoning and action planning.
- Last UpdatedOct 16, 2024
- PrivacyPUBLIC
- Share