VJRA.US / RAG

NovaCart — RAG Knowledge Agent

← Research Library
Agent: Greeter

Enter your API Key

Your Anthropic API key is used directly in the browser to call Claude. It is stored only in this browser session and never sent to any server.

Don't have a key? Get one at console.anthropic.com

01 · Business Problem
The Problem
Stakeholders need monthly product finance reports. Today this means manually pulling data from Jira, product catalogs, annual reports, and external market research. A PM spends days gathering, cross-referencing, and synthesizing — then does it again next month.
The Solution
A RAG-powered knowledge agent that ingests 7 sources (internal .docx, Jira epics, live web pages), chunks/embeds them into Pinecone, then auto-generates a Monthly Financial Standing Report with correlated insights and a stakeholder email draft.
02 · Solution Description
Why Not Copy-Paste?
Manual reports drift from source data — numbers go stale between edits
Cross-referencing internal sales with external market trends is error-prone at scale
No audit trail — can't trace which source drove which insight
Why RAG Pipeline?
Pinecone retrieval ensures answers are grounded in actual source documents
Namespace separation (novacart-int / novacart-ext) prevents data leakage
Idempotent re-ingestion — edit a source, re-run, report updates automatically
03 · Technical Architecture
Embedding
text-embedding-3-large
1024 dimensions
OpenAI
Vector DB
Pinecone
Index: novacart-claudecode
NS: novacart-int (50) / novacart-ext (481)
cosine similarity
Chunking
Chunk: 1500 chars
Overlap: 200 chars
Recursive text splitter
Sources
7 docs
3 internal (.docx + Jira Epic KAN-196)
4 external (.docx + vjra.us page)
Synthesis
GPT-4o (temp 0.3)
Single chat completion
Structured markdown report
Voice
STT: Web Speech API
TTS: SpeechSynthesis
Daniel voice · rate 0.92
04 · System Architecture RAG pipeline: ingest → retrieve → synthesize
📄
Internal Docs
.docx + Jira KAN-196
🌐
External Docs
.docx + vjra.us page
1. Publish
Document Extraction Paths
📄 .docx Files (5 docs)
Tool: MarkItDown
MarkItDown().convert(path).text_content
Converts .docx → plain text
Docs: Product Catalog, Annual Report, 3 market outlook reports
🎫 Jira Epic (KAN-196)
Tool: Jira REST API
GET /rest/api/3/issue/KAN-196
Description: ADF → adf_to_text() flattens to plain text
Attachment: .md file fetched via content URL (Basic auth)
624-row weekly sales data (156 wks × 4 SKUs)
🌐 vjra.us Page (live HTML)
Tool: MarkItDown + urllib
fetch_url_text(url)
urllib GET → temp file → MarkItDown().convert()
Source: Deloitte 2026 semiconductor outlook
Re-ingestion pulls live content (not stale copy)
All 3 paths converge into the same chunk → embed → upsert pipeline below
2. Ingest Chunk (1500/200) → Embed (text-embedding-3-large, 1024-dim) → Upsert Pinecone
Chunk 1500/200 Embed 1024-dim Delete stale vectors Upsert (batch 100)
Idempotent: deletes existing {doc_id}-chunk* before re-upserting — no duplicates, handles shrinking docs
🗄
Pinecone Vector Store
novacart-int · 50 vec novacart-ext · 481 vec cosine · 1024-dim
3. Retrieve 11 queries → embed → query novacart-int + novacart-ext (top_k=5)
11 structured queries embed each top_k=5 per NS
4. Synthesize GPT-4o → Monthly Financial Standing Report
Retrieved chunks GPT-4o (temp 0.3) Markdown report
5. Draft Email GPT-4o → Stakeholder email
Report summary GPT-4o Stakeholder email
Infrastructure
🤖
Anthropic Claude API
claude-sonnet-4-6 · browser chat agent
🗄
Pinecone
novacart-claudecode · 531 vectors · cosine
🎙
Web Speech API
STT input · SpeechSynthesis TTS · Daniel voice
📄
GitHub Pages
Static hosting · no backend · CDN cache
Source Manifest — 7 Documents
novacart-int — 50 vectors
📄
NovaCart Product Catalog2 chunks
.docx → MarkItDown
📄
NovaCart Annual Report 20246 chunks
.docx → MarkItDown
🎫
SKU Weekly Sales & Conversion (3Y)42 chunks
Jira KAN-196
novacart-ext — 481 vectors
📄
Global Semiconductor Outlook 202554 chunks
.docx → MarkItDown
📄
Deloitte Tech Trends 2026168 chunks
.docx → MarkItDown
📄
McKinsey Tech Trends 2025231 chunks
.docx → MarkItDown
🌐
Deloitte Semiconductor 202628 chunks
vjra.us live page
Scripts & Key Functions
📝 publish_jira_epic.py
Strips metadata from source .md
Builds ADF description (headings + paragraphs)
POST /rest/api/3/issue → Epic
POST .../attachments → .md file
📥 ingest_pinecone.py
chunk_text() — sliding window 1500/200
adf_to_text() — Jira ADF → plain text
fetch_url_text() — live URL → text
Embeds in batches of 50, upserts in batches of 100
Writes pinecone_ingestion_manifest.json
📊 generate_monthly_report.py
retrieve() — 11 queries, dedup by ID
format_context() — top 12 chunks per side
REPORT_PROMPT → GPT-4o → .md report
EMAIL_PROMPT → GPT-4o → stakeholder email
Retrieval Queries — 11 Hardcoded
Finance Queries → novacart-int (6)
• NovaCart quarterly revenue and profit margins
• NovaPhone X1 sales volume and trends
• NovaHome SmartHub Pro performance
• NovaFit Active Watch unit sales
• NovaCart Essentials subscription churn rate
• Year-over-year product line comparison
Market Queries → novacart-ext (5)
• Global semiconductor market outlook and growth
• Memory pricing trends and supply constraints
• Consumer electronics demand forecast
• AI chip market size and investment trends
• Technology trends impacting consumer hardware
Each query: embed → query Pinecone (top_k=5) → dedup by vector ID keeping highest score → sort descending
Environment & Config
🔑 Required .env Variables
OPENAI_API_KEY — embeddings + report generation
PINECONE_API_KEY — vector store access
JIRA_BASE_URL — Atlassian site URL
JIRA_EMAIL — Basic auth email
JIRA_API_TOKEN — Basic auth token
📋 Output Artifacts
output/monthly_financial_standing_report_YYYY-MM.md
output/email_draft_YYYY-MM.txt
output/pinecone_ingestion_manifest.json
Manifest records: doc_id, namespace, chunk count, vector IDs
Cost per Run
Step Calls Tokens Cost
Embed 531 chunks~11 batches~171K$0.022
Embed 11 queries11 calls~165<$0.001
Synthesize report1 GPT-4o~10.3K$0.033
Draft email1 GPT-4o~1.2K$0.005
Full run (re-ingest + report) ~182K ~$0.06
Report-only (no re-ingest) ~10.6K ~$0.04
Pinecone serverless + Jira API + GitHub Pages = $0. Pricing: text-embedding-3-large $0.13/1M tok · GPT-4o $2.50/$10 per 1M in/out tok
🧑
You
G
Greeter
F
Finance
Analyst
M
Market
Intelligence
E
Executive
Response
Ask anything — the right specialist responds automatically
How Agents Transfer
Greeter
Routes to Finance, Market, or Executive based on your question
Finance
Transfers to Market for industry trends. Transfers to Executive for synthesis.
Market
Transfers to Finance for product data. Transfers to Executive for recommendations.
Executive
Transfers to Finance or Market if you drill into specifics.
Agents & Roles
GreeterWelcomes you, detects intent, routes to the right specialist
Finance AnalystInternal NovaCart data — revenue, margins, SKU performance, subscriptions
Market IntelligenceExternal market data — semiconductors, AI chips, memory prices, trends
ExecutiveSynthesized insights, correlated risks, recommendations — full KB access
How This Email Is Generated
Monthly Report GPT-4o (temp 0.3) Stakeholder Email
The synthesized Monthly Financial Standing Report is passed to GPT-4o with an email prompt that extracts the top 3 takeaways and formats a concise stakeholder message. Sending is manual — the draft is for human review before dispatch.
Email Preview — June 2026
Subject
Key Insights from June 2026 Monthly Financial Standing Report
From
NovaCart Product Finance Reporting Agent
To
Leadership Stakeholders

Dear Stakeholders,

I hope this message finds you well. As we review NovaCart's financial performance for June 2026, I wanted to highlight a few critical insights from our latest report.

  • NovaCart's strategic focus on subscription services and smart home devices has positioned us well for sustained growth, despite challenges like rising memory prices and a potential slowdown in smartphone demand.
  • The NovaPhone X1, while historically strong, faces a cautious outlook due to anticipated declines in smartphone demand. Strategic marketing efforts will be essential to maintain market share.
  • Our NovaHome SmartHub Pro and NovaFit Active Watch continue to perform steadily, but rising memory prices could pressure margins, necessitating careful cost management.

The full report is attached for your review. Please feel free to reach out with any questions or for further discussion.

Best regards,
NovaCart Product Finance Reporting Agent

📎 Attached — Monthly Financial Standing Report (June 2026)
Review & Send