Skip to content

AI Brain MVP v0.1

An intelligent coaching assistant that analyzes youth conversations to identify their current stage in an entrepreneurship development program. The workflow uses AI to map conversations to specific learning stages and provides detailed stage information for coaches to deliver targeted support.

Purpose

No business context provided yet — add a context.md to enrich this documentation.

This workflow appears to be designed for educational or coaching programs focused on youth entrepreneurship development. It automatically analyzes conversations with young entrepreneurs to determine where they are in a 15-stage progression model, from initial psychological activation through advanced business sustainability concepts.

How It Works

  1. Chat Input: A user sends a message through a chat interface, triggering the workflow
  2. Data Preparation: The system loads the 15-stage entrepreneurship model and extracts the user's message and session information
  3. AI Analysis: An LLM analyzes the conversation against the pedagogical model to determine which of the 15 stages (S1-S15) the youth is currently at
  4. Stage Extraction: The AI response is parsed to extract the specific stage ID (S1, S2, etc.)
  5. Stage Details Lookup: The system retrieves detailed information about the identified stage, including goals, core skills, micro-actions, and readiness checks
  6. Output: Returns comprehensive stage information that coaches can use to provide targeted guidance

Workflow Diagram

graph TD
    A[When chat message received] --> B[Set:Load Stage Data]
    B --> C[LLM:Thinking Step]
    C --> D[Code:Extract Stage ID]
    D --> E[Code:Get Stage Details]
    F[OpenRouter:Thinking] -.-> C

Trigger

Chat Trigger: Activated when a chat message is received through the webhook interface. The trigger captures the user's message content and session ID for processing.

Nodes Used

Node Type Node Name Purpose
Chat Trigger When chat message received Receives incoming chat messages and session data
Set Set:Load Stage Data Prepares stage list, count, user message, and session variables
LLM Chain LLM:Thinking Step Analyzes conversation to determine entrepreneurship stage
Language Model OpenRouter:Thinking Provides AI processing power for stage analysis
Code Code:Extract Stage ID Parses AI response to extract stage identifier (S1-S15)
Code Code:Get Stage Details Retrieves comprehensive stage information from lookup table

External Services & Credentials Required

  • OpenRouter API: Required for AI language model processing
    • Credential: openRouterApi (OpenRouter account 2)
    • Used for analyzing conversations and determining entrepreneurship stages

Environment Variables

No environment variables are explicitly configured in this workflow. All configuration is handled through node parameters and credential storage.

Data Flow

Input: - Chat message content from user - Session ID for conversation tracking

Processing: - 15-stage entrepreneurship model (S1-S15) - AI analysis prompt with pedagogical framework - Stage extraction and validation logic

Output: - currentStageId: Identified stage (S1-S15) - currentStage: Complete stage details including name, lifecycle, goal, core skills, micro-actions, and readiness check - nextStageId: Next stage in progression (if applicable) - nextStage: Next stage details (if applicable) - thinkingResponse: AI's reasoning for stage identification - userMessage: Original user input

Error Handling

  • Invalid Stage Detection: If the AI doesn't identify a valid stage (S1-S15), the system defaults to S1 (Psychological Activation and Early Agency)
  • Stage Boundary: For users at the final stage (S15), nextStageId and nextStage are set to null
  • Fallback Logic: The stage extraction uses regex pattern matching with validation against predefined stage IDs

Known Limitations

  • Workflow is currently inactive (status: false)
  • Limited to 15 predefined stages - cannot adapt to new stages without code modification
  • Relies on single AI model response for stage determination
  • No conversation history or context retention between sessions
  • No validation of stage progression logic (users could theoretically jump stages)

No related workflows identified in the current configuration.

Setup Instructions

  1. Import Workflow: Import the JSON configuration into your n8n instance

  2. Configure Credentials:

    • Set up OpenRouter API credentials
    • Name the credential "OpenRouter account 2" or update the node reference
  3. Activate Webhook:

    • The chat trigger will generate a webhook URL
    • Configure your chat interface to send messages to this endpoint
  4. Test the Flow:

    • Send a test message through the chat interface
    • Verify that stage identification works correctly
    • Check that stage details are properly returned
  5. Customize Stages (if needed):

    • Modify the stage data in the "Code:Get Stage Details" node
    • Update the stage list in "Set:Load Stage Data" if adding/removing stages
    • Adjust the AI prompt in "LLM:Thinking Step" to reflect any changes
  6. Activate Workflow: Set the workflow status to active to begin processing chat messages