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.
- 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
- Node.js 18+
- OpenAI API Key
-
Install dependencies:
npm install
-
Create
.envfile:cp .env.example .env
-
Add your API key to
.env:OPENAI_API_KEY=your_openai_api_key
npm startThe workflow executes these tasks sequentially:
Trend Analysis → Generate Post → Translate → Schedule
src/
├── index.js # Entry point
├── Workflow.js # Workflow engine (chains tasks sequentially)
├── Task.js # Task wrapper
├── Agent.js # Generic AI agent (ChatOpenAI wrapper)
└── examples/
| Package | Purpose |
|---|---|
@langchain/openai |
ChatOpenAI model integration |
@langchain/core |
LangChain core primitives |
langchain |
LangChain utilities |
dotenv |
Environment variable management |
jest |
Testing (dev) |