Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
"integrity": "sha256:fbcad6955caeecc5ad3f7886baf652e25cba5225a6c4c2287c536de2e5607511"
}
}
}
}
Empty file.
92 changes: 92 additions & 0 deletions artifacts/submission_journey.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# Promptathon Mission 1 — Submission Journey

## 1) 目的
Investigate product-quality risk for Zava and produce evidence-backed recommendation.

## 2) High-level workflow
- Use SQL MCP to enumerate entities and confirm schema.
- Use `sqlcmd` to run aggregation SQL against `PromptathonDb`.
- Inspect `Docs` and `SupportChats` for qualitative evidence.
- Run the MCP custom tool `FindSimilarDocsByDocId` for vector similarity.
- Consolidate quantitative + qualitative evidence and prepare executive brief.

## 3) Prompts and agent interactions (high-level)
- "List available SQL MCP entities." → used the MCP `describe_entities` call.
- "Show top product categories by revenue." → executed SQL via `sqlcmd`.
- "Which SKUs have most support tickets and low satisfaction?" → SQL aggregation on `SupportTickets`.
- "Show docs and run vector similarity for DocId=39." → executed `find_similar_docs_by_doc_id`.

## 4) MCP tool calls used
- `describe_entities` — to list `Customer`, `Doc`, `Employee`, `FindSimilarDocsByDocId`, `Product`, `SalesOrder`, `SalesOrderLine`, `SupportChat`, `SupportTicket`.
- `read_records` attempts were made but the working path used direct `sqlcmd` queries for full control and to capture raw outputs.
- `find_similar_docs_by_doc_id` executed with `DocId=39, TopN=5` to validate similarity clustering.

## 5) SQL queries executed (examples)
- Category revenue:

```
SELECT TOP 15 ProductCategory, SUM(LineTotal) AS Revenue, SUM(Quantity) AS QuantitySold, COUNT(*) AS OrderLines
FROM dbo.SalesOrderLines
GROUP BY ProductCategory
ORDER BY SUM(LineTotal) DESC;
```

- Top SKUs:

```
SELECT TOP 20 SKU, ProductName, ProductCategory, SUM(LineTotal) AS Revenue, SUM(Quantity) AS QuantitySold, COUNT(DISTINCT OrderId) AS Orders
FROM dbo.SalesOrderLines
GROUP BY SKU, ProductName, ProductCategory
ORDER BY SUM(LineTotal) DESC;
```

- Support tickets by SKU:

```
SELECT COALESCE(RelatedSKU,'UNKNOWN') AS RelatedSKU, COUNT(*) AS TicketCount, AVG(CAST(SatisfactionScore AS FLOAT)) AS AvgSat,
SUM(CASE WHEN Priority='High' THEN 1 ELSE 0 END) AS HighPriority,
SUM(CASE WHEN Status='Open' THEN 1 ELSE 0 END) AS OpenCount
FROM dbo.SupportTickets
GROUP BY COALESCE(RelatedSKU,'UNKNOWN')
ORDER BY COUNT(*) DESC;
```

- Docs for SKU:

```
SELECT DocId, SourceType, SourceId, RelatedSKU, Title, LEFT(Body,200) AS BodySnippet, TagsJson
FROM dbo.Docs
WHERE RelatedSKU='ZCPTM-SS-M-BW'
ORDER BY DocId;
```

- Vector search (MCP stored procedure):

```
EXEC dbo.FindSimilarDocsByDocId @DocId = 39, @TopN = 5;
```

## 6) Errors, fixes, and notable troubleshooting
- Error: `sqlcmd` SSL/TLS certificate verify failed (self-signed certificate). Fix: add `-C` (Trust Server Certificate) option to `sqlcmd` and to the Python helper's trust flag.
- Attempted MCP `read_records` calls with certain entity names returned `EntityNotFound` errors in that path, so direct `sqlcmd` queries were used for robust, copyable outputs.
- Confirmed DB name `PromptathonDb` and table list in `INFORMATION_SCHEMA.TABLES` before running aggregations.

## 7) Key findings (final)
- Risk cluster: `ZCPTM-SS-M-BW` (Premium Short Sleeve Men's Top). Multiple lines of evidence:
- Commercial: SKU is among top revenue-contributing SKUs (Revenue ~ $19.8k, QuantitySold=228, Orders=105).
- Support: 9 support tickets for this SKU, average satisfaction ≈ 1.67 (low), includes high/critical priorities.
- Qualitative: Multiple reviews and support chats in English, Spanish, French describing failure of smart fabric connectivity after washing.
- Vector search: Representative negative review (DocId=39) yields similar negative reviews in top results.

## 8) Artifacts
- Notebook: `artifacts/ZCPTM_issue_notebook.ipynb` (contains queries, captured outputs, and executive brief).

## 9) Suggested submission contents
- The notebook artifact.
- This `submission_journey.md` describing prompts, tool calls, SQL commands, errors/fixes, and findings.
- A short executive brief (already embedded in the notebook).


## 10) Next steps
- (Optional) Add charts and failure-rate computations by matching shipped quantities (requires POS/shipments data).
- Finalize GitHub issue with the above attachments and a short narrative of the journey and decisions made.
2 changes: 2 additions & 0 deletions output.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Msg 102, Level 15, State 1, Server 72b487e0b380, Line 1
Incorrect syntax near '.'.