How yeeeengyu/standard_ai works
This FastAPI service offers financial-product recommendations, investment recommendations, credit-grade responses, and a personal-finance/youth-policy chatbot with chat history and keyword extraction. The main workflow is a request to an API route, then domain-specific prompt or retrieval logic, then a formatted response. Product and investment recommendations use separate retrieval systems over the bank-products text; the chatbot also persists conversations in MongoDB. The credit calculation helpers are present, but the sampled route calls the LLM-based grading function instead. Connections reflect the sampled code and source index; unsampled wiring is not inferred.
Main entry points: main.py API routes · prodrecom_rag.py Product retrieval · invest_recommend.py Investment recommender · invRecom_rag.py Investment retrieval
Components 16
API
- API routes
app/main.py - Request schemas
app/schemas.py
Recommendations
- Product prompt
app/prodRecom/prodrecom_fewshot.py - Product retrieval
app/prodRecom/prodrecom_rag.py - JSON parser
app/prodRecom/prodrecom_utils.py - Investment recommender
app/invRecom/invest_recommend.py - Investment retrieval
app/invRecom/invRecom_rag.py - Bank product text
rag/은행상품_설명.txt
Credit grading
- Credit grading prompt
app/credRate/credRate_prompt.py - Score helpers
app/credRate/credRate_cal.py
Chat
- Chat prompt
app/chatbot/chatbot_prompt.py - Keyword extraction
app/chatbot/chatbot_keyword.py - Chat MongoDB
Other components
- API client
- OpenAI models
- Embedding model
Connections 20
- API client → API routes: calls API
app/main.py - API routes → Request schemas: validates input
app/main.py - API routes → Product prompt: formats query
app/main.py - API routes → Product retrieval: invokes retrieval
app/main.py - API routes → JSON parser: parses result
app/main.py - Product retrieval → Bank product text: reads text
app/prodRecom/prodrecom_rag.py - Product retrieval → OpenAI models: calls models
app/prodRecom/prodrecom_rag.py - API routes → Investment recommender: requests recommendation
app/main.py - Investment recommender → Investment retrieval: retrieves context
app/invRecom/invest_recommend.py - Investment retrieval → Bank product text: reads text
app/invRecom/invRecom_rag.py - Investment retrieval → OpenAI models: calls models
app/invRecom/invRecom_rag.py - Investment recommender → OpenAI models: requests completion
app/invRecom/invest_recommend.py - API routes → Credit grading prompt: requests grade
app/main.py - Credit grading prompt → OpenAI models: requests completion
app/credRate/credRate_prompt.py - API routes → Chat prompt: builds chat chain
app/main.py - API routes → OpenAI models: invokes chat model
app/main.py - API routes → Chat MongoDB: reads and writes
app/main.py - API routes → Keyword extraction: extracts keywords
app/main.py - Keyword extraction → Embedding model: loads encoder
app/chatbot/chatbot_keyword.py - API routes → Chat MongoDB: stores keywords
app/main.py