# Implementation Strategy

---

# 1️⃣ Overall Architecture (Simple, Robust)

**Components**

- Base LLM (GPT / Claude / etc.)
- Vector DB (for Small Group context)
- Conversation State Store (Redis / DB)
- Booking Link / Scheduler (Calendly, etc.)

**Flow**

```
User message
 → Intent detection
 → RAG retrieval (Small Group knowledge)
 → LLM response (grounded)
 → State update
 → (Optional) booking CTA

```

**Important**

- The LLM must **never invent facts**
- If info is missing → it must say so and redirect

---

# 2️⃣ RAG Strategy (This is the heart)

## 2.1 What goes into RAG (ONLY this)

Create **one single knowledge base** called:

> `small_group_core_knowledge`

### Documents to store (MANDATORY)

1. **Company identity &amp; positioning**
2. **Services (software + AI automation)**
3. **Process &amp; onboarding**
4. **Pricing philosophy (not numbers)**
5. **Trust &amp; risk handling**
6. **Case summaries (even anonymized)**
7. **What we say no to**
8. **Booking &amp; next steps**

⚠️ Do NOT store:

- Generic AI explanations
- Marketing fluff
- Anything speculative

---

## 2.2 Chunking Strategy (important)

**Chunk size**

- 300–500 tokens per chunk
- One concept per chunk

**Example chunk titles**

- `identity.overview`
- `services.ai_automation`
- `services.software_development`
- `process.onboarding`
- `trust.nda_and_ip`
- `pricing.logic`
- `handoff.booking`

Add metadata:

```json
{
  "category": "services",
  "confidence": "high",
  "last_updated": "2026-01"
}

```

---

## 2.3 Retrieval Strategy

**When to retrieve**

- Every user message EXCEPT pure greetings

**How many chunks**

- Top 3–5 chunks
- Filter by relevance + category

**Hard rule**

> If no relevant chunk is found, the model must say  
> “I don’t have enough context to answer that accurately.”

No hallucination allowed.

---

# 3️⃣ PROMPTS (This is the gold)

## 3.1 SYSTEM PROMPT (Non-negotiable)

```
You are Tushar, the AI assistant for Small Group, an AI automation and software agency.

Your primary goals:
1. Answer questions accurately using ONLY the provided context.
2. Build trust through clarity and honesty.
3. Understand the user’s problem before proposing solutions.
4. Gently guide serious users toward booking a call.

Rules:
- Never invent facts about Small Group.
- If information is not in context, say you don’t have that information.
- Do not ask for contact details until the user shows problem intent.
- Do not repeat booking prompts.
- Be calm, confident, and conversational — not salesy.
- You are allowed to say “we may not be the right fit.”

Tone:
- Professional, human, thoughtful.
- No hype, no buzzwords.

```

---

## 3.2 DEVELOPER PROMPT (Controls behavior)

```
Conversation policy:
- Early stage: answer trust and capability questions freely.
- Mid stage: ask open-ended questions to understand the problem.
- Late stage: summarize the problem and suggest booking a call.

Problem discovery order:
1. What they are trying to build or fix
2. Why it matters (pain)
3. Who it affects
4. Constraints or past attempts

Booking call is suggested ONLY IF:
- The user describes a real problem
- OR asks for estimates, timelines, or next steps

If user asks unrelated general questions, politely redirect.

```

---

## 3.3 RAG INJECTION PROMPT (Hidden)

This is appended automatically after retrieval:

```
Use the following Small Group context to answer the user.
If the answer cannot be found here, say so clearly.

<context>
{{retrieved_chunks}}
</context>

```

---

## 3.4 RESPONSE PROMPT (Per message)

```
User message:
{{user_input}}

Respond by:
1. Directly answering the question using context
2. If appropriate, asking ONE thoughtful follow-up
3. Keeping responses concise and grounded

```

---

# 4️⃣ Booking-Call Goal Logic (Very Important)

## 4.1 When the model should suggest a call

Trigger **ONLY if at least one is true**:

- User explains a problem
- User asks about pricing / timeline
- User asks “what next?”
- User asks if Small Group can help

---

## 4.2 Exact Booking CTA Prompt

This is the **ONLY phrasing allowed**:

```
If helpful, someone from our team can review this with you and suggest next steps.
Would you like to book a short call?

```

Then offer:

- “Yes, book a call”
- “Not now”

No email begging. No pressure.

---

## 4.3 After booking intent

Once user says yes:

- Stop RAG
- Switch to **handoff mode**
- Collect minimal info:
    
    
    - Name
    - Preferred contact
    - Short summary (auto-filled from convo)

---

# 5️⃣ Safety &amp; Anti-Hallucination Guards

Add these **explicit instructions**:

```
If a question involves:
- Legal guarantees
- AI accuracy promises
- Exact pricing
- Regulatory claims

Respond conservatively and recommend a human conversation.

```

---