joomha 1.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- joomha-1.0.0/PKG-INFO +237 -0
- joomha-1.0.0/README.md +204 -0
- joomha-1.0.0/joomha/__init__.py +3 -0
- joomha-1.0.0/joomha/cli.py +595 -0
- joomha-1.0.0/joomha/config.py +277 -0
- joomha-1.0.0/joomha/indexer/__init__.py +1 -0
- joomha-1.0.0/joomha/indexer/ast_parser.py +206 -0
- joomha-1.0.0/joomha/indexer/git_analyzer.py +96 -0
- joomha-1.0.0/joomha/indexer/parsers/__init__.py +1 -0
- joomha-1.0.0/joomha/indexer/parsers/base.py +30 -0
- joomha-1.0.0/joomha/indexer/parsers/go_parser.py +124 -0
- joomha-1.0.0/joomha/indexer/parsers/javascript_parser.py +171 -0
- joomha-1.0.0/joomha/indexer/parsers/python_parser.py +144 -0
- joomha-1.0.0/joomha/indexer/parsers/rust_parser.py +138 -0
- joomha-1.0.0/joomha/indexer/parsers/typescript_parser.py +189 -0
- joomha-1.0.0/joomha/indexer/vector_builder.py +135 -0
- joomha-1.0.0/joomha/llm/__init__.py +1 -0
- joomha-1.0.0/joomha/llm/client.py +176 -0
- joomha-1.0.0/joomha/llm/prompt_builder.py +83 -0
- joomha-1.0.0/joomha/orchestrator.py +203 -0
- joomha-1.0.0/joomha/retriever/__init__.py +1 -0
- joomha-1.0.0/joomha/retriever/graph.py +281 -0
- joomha-1.0.0/joomha/retriever/vector.py +41 -0
- joomha-1.0.0/joomha/ui/__init__.py +1 -0
- joomha-1.0.0/joomha/ui/display.py +125 -0
- joomha-1.0.0/joomha/ui/input_handler.py +35 -0
- joomha-1.0.0/joomha.egg-info/PKG-INFO +237 -0
- joomha-1.0.0/joomha.egg-info/SOURCES.txt +56 -0
- joomha-1.0.0/joomha.egg-info/dependency_links.txt +1 -0
- joomha-1.0.0/joomha.egg-info/entry_points.txt +3 -0
- joomha-1.0.0/joomha.egg-info/requires.txt +17 -0
- joomha-1.0.0/joomha.egg-info/top_level.txt +2 -0
- joomha-1.0.0/joomhalab/__init__.py +3 -0
- joomha-1.0.0/joomhalab/cli.py +714 -0
- joomha-1.0.0/joomhalab/config.py +291 -0
- joomha-1.0.0/joomhalab/indexer/__init__.py +1 -0
- joomha-1.0.0/joomhalab/indexer/ast_parser.py +206 -0
- joomha-1.0.0/joomhalab/indexer/git_analyzer.py +96 -0
- joomha-1.0.0/joomhalab/indexer/parsers/__init__.py +1 -0
- joomha-1.0.0/joomhalab/indexer/parsers/base.py +30 -0
- joomha-1.0.0/joomhalab/indexer/parsers/go_parser.py +124 -0
- joomha-1.0.0/joomhalab/indexer/parsers/javascript_parser.py +171 -0
- joomha-1.0.0/joomhalab/indexer/parsers/python_parser.py +144 -0
- joomha-1.0.0/joomhalab/indexer/parsers/rust_parser.py +138 -0
- joomha-1.0.0/joomhalab/indexer/parsers/typescript_parser.py +189 -0
- joomha-1.0.0/joomhalab/indexer/vector_builder.py +135 -0
- joomha-1.0.0/joomhalab/llm/__init__.py +1 -0
- joomha-1.0.0/joomhalab/llm/client.py +206 -0
- joomha-1.0.0/joomhalab/llm/prompt_builder.py +130 -0
- joomha-1.0.0/joomhalab/orchestrator.py +208 -0
- joomha-1.0.0/joomhalab/retriever/__init__.py +1 -0
- joomha-1.0.0/joomhalab/retriever/graph.py +281 -0
- joomha-1.0.0/joomhalab/retriever/vector.py +41 -0
- joomha-1.0.0/joomhalab/ui/__init__.py +1 -0
- joomha-1.0.0/joomhalab/ui/display.py +125 -0
- joomha-1.0.0/joomhalab/ui/input_handler.py +35 -0
- joomha-1.0.0/pyproject.toml +51 -0
- joomha-1.0.0/setup.cfg +4 -0
joomha-1.0.0/PKG-INFO
ADDED
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: joomha
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: AI-powered CLI for understanding any codebase through conversation
|
|
5
|
+
License: MIT
|
|
6
|
+
Project-URL: Homepage, https://github.com/username/joomha
|
|
7
|
+
Project-URL: Repository, https://github.com/username/joomha
|
|
8
|
+
Keywords: ai,cli,code,rag,comprehension,developer-tools
|
|
9
|
+
Classifier: Development Status :: 4 - Beta
|
|
10
|
+
Classifier: Environment :: Console
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
15
|
+
Requires-Python: >=3.10
|
|
16
|
+
Description-Content-Type: text/markdown
|
|
17
|
+
Requires-Dist: typer[all]>=0.9.0
|
|
18
|
+
Requires-Dist: rich>=13.0.0
|
|
19
|
+
Requires-Dist: prompt-toolkit>=3.0.0
|
|
20
|
+
Requires-Dist: gitpython>=3.1.0
|
|
21
|
+
Requires-Dist: sentence-transformers>=2.2.0
|
|
22
|
+
Requires-Dist: lancedb>=0.5.0
|
|
23
|
+
Requires-Dist: pyarrow>=14.0.0
|
|
24
|
+
Requires-Dist: google-generativeai>=0.5.0
|
|
25
|
+
Requires-Dist: openai>=1.0.0
|
|
26
|
+
Requires-Dist: anthropic>=0.20.0
|
|
27
|
+
Requires-Dist: tree-sitter>=0.23.0
|
|
28
|
+
Requires-Dist: tree-sitter-javascript>=0.23.0
|
|
29
|
+
Requires-Dist: tree-sitter-typescript>=0.23.0
|
|
30
|
+
Requires-Dist: requests>=2.0.0
|
|
31
|
+
Provides-Extra: eval
|
|
32
|
+
Requires-Dist: ragas>=0.1.0; extra == "eval"
|
|
33
|
+
|
|
34
|
+
# joomha-CLI
|
|
35
|
+
|
|
36
|
+
**AI CLI untuk pemahaman code**
|
|
37
|
+
|
|
38
|
+
joomha-CLI adalah tool AI CLI yang memungkinkan memahami repositori kode asing hanya dengan bertanya dalam bahasa natural. Dibangun di atas arsitektur RAG (Retrieval-Augmented Generation) dengan dua mesin retrieval yang bisa dibandingkan secara paralel: **Vector Retrieval** dan **Graph Retrieval**.
|
|
39
|
+
|
|
40
|
+
Dengan **Tree-sitter** memahami multi-bahasa: **Python, JavaScript (.js, .jsx), dan TypeScript (.ts, .tsx)**.
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## Fitur Utama
|
|
45
|
+
|
|
46
|
+
- **Vector Retrieval** — Cosine similarity search menggunakan `all-MiniLM-L6-v2` embeddings
|
|
47
|
+
- **Graph Retrieval** — Traversal relasional via AST parsing + Git co-change analysis
|
|
48
|
+
- **Compare Mode** — Jalankan kedua retriever sekaligus dan bandingkan hasilnya
|
|
49
|
+
- **Auto Fallback** — Graph → Vector secara otomatis jika tidak ada node yang cocok
|
|
50
|
+
- **Rich TUI** — Banner, panel berwarna, spinner, tabel — semua di terminal
|
|
51
|
+
- **Research-ready** — Evaluator bawaan untuk riset perbandingan retrieval
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## Instalasi
|
|
56
|
+
|
|
57
|
+
### Dari Source (Development)
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
git clone https://github.com/joomha/joomha-CLI.git
|
|
61
|
+
cd joomha-CLI
|
|
62
|
+
pip install -e .
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### Dari PyPI
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
pip install joomha-CLI
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## Konfigurasi
|
|
74
|
+
|
|
75
|
+
joomha-CLI membutuhkan API key untuk LLM. Pilih salah satu provider:
|
|
76
|
+
|
|
77
|
+
### Via Environment Variable (Direkomendasikan)
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
# Google Gemini (default, gratis)
|
|
81
|
+
export GEMINI_API_KEY=your-key-here
|
|
82
|
+
|
|
83
|
+
# Atau OpenAI
|
|
84
|
+
export OPENAI_API_KEY=your-key-here
|
|
85
|
+
|
|
86
|
+
# Atau Anthropic
|
|
87
|
+
export ANTHROPIC_API_KEY=your-key-here
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### Via CLI
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
joomha config set gemini your-key-here
|
|
94
|
+
joomha config show
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
## Penggunaan
|
|
100
|
+
|
|
101
|
+
### Memulai
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
cd /path/to/any/git/repo
|
|
105
|
+
joomha
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
Saat pertama kali dijalankan, joomha-CLI akan otomatis:
|
|
109
|
+
1. Parsing AST semua file Python, JS, TS
|
|
110
|
+
2. Menganalisis riwayat Git (co-changes, hotspots)
|
|
111
|
+
3. Membangun vector embeddings
|
|
112
|
+
|
|
113
|
+
### REPL Commands
|
|
114
|
+
|
|
115
|
+
| Command | Deskripsi |
|
|
116
|
+
|---------|-----------|
|
|
117
|
+
| `<pertanyaan>` | Tanya apapun tentang kode |
|
|
118
|
+
| `/mode vector` | Gunakan Vector Retrieval |
|
|
119
|
+
| `/mode graph` | Gunakan Graph Retrieval |
|
|
120
|
+
| `/mode compare` | Bandingkan kedua mode |
|
|
121
|
+
| `/hotspots` | Tampilkan file paling sering diubah |
|
|
122
|
+
| `/help` | Tampilkan bantuan |
|
|
123
|
+
| `/q` | Keluar |
|
|
124
|
+
|
|
125
|
+
### Contoh Sesi
|
|
126
|
+
|
|
127
|
+
```
|
|
128
|
+
[graph] ❯ Bagaimana cara kerja sistem autentikasi?
|
|
129
|
+
|
|
130
|
+
╭──── joomha-CLI [graph] ────╮
|
|
131
|
+
│ │
|
|
132
|
+
│ Sistem autentikasi... │
|
|
133
|
+
│ │
|
|
134
|
+
╰─ Mode: graph │ Konteks: 3 │ Latency: 1.23s ─╯
|
|
135
|
+
|
|
136
|
+
[graph] ❯ /mode compare
|
|
137
|
+
✓ Mode diubah ke: compare
|
|
138
|
+
|
|
139
|
+
[compare] ❯ Jelaskan alur request handling
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
### Re-indexing
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
joomha --reindex
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
---
|
|
149
|
+
|
|
150
|
+
## Evaluasi Riset
|
|
151
|
+
|
|
152
|
+
Joomha menyertakan evaluator untuk riset perbandingan retrieval:
|
|
153
|
+
|
|
154
|
+
1. Edit `test_questions.json` dengan 30 pertanyaan + ground truth
|
|
155
|
+
2. Jalankan evaluator:
|
|
156
|
+
|
|
157
|
+
```bash
|
|
158
|
+
python evaluate.py
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
3. Hasil tersimpan di `hasil_evaluasi.csv` dengan metrik:
|
|
162
|
+
- **Hit Rate** — Apakah file relevan ada di konteks?
|
|
163
|
+
- **MRR** — Posisi file relevan pertama
|
|
164
|
+
- **Latency** — Waktu total per query
|
|
165
|
+
|
|
166
|
+
---
|
|
167
|
+
|
|
168
|
+
## Arsitektur
|
|
169
|
+
|
|
170
|
+
```
|
|
171
|
+
Query ──┬── VectorRetriever ── LanceDB cosine search ── Top-5 chunks
|
|
172
|
+
│
|
|
173
|
+
└── GraphRetriever ── SQLite (AST nodes + edges + co-changes)
|
|
174
|
+
│
|
|
175
|
+
└── Fallback ke VectorRetriever jika kosong
|
|
176
|
+
│
|
|
177
|
+
▼
|
|
178
|
+
PromptBuilder (struktur IDENTIK)
|
|
179
|
+
│
|
|
180
|
+
▼
|
|
181
|
+
LLMClient (Gemini/OpenAI/Claude)
|
|
182
|
+
│
|
|
183
|
+
▼
|
|
184
|
+
Rich Markdown Output
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
---
|
|
188
|
+
|
|
189
|
+
## Struktur Proyek
|
|
190
|
+
|
|
191
|
+
```text
|
|
192
|
+
joomha/
|
|
193
|
+
├── joomha/
|
|
194
|
+
│ ├── cli.py # Entry point + REPL
|
|
195
|
+
│ ├── config.py # API key management
|
|
196
|
+
│ ├── orchestrator.py # RAG pipeline coordinator
|
|
197
|
+
│ ├── indexer/
|
|
198
|
+
│ │ ├── parsers/ # Multi-language AST Parsers
|
|
199
|
+
│ │ │ ├── base.py
|
|
200
|
+
│ │ │ ├── python_parser.py
|
|
201
|
+
│ │ │ ├── javascript_parser.py # Tree-sitter powered
|
|
202
|
+
│ │ │ └── typescript_parser.py # Tree-sitter powered
|
|
203
|
+
│ │ ├── ast_parser.py # Universal Parser Dispatcher → SQLite
|
|
204
|
+
│ │ ├── git_analyzer.py # Git history → SQLite
|
|
205
|
+
│ │ └── vector_builder.py # Multi-lang chunking → LanceDB
|
|
206
|
+
│ ├── retriever/
|
|
207
|
+
│ │ ├── vector.py # Cosine similarity retrieval
|
|
208
|
+
│ │ └── graph.py # Relational graph retrieval
|
|
209
|
+
│ ├── llm/
|
|
210
|
+
│ │ ├── client.py # Multi-provider LLM client
|
|
211
|
+
│ │ └── prompt_builder.py # Strict grounding & AI Persona prompt
|
|
212
|
+
│ └── ui/
|
|
213
|
+
│ ├── display.py # Rich panels & tables
|
|
214
|
+
│ └── input_handler.py # prompt-toolkit session
|
|
215
|
+
├── evaluate.py # Research evaluation script
|
|
216
|
+
├── test_questions.json # Evaluation dataset
|
|
217
|
+
├── pyproject.toml
|
|
218
|
+
└── README.md
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
---
|
|
222
|
+
|
|
223
|
+
## Stack Teknologi
|
|
224
|
+
|
|
225
|
+
| Layer | Library |
|
|
226
|
+
|-------|---------|
|
|
227
|
+
| CLI | typer, rich, prompt-toolkit |
|
|
228
|
+
| AST/Parser | tree-sitter (JS/TS), ast (Python stdlib) |
|
|
229
|
+
| Git | gitpython |
|
|
230
|
+
| Embedding | sentence-transformers (all-MiniLM-L6-v2) |
|
|
231
|
+
| Vector DB | lancedb + pyarrow |
|
|
232
|
+
| Graph DB | sqlite3 (stdlib) |
|
|
233
|
+
| LLM | google-generativeai (`gemini-flash-latest`) / openai / anthropic |
|
|
234
|
+
|
|
235
|
+
---
|
|
236
|
+
|
|
237
|
+
|
joomha-1.0.0/README.md
ADDED
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
# joomha-CLI
|
|
2
|
+
|
|
3
|
+
**AI CLI untuk pemahaman code**
|
|
4
|
+
|
|
5
|
+
joomha-CLI adalah tool AI CLI yang memungkinkan memahami repositori kode asing hanya dengan bertanya dalam bahasa natural. Dibangun di atas arsitektur RAG (Retrieval-Augmented Generation) dengan dua mesin retrieval yang bisa dibandingkan secara paralel: **Vector Retrieval** dan **Graph Retrieval**.
|
|
6
|
+
|
|
7
|
+
Dengan **Tree-sitter** memahami multi-bahasa: **Python, JavaScript (.js, .jsx), dan TypeScript (.ts, .tsx)**.
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Fitur Utama
|
|
12
|
+
|
|
13
|
+
- **Vector Retrieval** — Cosine similarity search menggunakan `all-MiniLM-L6-v2` embeddings
|
|
14
|
+
- **Graph Retrieval** — Traversal relasional via AST parsing + Git co-change analysis
|
|
15
|
+
- **Compare Mode** — Jalankan kedua retriever sekaligus dan bandingkan hasilnya
|
|
16
|
+
- **Auto Fallback** — Graph → Vector secara otomatis jika tidak ada node yang cocok
|
|
17
|
+
- **Rich TUI** — Banner, panel berwarna, spinner, tabel — semua di terminal
|
|
18
|
+
- **Research-ready** — Evaluator bawaan untuk riset perbandingan retrieval
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## Instalasi
|
|
23
|
+
|
|
24
|
+
### Dari Source (Development)
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
git clone https://github.com/joomha/joomha-CLI.git
|
|
28
|
+
cd joomha-CLI
|
|
29
|
+
pip install -e .
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### Dari PyPI
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
pip install joomha-CLI
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## Konfigurasi
|
|
41
|
+
|
|
42
|
+
joomha-CLI membutuhkan API key untuk LLM. Pilih salah satu provider:
|
|
43
|
+
|
|
44
|
+
### Via Environment Variable (Direkomendasikan)
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
# Google Gemini (default, gratis)
|
|
48
|
+
export GEMINI_API_KEY=your-key-here
|
|
49
|
+
|
|
50
|
+
# Atau OpenAI
|
|
51
|
+
export OPENAI_API_KEY=your-key-here
|
|
52
|
+
|
|
53
|
+
# Atau Anthropic
|
|
54
|
+
export ANTHROPIC_API_KEY=your-key-here
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### Via CLI
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
joomha config set gemini your-key-here
|
|
61
|
+
joomha config show
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
## Penggunaan
|
|
67
|
+
|
|
68
|
+
### Memulai
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
cd /path/to/any/git/repo
|
|
72
|
+
joomha
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Saat pertama kali dijalankan, joomha-CLI akan otomatis:
|
|
76
|
+
1. Parsing AST semua file Python, JS, TS
|
|
77
|
+
2. Menganalisis riwayat Git (co-changes, hotspots)
|
|
78
|
+
3. Membangun vector embeddings
|
|
79
|
+
|
|
80
|
+
### REPL Commands
|
|
81
|
+
|
|
82
|
+
| Command | Deskripsi |
|
|
83
|
+
|---------|-----------|
|
|
84
|
+
| `<pertanyaan>` | Tanya apapun tentang kode |
|
|
85
|
+
| `/mode vector` | Gunakan Vector Retrieval |
|
|
86
|
+
| `/mode graph` | Gunakan Graph Retrieval |
|
|
87
|
+
| `/mode compare` | Bandingkan kedua mode |
|
|
88
|
+
| `/hotspots` | Tampilkan file paling sering diubah |
|
|
89
|
+
| `/help` | Tampilkan bantuan |
|
|
90
|
+
| `/q` | Keluar |
|
|
91
|
+
|
|
92
|
+
### Contoh Sesi
|
|
93
|
+
|
|
94
|
+
```
|
|
95
|
+
[graph] ❯ Bagaimana cara kerja sistem autentikasi?
|
|
96
|
+
|
|
97
|
+
╭──── joomha-CLI [graph] ────╮
|
|
98
|
+
│ │
|
|
99
|
+
│ Sistem autentikasi... │
|
|
100
|
+
│ │
|
|
101
|
+
╰─ Mode: graph │ Konteks: 3 │ Latency: 1.23s ─╯
|
|
102
|
+
|
|
103
|
+
[graph] ❯ /mode compare
|
|
104
|
+
✓ Mode diubah ke: compare
|
|
105
|
+
|
|
106
|
+
[compare] ❯ Jelaskan alur request handling
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### Re-indexing
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
joomha --reindex
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
## Evaluasi Riset
|
|
118
|
+
|
|
119
|
+
Joomha menyertakan evaluator untuk riset perbandingan retrieval:
|
|
120
|
+
|
|
121
|
+
1. Edit `test_questions.json` dengan 30 pertanyaan + ground truth
|
|
122
|
+
2. Jalankan evaluator:
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
python evaluate.py
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
3. Hasil tersimpan di `hasil_evaluasi.csv` dengan metrik:
|
|
129
|
+
- **Hit Rate** — Apakah file relevan ada di konteks?
|
|
130
|
+
- **MRR** — Posisi file relevan pertama
|
|
131
|
+
- **Latency** — Waktu total per query
|
|
132
|
+
|
|
133
|
+
---
|
|
134
|
+
|
|
135
|
+
## Arsitektur
|
|
136
|
+
|
|
137
|
+
```
|
|
138
|
+
Query ──┬── VectorRetriever ── LanceDB cosine search ── Top-5 chunks
|
|
139
|
+
│
|
|
140
|
+
└── GraphRetriever ── SQLite (AST nodes + edges + co-changes)
|
|
141
|
+
│
|
|
142
|
+
└── Fallback ke VectorRetriever jika kosong
|
|
143
|
+
│
|
|
144
|
+
▼
|
|
145
|
+
PromptBuilder (struktur IDENTIK)
|
|
146
|
+
│
|
|
147
|
+
▼
|
|
148
|
+
LLMClient (Gemini/OpenAI/Claude)
|
|
149
|
+
│
|
|
150
|
+
▼
|
|
151
|
+
Rich Markdown Output
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
---
|
|
155
|
+
|
|
156
|
+
## Struktur Proyek
|
|
157
|
+
|
|
158
|
+
```text
|
|
159
|
+
joomha/
|
|
160
|
+
├── joomha/
|
|
161
|
+
│ ├── cli.py # Entry point + REPL
|
|
162
|
+
│ ├── config.py # API key management
|
|
163
|
+
│ ├── orchestrator.py # RAG pipeline coordinator
|
|
164
|
+
│ ├── indexer/
|
|
165
|
+
│ │ ├── parsers/ # Multi-language AST Parsers
|
|
166
|
+
│ │ │ ├── base.py
|
|
167
|
+
│ │ │ ├── python_parser.py
|
|
168
|
+
│ │ │ ├── javascript_parser.py # Tree-sitter powered
|
|
169
|
+
│ │ │ └── typescript_parser.py # Tree-sitter powered
|
|
170
|
+
│ │ ├── ast_parser.py # Universal Parser Dispatcher → SQLite
|
|
171
|
+
│ │ ├── git_analyzer.py # Git history → SQLite
|
|
172
|
+
│ │ └── vector_builder.py # Multi-lang chunking → LanceDB
|
|
173
|
+
│ ├── retriever/
|
|
174
|
+
│ │ ├── vector.py # Cosine similarity retrieval
|
|
175
|
+
│ │ └── graph.py # Relational graph retrieval
|
|
176
|
+
│ ├── llm/
|
|
177
|
+
│ │ ├── client.py # Multi-provider LLM client
|
|
178
|
+
│ │ └── prompt_builder.py # Strict grounding & AI Persona prompt
|
|
179
|
+
│ └── ui/
|
|
180
|
+
│ ├── display.py # Rich panels & tables
|
|
181
|
+
│ └── input_handler.py # prompt-toolkit session
|
|
182
|
+
├── evaluate.py # Research evaluation script
|
|
183
|
+
├── test_questions.json # Evaluation dataset
|
|
184
|
+
├── pyproject.toml
|
|
185
|
+
└── README.md
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
---
|
|
189
|
+
|
|
190
|
+
## Stack Teknologi
|
|
191
|
+
|
|
192
|
+
| Layer | Library |
|
|
193
|
+
|-------|---------|
|
|
194
|
+
| CLI | typer, rich, prompt-toolkit |
|
|
195
|
+
| AST/Parser | tree-sitter (JS/TS), ast (Python stdlib) |
|
|
196
|
+
| Git | gitpython |
|
|
197
|
+
| Embedding | sentence-transformers (all-MiniLM-L6-v2) |
|
|
198
|
+
| Vector DB | lancedb + pyarrow |
|
|
199
|
+
| Graph DB | sqlite3 (stdlib) |
|
|
200
|
+
| LLM | google-generativeai (`gemini-flash-latest`) / openai / anthropic |
|
|
201
|
+
|
|
202
|
+
---
|
|
203
|
+
|
|
204
|
+
|