Those examples are based on guides from the official LangChain/LangGraph documentation :
langchain-rag.ts·
: A simple RAG workflow, based on this cookbooklanggraph.ts
: A basic LangGraph flow using one tool, based on this cookbookmulti-agent.ts
: A more involved example involving 2 agents and a supervisor, based on this cookbook
- Install dependencies with
npm install
- Copy the
.env.example
file as.env
- Input your Literal AI and OpenAI API keys
- If you want to test the multi-agent flow, you will need to create a free account on Tavily and input your
TAVILY_API_KEY
in.env
- If you want to test the multi-agent flow, you will need to create a free account on Tavily and input your
- Run the scripts with npx :
npx ts-node langgraph.ts