Dy
Dysprosium Financial Assistant

RAG Application

Task 3: Data Sources, Chunking Strategy, and Retrieval Architecture
Chunking Strategy

We use RecursiveCharacterTextSplitter with a chunk size of 500 characters and 50-character overlap. This was chosen because:

  • Business knowledge documents contain short, self-contained paragraphs and bullet points —500 characters captures a complete concept without splitting mid-sentence.
  • The 50-character overlap ensures continuity at chunk boundaries, preventing loss of context when a concept spans two chunks.
  • RecursiveCharacterTextSplitter tries paragraph, sentence, then word boundaries in order, producing cleaner chunks than a fixed-length splitter.
chunk_size=500
chunk_overlap=50
k=5 retrieval
Internal Knowledge Base (RAG)

The internal knowledge base is a collection of curated documents organized by category. These are embedded using text-embedding-3-small (OpenAI, 1536 dimensions) and stored in a Qdrant in-memory vector store.

CategoryDescriptionPath
Financial GlossaryBusiness and financial termsdata/financial_glossary/
Amazon SellingAccount setup, listing optimization, FBA/FBM strategiesdata/amazon_selling/
Shopify StrategyStore optimization, apps, marketing for DTCdata/shopify_strategy/
AdvertisingMeta, Google, TikTok campaign strategies and ROI optimizationdata/advertising/
OperationsWarehouse optimization, shipping cost reduction, inventorydata/operations/
External API: Tavily Web Search

For questions about current market trends, competitor activity, or recent industry news, the system uses Tavily — a search API purpose-built for AI agents. Tavily returns structured, citation-ready results from the web.

Interaction during usage: When the supervisor routes a query to the Strategic Guidance or Current Trends agent, the agent first checks the internal RAG knowledge base for relevant context. If the question is about current events or data not in the knowledge base, Tavily is called to supplement with live web results. Both sources are combined in the agent's context window before generating a response, with source attribution for each piece of information.

Retrieval Pipeline
  1. User asks a strategic or knowledge question
  2. Supervisor routes to the Strategic Guidance agent
  3. Agent calls retrieve_context(query, k=5) on Qdrant
  4. Top 5 chunks are injected into the system prompt as grounding context
  5. If needed, Tavily web search provides supplementary current data
  6. Agent generates a response citing retrieved sources