Enterprise Data Retrieval
Data Structure
Enterprise data is typically organized by product in /root/DATA/products/<ProductName>.json with the following top-level keys:
slack: list of slack messages with Channel, Message, ThreadReplies, id
documents: list of docs with content, date, document_link, author, type, id
meeting_transcripts: list of transcripts with transcript, date, document_type, participants, id
meeting_chats: list of chat messages
urls: list of URLs with link, description, id
prs: list of PRs with title, summary, link, mergeable, merged, number, state, user, created_at, reviews, id
Finding Documents by Type
import json
with open('/root/DATA/products/ContentForce.json') as f:
data = json.load(f)
# Find documents by type (e.g., "Market Research Report")
docs = [d for d in data['documents'] if 'market research' in d['type'].lower() or 'market research' in d['content'].lower()]
Finding Authors and Reviewers
# Documents have an 'author' field; PRs have 'user' and 'reviews'
for doc in docs:
print(doc['author']) # author employee ID or name
# For PRs
for pr in data['prs']:
print(pr['user']) # PR author
for review in pr['reviews']:
print(review) # reviewer info
Searching Slack for Keywords
keyword = 'competitor'
results = []
for msg in data['slack']:
if keyword.lower() in msg['Message'].lower():
results.append(msg)
for reply in msg.get('ThreadReplies', []):
if keyword.lower() in reply.lower():
results.append({'parent': msg, 'reply': reply})
Metadata Files
/root/DATA/metadata/employee.json: employee records mapping IDs to names
/root/DATA/metadata/customers_data.json: customer records
/root/DATA/metadata/salesforce_team.json: sales team info
1---2name: enterprise-data-retrieval-33description: Techniques for retrieving and querying structured enterprise data from JSON files containing slack messages, documents, meeting transcripts, and URLs.4metadata:5 source: https://skillmd.com/skills/cxcscmu/enterprise-data-retrieval-36---78# Enterprise Data Retrieval910## Data Structure11Enterprise data is typically organized by product in `/root/DATA/products/<ProductName>.json` with the following top-level keys:12- `slack`: list of slack messages with `Channel`, `Message`, `ThreadReplies`, `id`13- `documents`: list of docs with `content`, `date`, `document_link`, `author`, `type`, `id`14- `meeting_transcripts`: list of transcripts with `transcript`, `date`, `document_type`, `participants`, `id`15- `meeting_chats`: list of chat messages16- `urls`: list of URLs with `link`, `description`, `id`17- `prs`: list of PRs with `title`, `summary`, `link`, `mergeable`, `merged`, `number`, `state`, `user`, `created_at`, `reviews`, `id`1819## Finding Documents by Type20```python21import json2223with open('/root/DATA/products/ContentForce.json') as f:24 data = json.load(f)2526# Find documents by type (e.g., "Market Research Report")27docs = [d for d in data['documents'] if 'market research' in d['type'].lower() or 'market research' in d['content'].lower()]28```2930## Finding Authors and Reviewers31```python32# Documents have an 'author' field; PRs have 'user' and 'reviews'33for doc in docs:34 print(doc['author']) # author employee ID or name3536# For PRs37for pr in data['prs']:38 print(pr['user']) # PR author39 for review in pr['reviews']:40 print(review) # reviewer info41```4243## Searching Slack for Keywords44```python45keyword = 'competitor'46results = []47for msg in data['slack']:48 if keyword.lower() in msg['Message'].lower():49 results.append(msg)50 for reply in msg.get('ThreadReplies', []):51 if keyword.lower() in reply.lower():52 results.append({'parent': msg, 'reply': reply})53```5455## Metadata Files56- `/root/DATA/metadata/employee.json`: employee records mapping IDs to names57- `/root/DATA/metadata/customers_data.json`: customer records58- `/root/DATA/metadata/salesforce_team.json`: sales team info