Skip to content

Latest commit

 

History

History

reducing_hallucinations_ai_agents

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

Reducing Hallucinations from AI Agents using Long-Term Memory

Introduction to Critique-Based Contexting with OpenAI, LangChain, and LanceDB

AI agents can help simplify and automate tedious workflows. By going through this fitness trainer agent example, we'll introduce how you can reduce hallucinations from AI agents by using critique-based contexting.

Colab walkthrough - Open In Colab

alt text

Setup

Set environment variables for SerpApi and OpenAI API

export OPENAI_API_KEY=...
export SERPAPI_API_KEY=...

Python

Run the script

python main.py --query "university student, loves running"

default query = university student, loves running

Argument Default Value Description
query "university student ..." query to search
llm gpt-3.5-turbo-0613 OpenAI LLM to use
embeddings text-embedding-ada-002 OpenAI embeddings model to use

Javascript

Run the script

node index.js