Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/gcsconsultores/centros-estrategicos-gcs/llms.txt

Use this file to discover all available pages before exploring further.

Sally is the AI-powered virtual consultant embedded throughout the GCS Centros Estratégicos platform. Built on Google Gemini 2.5 Flash via the Vercel AI SDK, she acts as a 24/7 consulting assistant — welcoming visitors, answering questions about GCS services, guiding users to the right room, and running an automated Revisoría Fiscal evaluation. Her responses are streamed in real time, and she adapts her tone and context based on which room the user is currently visiting.

Capabilities

  • Contextual room greetings — Sally delivers a unique welcome message each time a user enters one of the six virtual rooms, using SALLY_GREETINGS keyed by RoomId.
  • AI-powered chat with streamed responses — Sally uses streamText() from the Vercel AI SDK to return text token-by-token, giving users a fluid, real-time conversation experience.
  • Lead capture triggers — Sally is prompted to gather contact information at the right moment and can pre-fill lead data during the conversation.
  • Quick action suggestions — When a conversation is new (two messages or fewer), Sally surfaces three one-tap actions: schedule a meeting, start a diagnostic, or explore services.
  • Revisoría Fiscal evaluation — At /evaluacion, Sally guides users through a 6-question legal decision tree to determine whether their company is obligated to appoint a Fiscal Reviewer under Colombian commercial law.
  • Compliance assistance — In the Compliance room, Sally is specially prompted to answer questions about ISO certifications, BASC, SARLAFT, and PTEE, and to recommend GCS’s compliance diagnostic.

How Sally Works

The following pipeline runs every time a user sends a message in the SallyChat panel.
1

User opens SallyChat panel

The SallyChat component (a Radix Sheet) slides in from the right. If this is the user’s first message in the current room, the SALLY_GREETINGS entry for that room is prepended to the conversation.
2

Client sends request to POST /api/chat

The useSallyChat hook sends a POST request to /api/chat with the full conversation history plus the current room and user name:
// Request body
{
  messages: UIMessage[],
  context?: {
    currentRoom?: string,   // e.g. 'compliance'
    userName?: string       // e.g. 'Juan Pérez'
  }
}
3

API builds the system prompt

The route handler concatenates SALLY_SYSTEM_PROMPT (from lib/constants.ts) with a small context block:
const contextInfo = `
CONTEXTO ACTUAL:
- Sala actual: ${context.currentRoom || 'lobby'}
- Nombre del usuario: ${context.userName || 'Visitante'}
`;
const systemPrompt = `${SALLY_SYSTEM_PROMPT}\n${contextInfo}`;
4

streamText() calls Gemini 2.5 Flash

The assembled prompt is passed to streamText() targeting google/gemini-2.5-flash with a cap of 500 output tokens and a temperature of 0.7 for a natural, varied tone:
const result = streamText({
  model: 'google/gemini-2.5-flash',
  system: systemPrompt,
  messages: await convertToModelMessages(messages),
  maxOutputTokens: 500,
  temperature: 0.7,
  abortSignal: req.signal,
});
5

Response streams back to the client

result.toUIMessageStreamResponse() returns a streaming Response that the Vercel AI SDK reads on the client and appends incrementally to the message list.

Room Context

When a user navigates to a room, Sally loads a room-specific greeting from SALLY_GREETINGS, a Record<RoomId, string> defined in lib/constants.ts. This ensures her opening line is always relevant to the user’s current location in the virtual office.
Room IDRoom NameGreeting Focus
lobbyLobby PrincipalGeneral welcome and navigation
ejecutivaSala EjecutivaStrategic meetings and senior consultants
complianceSala de ComplianceISO, BASC, SARLAFT, PTEE diagnostics
estrategiaSala de EstrategiaOrganizational growth and challenges
trainingSala de TrainingCorporate training programs
innovacionSala de InnovaciónAI, data, and digital transformation
The greeting for the compliance room, for example, reads:
“Estás en la Sala de Compliance. Aquí tratamos todo lo relacionado con certificaciones ISO, BASC, SARLAFT y PTEE. ¿Te gustaría conocer el nivel de cumplimiento de tu empresa con nuestro diagnóstico gratuito?”

SallyMessage Type

Every message in the conversation — whether from the user or from Sally — is stored as a SallyMessage object. The isTyping flag is set to true on a placeholder message while a response is being streamed.
export interface SallyMessage {
  id: string;
  role: 'user' | 'sally';
  content: string;
  timestamp: Date;
  isTyping?: boolean;
}

SallyContext

The broader session context tracked by the virtual office for the current visitor is represented by SallyContext. This is used to personalise Sally’s responses and to flag whether a lead has already been captured or a meeting scheduled.
export interface SallyContext {
  currentRoom: RoomId;
  userName?: string;
  userCompany?: string;
  conversationHistory: SallyMessage[];
  hasScheduledMeeting: boolean;
  leadCaptured: boolean;
}

Chat Interface

How SallyChat renders, streams responses, and handles quick actions inside the virtual office rooms.

Evaluation Engine

The 6-question Revisoría Fiscal decision tree, legal thresholds, and result types.

Build docs developers (and LLMs) love