Skip to content

Latest commit

 

History

History
36 lines (27 loc) · 1.23 KB

File metadata and controls

36 lines (27 loc) · 1.23 KB

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