Degree
Bachelor of Science (Computer Science)
Department
Department of Computer Science
School
School of Mathematics and Computer Science (SMCS)
Advisor
Dr. Tariq Mahmood , Professor and Program Coordinator MS (CS) and MS (DS) Programs
Co-Advisor
Mr. Shakir Ghani, Cofounder & COO at Social Champ
Keywords
Generative AI, Social Media Automation, Trend Analysis, Content Ideation, Large Language Models (LLMs), Content Scheduling, Prompt Engineering, LangChain
Abstract
In today’s fast-paced digital environment, maintaining a consistent and relevant social media presence is a demanding task for individuals, brands, and marketing teams. Traditional content planning tools fall short in automating ideation, adapting to real-time trends, and unifying scheduling across platforms. To address these challenges, we present Social Brain—an AI-powered tool designed to automate the content ideation pipeline using generative models, trend analysis, and intelligent scheduling. Social Brain leverages real-time social data and large language models (LLMs) to generate trend-aligned content ideas, suggest suitable media, and recommend optimal posting times. The system architecture is modular and microservice-based, comprising a React frontend, a Node.js backend, and a FastAPI-driven AI engine. The tool integrates prompt engineering, keyword extraction, image generation, and content scheduling into a unified workflow. While LLMs currently supported include GPT-4, image suggestions are powered through tools like DALL·E, offering an end-to-end creative experience for content creators. We propose a framework that prioritizes user ease-of-use, scalability, and intelligent automation. The system has been tested under controlled conditions with simulated inputs, evaluating the effectiveness of prompt chains, keyword relevance, and scheduling accuracy. Results indicate substantial reductions in manual effort while improving engagement potential through timely and context-aware content suggestions. Social Brain introduces a novel intersection between trend forecasting, generative AI, and content management. It offers a powerful, extensible foundation for future work in automated digital marketing, social media analytics, and creator-focused AI tooling.
Tools and Technologies Used
JavaScript, React.js, Redux, Node.js, Express.js, MongoDB, FastAPI, Python LangChain, GPT-4, DALL·E, JWT, Tavily API, Reddit API, Figma, GitHub
Methodology
Development approach
System Architecture
The system follows a three-layer microservice architecture, where each component is independently developed, deployed, and scaled:
Frontend Layer
- Framework: React.js with Redux for state management.
- Functionality:
- Prompt submission form with validation.
- Real-time display of AI-generated post ideas.
- Post editor with media attachment options.
- Content calendar and scheduling queue.
- Trend sidebar displaying hashtags/topics dynamically.
Backend Layer
- Framework: Node.js with Express.js.
- Responsibilities:
- JWT-based authentication and session management.
- Routing API requests to the AI engine.
- CRUD operations for posts and schedules using MongoDB.
- Scheduled publishing via cron jobs.
- Data Model:
- Users, Posts, and ScheduleQueue collections for user credentials, content, and timing logic.
AI Engine Layer
- Framework: FastAPI with LangChain orchestration.
- Components:
- Keyword Extractor: Fetches real-time data using APIs (e.g., Taviy, Reddit), applies NLP techniques and RAG to extract relevant terms.
- Idea Generator: Uses LLMs (currently GPT-4) to generate content themes tailored to the prompt and trends.
- Post Generator: Crafts complete social media posts using modular, tone-controlled prompts.
- Image Generator: Suggests visuals using image generation models (currently DALL·E).
- Post Composer: Combines text and images into finalized, ready-to-publish content.
Content Generation Workflow
The workflow follows a multi-stage AI pipeline designed for modularity and clarity:
Step 1: Prompt Input & Preprocessing
- User submits a raw idea or campaign goal via the UI.
- Input is sanitized and stored temporarily for processing.
Step 2: Keyword Extraction
- Data is fetched from social media trend sources.
- Keywords are extracted using a combination of TF-IDF and semantic matching (via RAG).
- These keywords serve as anchors for content relevance.
Step 3: Idea Generation
- Using LangChain, a prompt template is filled with the extracted keywords and user intent.
- The LLM returns multiple structured content angles (e.g., promotional, educational, engaging).
Step 4: Post Generation
- The selected idea is passed through a refined prompt structure.
- The LLM produces final post content (headline, caption, hashtags).
- System instructions enforce style, tone, and platform conventions.
Step 5: Image Suggestion
- Based on the finalized post theme, a visual is generated using a compatible image synthesis model.
Step 6: Scheduling
- Posts can be saved as drafts or scheduled directly via the UI.
- A backend cron scheduler ensures posts are published on time.
Document Type
Restricted Access
Submission Type
BSCS Final Year Project
Recommended Citation
Jalal, Y., Latif, M., Hussain, S., Ahmed, N., & Khalid, A. (2025). SocialBrain. Retrieved from https://ir.iba.edu.pk/fyp-bscs/8
COinS