Enterprise-grade financial intelligence system powered by knowledge graphs.
# 1. Install dependencies
pip install -r requirements.txt
# 2. Start Neo4j (Docker)
docker run -d \
--name neo4j \
-p 7474:7474 -p 7687:7687 \
-e NEO4J_AUTH=neo4j/password \
neo4j:latest
# 3. Configure environment
cp .env.backup .env
# Edit .env with your settings
# 4. Start services
./start.shVisit: http://localhost:8501
- Privacy-First: Offline processing with local LLMs (Ollama)
- Graph Intelligence: Neo4j-powered knowledge graph
- Multi-Hop Reasoning: 2-3 hop logical inference for hidden insights
- Data Integration: Merge PDF + CSV + JSON into unified knowledge graph
- Multi-Agent: Collaborative AI agents for deep analysis
- 8GB RAM Optimized: Efficient memory management
- Real-time Analysis: Fast query processing with caching
- Path Visualization: Interactive reasoning path display
src/
โโโ agents/ # Multi-agent system (Analyst, Planner, Writer)
โโโ engine/ # Graph processing engine
โ โโโ extractor.py # Entity/Relationship extraction
โ โโโ translator.py # JSON โ Cypher
โ โโโ integrator.py # PDF + CSV + JSON integration
โ โโโ reasoner.py # Multi-hop reasoning engine
โ โโโ graphrag_engine.py # Core engine
โ โโโ privacy_graph_builder.py # Privacy-optimized builder
โโโ db/ # Neo4j integration
โโโ mcp/ # External tool integration
โโโ streamlit_app.py # Web UI
โโโ reasoning_ui.py # Multi-hop reasoning UI
Key environment variables in .env:
# Mode
RUN_MODE=API # API (OpenAI) or LOCAL (Ollama)
PRIVACY_MODE=true # Enable privacy-first mode
# OpenAI
OPENAI_API_KEY=sk-...
# Neo4j
NEO4J_URI=bolt://localhost:7687
NEO4J_PASSWORD=password
# Ollama (for Privacy Mode)
OLLAMA_BASE_URL=http://localhost:11434- Go to "Data Ingestion" tab
- Upload PDF document
- System extracts entities and builds knowledge graph
- Go to "Query Interface" tab
- Ask questions about your data
- Get citation-backed answers with confidence scores
- Temperature: Control creativity (0.0-2.0)
- Retrieval Chunks: Number of context chunks (5-50)
- Web Search: Enable real-time web data
- Multi-Agent: Use collaborative AI pipeline
# Run tests
python -m pytest tests/
# Check lints
python -m flake8 src/
# Format code
python -m black src/MIT License - See LICENSE file for details
๋ฉ์ธ Streamlit UI์ "๐ธ๏ธ Graph Visualizer" ํญ์์ ๋ฐ๋ก ์ฌ์ฉ ๊ฐ๋ฅํฉ๋๋ค!
./start.sh
# ๋๋
streamlit run src/streamlit_app.py --server.port 8501Visit: http://localhost:8501 โ Graph Visualizer ํญ
- All Nodes: ์ ์ฒด ๊ทธ๋ํ ๋ณด๊ธฐ
- Company Focus: ํน์ ๊ธฐ์ ์ค์ฌ ๋คํธ์ํฌ
- Risk Analysis: ๋ฆฌ์คํฌ ๊ด๊ณ ์๊ฐํ
- Custom Query: Cypher ์ฟผ๋ฆฌ ์ง์ ์ ๋ ฅ
- ๐ด Company (๊ธฐ์ )
- ๐ต Country (๊ตญ๊ฐ)
- ๐ข Industry (์ฐ์ )
- ๐ MacroIndicator (๊ฑฐ์๊ฒฝ์ )
- ๐ฃ FinancialMetric (์ฌ๋ฌด์งํ)
- ๋ ธ๋ ๋๋๊ทธ๋ก ์์น ์กฐ์
- ํด๋ฆญ์ผ๋ก ์ฐ๊ฒฐ๋ ๋ ธ๋ ํ์ธ
- ์ค/ํฌ์ผ๋ก ๊ทธ๋ํ ํ์
- ๋ฌผ๋ฆฌ ์๋ฎฌ๋ ์ด์ ์ผ๋ก ์๋ ๋ฐฐ์น
- ์ค์๊ฐ ๋ ธ๋ ๊ฒ์ ๋ฐ ํํฐ๋ง
๋ชจ๋ ๊ธฐ๋ฅ์ด ํ๋์ Streamlit ์ฑ (Port 8501) ์ ํตํฉ๋์์ต๋๋ค!
./start.shVisit: http://localhost:8501
ํญ ๊ตฌ์กฐ:
- ๐ Query Interface: ์ง๋ฌธ & ๋ต๋ณ
- ๐ฅ Data Ingestion: PDF ์ ๋ก๋ & ์ธ๋ฑ์ฑ
- ๐ Data Sources: ๋ฐ์ดํฐ ์์ค ๊ด๋ฆฌ
- ๐ธ๏ธ Graph Visualizer: ์ง์ ๊ทธ๋ํ ์๊ฐํ
- PDF + CSV + JSON ํตํฉ ์ธ๋ฑ์ฑ
- ์ํฐํฐ ์๋ ๋ณํฉ (์: 'NVDA' โ 'Nvidia')
- ์งํ ๋ฐ์ดํฐ ์ฐ๊ฒฐ
- 2-3 hop ๋ ผ๋ฆฌ์ ์ถ๋ก ์ฒด์ธ
- A โ B โ C โ D ์ธ๊ณผ๊ด๊ณ ๋ถ์
- ์จ๊ฒจ์ง ๋ฆฌ์คํฌ ๋ฐ๊ฒฌ
- ์ธํฐ๋ํฐ๋ธ ๊ฒฝ๋ก ๊ทธ๋ํ
- ๋ ธ๋ ๋ฐ ๊ด๊ณ ์์ธ ์ ๋ณด
- ์ ๋ขฐ๋ ๊ธฐ๋ฐ ์์ ์ฝ๋ฉ
# ์ง๋ฌธ: "How does Taiwan tension affect Nvidia?"
# ์ถ๋ก ๊ฒฐ๊ณผ:
๐ก Because Nvidia depends on TSMC (high criticality),
and TSMC is located in Taiwan, and Taiwan faces
geopolitical tension, therefore Nvidia is exposed
to significant supply chain disruption risk.
๐ Confidence: 85%
๐ Reasoning Path:
Taiwan Strait Tension โ Taiwan โ TSMC โ Nvidia์์ธํ ๋ด์ฉ์ Multi-Hop Reasoning Guide ์ฐธ์กฐ
import asyncio
from engine.reasoner import MultiHopReasoner
async def analyze():
reasoner = MultiHopReasoner()
result = await reasoner.reason(
question="Nvidia์ ๊ณต๊ธ๋ง ๋ฆฌ์คํฌ๋?",
max_hops=3
)
print(result['inference'])
reasoner.close()
asyncio.run(analyze())python test_multihop_system.pyํ ์คํธ ํญ๋ชฉ:
- โ Entity Resolver - ์ํฐํฐ ์ด๋ฆ ์ ๊ทํ
- โ Data Integrator - CSV/JSON ํตํฉ
- โ Multi-Hop Reasoner - ์ถ๋ก ์์ง
- โ End-to-End - ์ ์ฒด ์ํฌํ๋ก์ฐ