AI-powered chatbot for analyzing K-POP industry financial and business data using Vector DB and local LLM.
Language: English | 한글 (Korean)
This chatbot leverages Ollama's local LLM (Llama 3.1) and ChromaDB vector database to analyze K-POP industry financial data and business information. Unlike prompt-based approaches, it uses Vector DB similarity scores to objectively evaluate answer accuracy.
- Local LLM-based: Ollama + Llama 3.1 with no cloud dependency
- Vector DB Search: ChromaDB for efficient document retrieval
- Accuracy Scoring: Automatic reliability calculation based on similarity (0-100%)
- Multiple Confidence Levels: Very High / High / Medium / Low / Very Low
- Streamlit Web UI: Intuitive and user-friendly interface
- Chat History: Automatic conversation logging
- Source References: Document citations for all answers
| Component | Technology |
|---|---|
| LLM | Ollama + Llama 3.1 |
| Embedding | Sentence Transformers (all-MiniLM-L6-v2) |
| Vector DB | ChromaDB |
| Web UI | Streamlit |
| Language | Python 3.9+ |
- Python 3.9+
- Ollama (Install: https://ollama.ai)
- 4GB+ RAM
source kpopBot_venv/bin/activateOLLAMA_HOST=127.0.0.1:11435 ollama serveInstall required model:
ollama pull llama3.1streamlit run app.pyBrowser opens automatically at http://localhost:8501
python chat.pyAutomatically calculated based on Vector DB Cosine Similarity:
| Score | Confidence | Description |
|---|---|---|
| 85%+ | Very High | Highly trustworthy |
| 70-85% | High | Reliable |
| 55-70% | Medium | Moderately reliable |
| 40-55% | Low | Low confidence |
| <40% | Very Low | Not trustworthy |
KpopBot/
├── app.py # Streamlit web UI
├── chat.py # CLI chatbot
├── fileProcess.py # PDF processing and vector DB creation
├── Data/ # K-POP company financial documents (PDF)
│ ├── 2021년/
│ ├── 2022년/
│ ├── 2023년/
│ ├── 2024년/
│ └── 2025년/
├── vector_db/ # ChromaDB storage
└── README.md
- Streamlit-based web interface
- Visual accuracy metrics display
- Detailed analysis view (per-document similarity)
- Chat history management
- Terminal-based CLI interface
- Text-based accuracy score output
- Automatic Q&A loop
- PDF document loading and preprocessing
- Text chunking
- Vector embedding and ChromaDB storage
- Metadata management (year, quarter, company)
Sample Questions:
- "What was HYBE's revenue in 2024?"
- "What is SM Entertainment's quarterly operating profit trend?"
- "What are JYP Entertainment's main revenue sources?"
Response Includes:
- Detailed answer in markdown format
- Accuracy metrics
- Per-document similarity scores
- Source references
Modify settings in chat.py or app.py:
# LLM settings
llm = ChatOllama(
model="llama3.1",
base_url="http://127.0.0.1:11435", # Ollama address
temperature=0 # 0: accurate, 1: creative
)
# Search options
retriever=vector_db.as_retriever(search_kwargs={"k": 5}) # Top 5 documentsQ: "Connection refused" error
Ollama server not started
$ OLLAMA_HOST=127.0.0.1:11435 ollama serve
Q: "Vector DB not found"
vector_db folder missing
$ python fileProcess.py # Process data to create vector DB
Q: Low accuracy score
Need more training data
- Add more PDFs to Data/ folder
- Run python fileProcess.py to re-index
MIT License
Last Updated: March 2026