This repository showcases simple LangGraph agents written in TypeScript / JavaScript and how to run them locally or in Docker.
| Path | Purpose |
|---|---|
multi-agent.ts |
Demonstrates a multi-agent conversation orchestrated by LangGraph. |
simple-agent.js |
Minimal working JavaScript agent. |
cust-agent.ts |
Custom agent example. |
public/ |
Static assets if you decide to serve the agent via Express. |
Dockerfile + docker-compose.yml |
Containerised setup. |
- Node.js ≥ 18 (supports
fetchand ES modules) - npm (comes with Node)
- API keys for providers you plan to use. At minimum set one of:
OPENAI_API_KEYANTHROPIC_API_KEY
- Optional:
SERPAPI_API_KEYif you use the web-search tool.
Create a .env file at the project root with your keys:
cp .env.example .env # if the example file exists
# then edit .env and add: OPENAI_API_KEY="sk-..."🔒 Never commit real keys to Git!
# 1. Install deps
yarn install # or: npm install
# 2. Build TypeScript
npm run build
# 3. Run the multi-agent example
npm startThe start script compiles TypeScript (tsc) and executes the generated dist/multi-agent.js.
npm run dev # incremental tsc --watchnpm run lint # check problems
npm run lint:fix # fix automaticallyBuild and run the container (expects your .env in the same directory):
docker compose up --buildThe default container command runs npm start.
After startup you should see chat logs similar to:
[Agent:Researcher] Searching web for: "LangGraph tutorial"
[Agent:Writer] Drafting concise answer …
Feel free to modify multi-agent.ts to experiment with different node graphs, tools or memory functions.
- Make sure the required API key environment variables are set.
- If TypeScript types look stale, delete
dist/and rebuild. - On Windows PowerShell, prefix env vars when running scripts:
set OPENAI_API_KEY=...; npm start.
MIT