A modern web application demonstrating how to build AI-powered applications using Node.js and LangChain. This project showcases examples for integrating AI capabilities into web applications.
- 🤖 AI-powered interactions using OpenAI and LangChain
- 🚀 Modern Node.js application architecture
- 📊 PostgreSQL database integration
- 🎨 Clean and responsive UI
- Node.js (v20 or higher)
- pnpm package manager
- Heroku Managed Inference and Agents Add-on:
Claude-3-7-Sonnet
andCohere-Embed-Multilingual
(for RAG example) - LangSmith API key (optional for tracing)
- PostgreSQL with pgvector support (for RAG example)
- OpenWeather API key (for Agent example)
-
Install pnpm (if not already installed):
corepack install pnpm
-
Clone the repository:
git clone https://github.com/heroku-examples/build-ai-apps-talk cd build-ai-apps-talk
-
Install dependencies:
pnpm install
-
Set up environment variables:
- Copy
.env.sample
to.env
- Fill in your API keys and configuration
- Copy
Start the development server:
pnpm dev
The application will be available at http://localhost:3000
Note
Make sure you have the AI plugin by running: heroku plugins:install @heroku/plugin-ai
-
Create a new Heroku app:
heroku create <app-name>
-
Add PostgreSQL addon:
heroku addons:create heroku-postgresql:essential-0
-
Add Managed Inference and Agents Add-on:
heroku ai:models:create claude-3-7-sonnet --as INFERENCE heroku ai:models:create cohere-embed-multilingual --as EMBEDDING
Note
You can find the list of available models by running: heroku ai:models:list
-
Set up the database schema:
heroku pg:psql -f data/schema.sql
-
Configure environment variables:
heroku config:set OPENWEATHER_API_KEY=your_key ...
-
Deploy to Heroku:
git push heroku main
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.