Skip to content

croot-dev/langchain-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AI Orchestration: Social Media Automation

An intelligent social media automation project using JavaScript, Node.js, and LangChain.js. This project demonstrates AI orchestration by automating the entire social media content pipeline.

Features

  • Trend Analysis: Collects current trending topics
  • Content Generation: AI generates creative social media posts based on trends
  • Multi-language Translation: Automatically translates content to multiple languages (English, Japanese, Spanish)
  • Post Scheduling: Prepares posts for scheduled publication
  • Workflow Orchestration: Chain multiple AI tasks in a structured workflow

Requirements

  • Node.js 18+
  • OpenAI API Key

Installation

  1. Install dependencies:

    npm install
  2. Create .env file:

    cp .env.example .env
  3. Add your API key to .env:

    OPENAI_API_KEY=your_openai_api_key
    

Usage

npm start

The workflow executes these tasks sequentially:

Trend Analysis → Generate Post → Translate → Schedule

Project Structure

src/
├── index.js                          # Entry point
├── Workflow.js                       # Workflow engine (chains tasks sequentially)
├── Task.js                           # Task wrapper
├── Agent.js                          # Generic AI agent (ChatOpenAI wrapper)
└── examples/

Dependencies

Package Purpose
@langchain/openai ChatOpenAI model integration
@langchain/core LangChain core primitives
langchain LangChain utilities
dotenv Environment variable management
jest Testing (dev)

About

langchain sample project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors