Collection of Simple Agents using LangChain with Anthropic Claude and Google Gemini
This project demonstrates basic agent implementations using the LangChain framework with two major LLM providers:
- Anthropic Claude (with tool calling capabilities)
- Google Gemini
✅ Anthropic Claude 3.5 Sonnet agent with function calling ✅ Custom weather tool implementation ✅ Google Gemini 2.5 Flash integration ✅ TypeScript support ✅ Built with official LangChain libraries
# Install dependencies
pnpm install- Copy the example environment file:
cp .env.example .env- Add your API keys in the
.envfile:
ANTHROPIC_API_KEY=your_anthropic_key_here
GOOGLE_API_KEY=your_google_api_key_here# Production mode
pnpm start
# Development mode (with hot reload)
pnpm devpnpm start:gemini| Command | Description |
|---|---|
pnpm build |
Compile TypeScript to JavaScript |
pnpm start |
Build and run Anthropic agent |
pnpm start:gemini |
Build and run Gemini agent |
pnpm dev |
Run Anthropic agent in development mode |
pnpm type-check |
Validate TypeScript types |
langchain_agents/
├── app/
│ ├── main.ts # Anthropic Claude agent implementation
│ └── gemini/
│ └── index.ts # Google Gemini implementation
├── dist/ # Compiled output (auto-generated)
├── .env.example # Environment variables template
├── package.json
├── tsconfig.json
└── README.md
@langchain/anthropic- Anthropic integration@langchain/google- Google Gemini integrationlangchain- Core LangChain frameworkzod- Schema validation for toolstypescript- TypeScript compilerdotenv- Environment variable loading