Blame

195222 Prashant Kumar 2025-10-14 08:35:14 1
# HLD
571efe Prashant Kumar 2025-10-14 08:38:51 2
3
## 1. Introduction
4
5
**SkillShift** is a system designed to help employees and HR/Admins manage, explore, and retrieve organizational knowledge through **AI-assisted interactions**.
6
7
Organizations often face operational and productivity risks when employees leave or move across teams without structured handovers or visibility into their unique knowledge, decisions, and expertise.
8
9
This tool leverages **NLP-based knowledge mining** to automatically build a dynamic knowledge base and organizational decisions — all derived from communication channels like **Google Chat** and **Telegram**. The platform centralizes internal communication data, maintains tags for context classification, and provides employees and HR/Admins with an AI assistant to query messages and insights related to them or their assigned tags.
10
11
In modern organizations, large volumes of valuable information — discussions, decisions, technical clarifications, and project context — are scattered across internal messaging tools. This tool provides a unified way to collect, organize, and retrieve such communication efficiently using AI-assisted search and tag-based categorization.
12
13
Unlike traditional HR or knowledge base systems, this assistant focuses on **conversation intelligence** rather than static documentation. Instead of manually searching through thousands of chat messages, users can simply ask **natural language questions** through the AI assistant, which semantically understands the context and retrieves relevant messages tagged to their area, project, or topic.
14
15
### Platform Users
16
17
- **Employees**
18
- View their profiles, assigned tags, and interact with the AI assistant to find relevant discussions or information.
19
- **HR/Admins**
20
- Manage and assign tags, configure data source integrations, and use the AI assistant for organization-wide insights.
21
22
---
23
24
## 2. Objectives
25
26
The system aims to achieve the following core objectives:
27
28
- Consolidate organizational conversations from multiple data sources such as **Google Chat** and **Telegram** into a single, searchable knowledge base.
29
- Simplify knowledge discovery through a **conversational AI assistant**.
30
- Enable structured organization of communication via **tags** for projects, discussions, or themes.
31
- Empower employees with **role-based access** to only relevant messages and topics.
32
- Provide HR/Admins tools for efficient management of users, tags, and data sources.
33
- Enhance organizational transparency and reduce information silos through AI-assisted knowledge retrieval.
34
35
---
36
37
## 3. Initial Scope (MVP Deliverables)
38
39
- **Integrations:** Google Chat & Telegram
40
- **Screens:**
41
- Employee Profile
42
- AI Assistant
43
- Tag Management
44
- Data Source Management
45
46
---
47
48
## 4. Users & Roles
49
50
- **Employee:** View their profile and access the AI assistant.
51
- **HR/Manager/System Admin:** Manage integrations and tag management.
52
53
---
54
55
## 5. Architecture Overview
56
ba4c4b Prashant Kumar 2025-10-14 11:48:00 57
![](./Architecture.drawio.svg)
571efe Prashant Kumar 2025-10-14 08:38:51 58
59
---
60
61
## 6. Module Breakdown
62
63
### 6.1 Integration Layer
64
- **Telegram Bot API:** Captures chat messages.
65
- **Google Chat API:** Webhook/polling for spaces & groups.
66
67
---
68
69
### 6.2 Processing & Embedding Layer
70
- **Text Preprocessing:** Removes stopwords, links, emojis, and Personally Identifiable Information (PII).
71
- **Embeddings:** Creates message text embeddings for semantic search.
72
73
---
74
75
### 6.3 Knowledge Store (PostgreSQL + pgvector)
76
77
#### Schema (MVP)
78
| Table | Description |
79
|-------|--------------|
80
| `employees` | id, external_id, name, role, dept, tenure, is_active, is_admin |
81
| `messages` | id, employee_id, data_source_id, text, embedding |
82
| `tags` | id, tag_name, is_active |
83
| `employee_tag` | id, tag_id, employee_id, is_active |
84
| `data_sources` | id, platform, external_id, name, tag_id, description, is_active |
85
86
#### Logical Data Model
87
88
- **Employees**
89
- Represents all individuals using or referenced by the platform.
90
- Attributes: `id`, `name`, `role`, `department`, `tenure`, `is_active`.
91
- Linked to multiple tags and messages.
92
93
- **Messages**
94
- Stores chat data from Google Chat or Telegram.
95
- Each message is tied to one employee and one data source.
96
- Stores cleaned text and a semantic embedding vector.
97
98
- **Tags**
99
- Represents thematic or organizational labels (e.g., *Project Alpha*, *DevOps*).
100
- Used to group employees and messages under meaningful categories.
101
102
- **Data Sources**
103
- Represents external chat systems (Telegram group, Google Chat space).
104
- One data source → one tag; one tag → many data sources.
105
106
#### Relationships (Conceptually)
107
108
| Relationship | Type | Description |
109
|---------------|------|-------------|
110
| Employee ↔ Message | 1 → N | One employee can send multiple messages |
111
| Employee ↔ Tag (via employee_tag) | M ↔ N | Employees can belong to multiple tags |
112
| Message ↔ Data Source | 1 → N | Each message belongs to one data source |
113
| Data Source ↔ Tag | 1 → N | One tag can link to multiple data sources |
114
| Tag ↔ Employee_Tag | 1 → N | Each tag can appear in multiple employee_tag records |
115
| Employee ↔ Employee_Tag | 1 → N | Each employee can have multiple tag associations |
116
117
---
118
119
### 6.4 AI Workflow Automation Layer
120
121
- **Retriever:** Uses pgvector to fetch top-K relevant messages.
122
- **LLM (OpenAI GPT-4 / LLaMA):**
123
- Performs Q&A generation.
124
- **LangChain:** Used for the RAG (Retrieval-Augmented Generation) pipeline.
125
126
---
127
128
### 6.5 Backend (API Layer)
129
130
**Framework:** FastAPI
131
132
#### Key Endpoints
133
134
| Method | Endpoint | Description |
135
|--------|-----------|-------------|
136
| GET | `/employee/{id}` | Retrieve a specific employee’s profile |
137
| GET | `/employee` | List all employees (Admin only) |
138
| POST | `/message/bulk_ingest` | Store messages fetched from integrations |
139
| POST | `/tag` | Create or update a tag (Admin only) |
140
| GET | `/tag` | Retrieve all active tags |
141
| GET | `/tag/{id}` | Get tag details with linked employees & sources |
142
| POST | `/employee_tag` | Assign or unassign a tag to an employee |
143
| GET | `/employee_tag/{employee_id}` | Fetch tags assigned to a specific employee |
144
| POST | `/data_source` | Add or update a data source |
145
| GET | `/data_source` | List all configured data sources |
146
| GET | `/data_source/{id}` | Get details of a specific data source |
147
| POST | `/chatbot/query` | Ask a natural language question |
148
| GET | `/admin/overview` | Dashboard summary for Admins |
149
150
---
151
152
### 6.6 Frontend (React)
153
154
#### Employee View
155
156
- **Profile View**
157
- Displays employee details, department, tenure, and assigned tags.
158
- Uses `/employee/{id}` and `/employee_tag/{employee_id}` APIs.
159
160
- **AI Assistant Chat**
161
- Interactive chat that calls `/chatbot/query`.
162
- Allows employees to query messages related to assigned tags.
163
164
#### HR/Manager/Admin View
165
166
- **Profile Page**
167
- Similar to employee view, with added admin controls.
168
169
- **Tag Management Panel**
170
- Create/edit tags via `/tag` API.
171
- Assign tags to employees via `/employee_tag`.
172
173
- **Data Source Management**
174
- Manage Telegram/Google Chat integrations.
175
- Create or deactivate sources using `/data_source`.
176
177
---
178
179
## 7. Data Flow Example
180
181
**Example Query:** “Did we use Kubernetes in any project?”
182
183
1. Chatbot API receives query.
184
2. NLP extracts keyword → *Kubernetes*.
185
3. pgvector performs semantic similarity search.
186
4. Relevant messages + metadata passed into LLM.
187
5. LLM responds → “Yes, Kubernetes was used in Project Alpha (2024).”
188
6. Frontend chatbot displays the answer with source link.
189
190
---
191
192
## 8. Tech Stack
193
194
| Component | Technology |
195
|------------|-------------|
196
| **Frontend** | React, Tailwind |
197
| **Backend** | FastAPI (Python) |
198
| **Database** | PostgreSQL + pgvector |
199
| **AI/NLP** | OpenAI Embeddings, GPT-4 |
200
| **Integrations** | Google Chat API, Telegram Bot API |
201
| **Infra** | Docker Compose (MVP), AWS/DigitalOcean |
202
203
---
204
205
## 9. Security & Compliance (Outside MVP)
206
207
### 9.1 Data Protection
208
- Data processed locally or within client’s environment.
209
- No raw chat data stored post-extraction.
210
- Encryption: HTTPS (in transit), AES-256 (at rest).
211
212
### 9.2 Access Control & Authentication
213
- Role-based access: Admin, Manager, Employee.
214
- OAuth 2.0 for integrations (Google, Telegram).
215
- Logs and audit trails for sensitive actions.
216
217
### 9.3 SOC 2 & GDPR Alignment
218
- Privacy-by-design principles.
219
- Data minimization: only relevant skill/project data extracted.
220
- Right to erasure and consent-based processing.
221
- Future goal: SOC 2 Type 2 & GDPR certification.
222
223
### 9.4 Data Retention & Anonymization
224
- Temporary data auto-deletion post-processing.
225
- PII replaced with internal IDs before storage.
226
- Configurable retention policies per client.
227
228
---
229
230
## 10. Future Enhancements
231
232
- Integration with Slack, Microsoft Teams, Jira, Confluence, etc.
233
- **Employee Handover Package Generator** during role transitions.
234
235
---