Intelligence & RAG (Pebble IQ)¶
[!IMPORTANT] Scope: This module represents Phase 1+ enhancements. The MVP/POC focuses on basic AI classification and custom CRM. Tally Integration (Phase 1) is the immediate fast-followup to enable staff decision support. Advanced unified knowledge grounding with LlamaIndex is planned for Phase 4.
This module describes the intelligence capabilities planned for Pebble Orchestrator (Pebble IQ), starting with Tally/ERP integration in Phase 1, followed by advanced RAG in later phases.
Use Case: US-IQ-001 - Knowledge Grounding (Unified Data)¶
| Field | Description |
|---|---|
| ID | US-IQ-001 |
| Title | Knowledge Grounding: Unified Data |
| Priority | P2 (Post-MVP) |
| User Story | As a staff member, I want the AI to answer my queries using facts from past emails and documents so that I don't have to search manually. |
| Input | Natural language query (e.g., "What is our current bulk pricing for Zinc Oxide?"). |
| Logic | 1. Data Ingestion: LlamaIndex SimpleDirectoryReader processes recent emails and PDF price lists.2. Indexing: Data is chunked and stored in a vector database (e.g., Qdrant or Chroma). 3. Retrieval: The query retrieves the most relevant semantic chunks. 4. Response: The LLM synthesizes a response grounded in the retrieved context. |
| Output | A grounded response with citations to specific docs/emails. |
Use Case: US-IQ-002 - Historical Email Threading¶
| Field | Description |
|---|---|
| ID | US-IQ-002 |
| Title | Historical Email Threading (Semantic) |
| Priority | P2 (Post-MVP) |
| User Story | As an owner, I want the AI to link related emails even if they don't share a thread ID, so I see the full history of a customer. |
| Input | A new incoming email from a known or related entity. |
| Logic | 1. Lookback: AI searches the vector index for semantically similar previous enquiries. 2. Clustering: Groups emails by intent/metadata rather than just Message-ID.3. Linking: Appends a "Semantic Link" to the Kanban card pointing to the past interaction. |
| Output | An enriched Kanban card with "Related History" context. |
Use Case: US-IQ-003 - Tally-Grounded Draft Replies¶
| Field | Description |
|---|---|
| ID | US-IQ-003 |
| Title | Tally-Grounded Draft Replies |
| Priority | P2 (Phase 1) |
| User Story | As a staff member, I want the AI to draft an email reply using live stock data from Tally so that I can respond accurately and fast. |
| Input | A "Price & Availability" enquiry email. |
| Logic | 1. Tool Call: The AI agent (LangGraph) calls the Tally XML tool to fetch current stock for the requested product. 2. Context Assembly: Composes a prompt with the Tally data + the user's enquiry. 3. Drafting: LLM generates a professional reply draft with stock/price specifics. |
| Output | A pre-filled email draft in the Kanban side-panel for staff review. |
| Dependencies | Requires Phase 1 ERP/Tally XML integration to be completed first. |