Skip to content

heroku-examples/build-ai-apps-talk

Repository files navigation

Build Agentic AI Applications with Node.js and LangChain

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.

Features

  • 🤖 AI-powered interactions using OpenAI and LangChain
  • 🚀 Modern Node.js application architecture
  • 📊 PostgreSQL database integration
  • 🎨 Clean and responsive UI

Prerequisites

  • Node.js (v20 or higher)
  • pnpm package manager
  • Heroku Managed Inference and Agents Add-on: Claude-3-7-Sonnet and Cohere-Embed-Multilingual (for RAG example)
  • LangSmith API key (optional for tracing)
  • PostgreSQL with pgvector support (for RAG example)
  • OpenWeather API key (for Agent example)

Installation

  1. Install pnpm (if not already installed):

    corepack install pnpm
  2. Clone the repository:

    git clone https://github.com/heroku-examples/build-ai-apps-talk
    cd build-ai-apps-talk
  3. Install dependencies:

    pnpm install
  4. Set up environment variables:

    • Copy .env.sample to .env
    • Fill in your API keys and configuration

Development

Start the development server:

pnpm dev

The application will be available at http://localhost:3000

Deployment

Option 1: Deploy to Heroku with One Click

Deploy

Option 2: Manual Heroku Deployment

Note

Make sure you have the AI plugin by running: heroku plugins:install @heroku/plugin-ai

  1. Create a new Heroku app:

    heroku create <app-name>
  2. Add PostgreSQL addon:

    heroku addons:create heroku-postgresql:essential-0
  3. 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

  1. Set up the database schema:

    heroku pg:psql -f data/schema.sql
  2. Configure environment variables:

    heroku config:set OPENWEATHER_API_KEY=your_key
    ...
  3. Deploy to Heroku:

    git push heroku main

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

Build Agentic AI Apps with LangChain and Node.js Talk

Resources

Stars

Watchers

Forks