Build an AI-powered agent using LangChain and LangGraph in TypeScript. This project demonstrates how to set up an agent capable of performing reasoning, using tools, and navigating a graph-based workflow.
- ⚙️ Agent setup with
ChatPromptTemplateandagent_scratchpad - 🧩 Custom tools (e.g., math operations)
- 🔄 LangGraph node/edge architecture
- 🌐 OpenAI (or other LLMs) powered reasoning
- ✨ Modular, clean TypeScript structure
git clone https://github.com/rehmat123/Langchain-typescript
cd langchain-typescriptpnpm installCreate a .env file in the root:
OPENAI_API_KEY=your-openai-keypnpm run langchain
pnpm run langraph-
LangChain.js
Framework for building context-aware, language model-driven applications. -
LangGraph
A library for composing agents and chains as stateful graphs. -
TypeScript
Strongly typed JavaScript for better developer experience and maintainability. -
OpenAI (or another LLM provider)
Used as the underlying language model to power the agent's reasoning and responses.
- Add external API tools (e.g., weather, news)
- Integrate LangSmith for observability and debugging
- Docker support for easier deployment
- Web interface using React or Next.js
Contributions are welcome!
If you find a bug, have a feature request, or want to add improvements, feel free to open an issue or submit a pull request.
MIT License