Facebook automation
*SON HUNG
Phân khúc và Chiến lược Hành trình Khách hàng

The Architecture: A Modular Approach
Using n8n as the primary orchestrator, I engineered a multi-layered workflow to solve these challenges.
1. The Reliability Layer (Deduplication and Storage)
I integrated Supabase to act as a real-time message filter. By checking unique message IDs before processing, the system identifies and kills duplicate webhooks. This ensures each user query is processed exactly once.
2. The Cognitive Layer (Gemini and LangChain)
The "brain" of the agent is powered by Google Gemini 2.5 Flash via LangChain nodes.
Persistent Memory: Using Postgres Chat Memory, the AI maintains deep context.N it remembers user preferences and previous questions across sessions.
Centralized Knowledge: I used Google Sheets as a headless CMS for Prompt Management. This allows me to update the agent's knowledge or tone instantly without redeploying the code.
3. The UX Layer (Humanizing the Interface)
To make the AI feel like a personal consultant, I implemented specific features:
Message Merging: A custom logic that "waits" for the user to finish their thought. It merges fragmented messages into a single coherent prompt for the AI.
Visual Cues: The workflow triggers a "typing_on" status followed by a strategic Wait node. This simulates the natural delay of a human staff member typing a response.



The Impact: Measurable Growth
24/7 Availability: Zero missed leads, even during late-night hours.
Scalability: The system handles hundreds of concurrent inquiries without performance degradation.
Conversion Rate: A 20% increase in qualified leads as students received instant and accurate information regarding licensing categories and exam schedules.







