leindex 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.
- leindex-1.0.0/LICENSE +21 -0
- leindex-1.0.0/PKG-INFO +513 -0
- leindex-1.0.0/README.md +463 -0
- leindex-1.0.0/pyproject.toml +118 -0
- leindex-1.0.0/setup.cfg +4 -0
- leindex-1.0.0/src/leindex/__init__.py +6 -0
- leindex-1.0.0/src/leindex/__main__.py +6 -0
- leindex-1.0.0/src/leindex/api_key_manager.py +646 -0
- leindex-1.0.0/src/leindex/async_indexer.py +698 -0
- leindex-1.0.0/src/leindex/async_task_queue.py +895 -0
- leindex-1.0.0/src/leindex/cli.py +477 -0
- leindex-1.0.0/src/leindex/config_manager.py +457 -0
- leindex-1.0.0/src/leindex/constants.py +361 -0
- leindex-1.0.0/src/leindex/content_extractor.py +197 -0
- leindex-1.0.0/src/leindex/core_engine/__init__.py +28 -0
- leindex-1.0.0/src/leindex/core_engine/consolidated_tools.py +990 -0
- leindex-1.0.0/src/leindex/core_engine/engine.py +676 -0
- leindex-1.0.0/src/leindex/core_engine/interfaces.py +269 -0
- leindex-1.0.0/src/leindex/core_engine/leann_backend.py +3147 -0
- leindex-1.0.0/src/leindex/core_engine/leann_backend_enhanced.py +762 -0
- leindex-1.0.0/src/leindex/core_engine/local_vector_backend.py +1861 -0
- leindex-1.0.0/src/leindex/core_engine/logger_config.py +19 -0
- leindex-1.0.0/src/leindex/core_engine/test_engine.py +68 -0
- leindex-1.0.0/src/leindex/core_engine/test_local_vector_backend.py +243 -0
- leindex-1.0.0/src/leindex/core_engine/tool_routers.py +1409 -0
- leindex-1.0.0/src/leindex/core_engine/types.py +107 -0
- leindex-1.0.0/src/leindex/elasticsearch_config.py +275 -0
- leindex-1.0.0/src/leindex/elasticsearch_installer.py +527 -0
- leindex-1.0.0/src/leindex/error_handling.py +241 -0
- leindex-1.0.0/src/leindex/file_change_tracker.py +1029 -0
- leindex-1.0.0/src/leindex/file_reader.py +758 -0
- leindex-1.0.0/src/leindex/global_config_manager.py +64 -0
- leindex-1.0.0/src/leindex/ignore_patterns.py +248 -0
- leindex-1.0.0/src/leindex/incremental_indexer.py +579 -0
- leindex-1.0.0/src/leindex/lazy_loader.py +570 -0
- leindex-1.0.0/src/leindex/logger_config.py +77 -0
- leindex-1.0.0/src/leindex/lru_cache.py +375 -0
- leindex-1.0.0/src/leindex/memory_profiler.py +718 -0
- leindex-1.0.0/src/leindex/monitoring.py +131 -0
- leindex-1.0.0/src/leindex/optimized_project_settings.py +625 -0
- leindex-1.0.0/src/leindex/parallel_processor.py +264 -0
- leindex-1.0.0/src/leindex/performance_monitor.py +918 -0
- leindex-1.0.0/src/leindex/progress_tracker.py +561 -0
- leindex-1.0.0/src/leindex/project_settings.py +654 -0
- leindex-1.0.0/src/leindex/realtime_indexer.py +1368 -0
- leindex-1.0.0/src/leindex/registry/__init__.py +79 -0
- leindex-1.0.0/src/leindex/registry/backup_scheduler.py +255 -0
- leindex-1.0.0/src/leindex/registry/directories.py +229 -0
- leindex-1.0.0/src/leindex/registry/index_migrator.py +709 -0
- leindex-1.0.0/src/leindex/registry/msgpack_serializer.py +454 -0
- leindex-1.0.0/src/leindex/registry/orphan_detector.py +561 -0
- leindex-1.0.0/src/leindex/registry/project_registry.py +674 -0
- leindex-1.0.0/src/leindex/registry/registration_integrator.py +393 -0
- leindex-1.0.0/src/leindex/registry/registry_backup.py +812 -0
- leindex-1.0.0/src/leindex/registry/startup_migration.py +389 -0
- leindex-1.0.0/src/leindex/repositories/__init__.py +65 -0
- leindex-1.0.0/src/leindex/repositories/base.py +397 -0
- leindex-1.0.0/src/leindex/repositories/file_repository.py +435 -0
- leindex-1.0.0/src/leindex/repositories/index_repository.py +350 -0
- leindex-1.0.0/src/leindex/repositories/quality_metrics_repository.py +799 -0
- leindex-1.0.0/src/leindex/repositories/repository_factory.py +159 -0
- leindex-1.0.0/src/leindex/repositories/search_repository.py +338 -0
- leindex-1.0.0/src/leindex/retry.py +382 -0
- leindex-1.0.0/src/leindex/search/__init__.py +21 -0
- leindex-1.0.0/src/leindex/search/ag.py +89 -0
- leindex-1.0.0/src/leindex/search/async_search.py +390 -0
- leindex-1.0.0/src/leindex/search/base.py +303 -0
- leindex-1.0.0/src/leindex/search/basic.py +123 -0
- leindex-1.0.0/src/leindex/search/grep.py +90 -0
- leindex-1.0.0/src/leindex/search/ranking.py +572 -0
- leindex-1.0.0/src/leindex/search/result_merger.py +711 -0
- leindex-1.0.0/src/leindex/search/ripgrep.py +83 -0
- leindex-1.0.0/src/leindex/search/ugrep.py +80 -0
- leindex-1.0.0/src/leindex/search/zoekt.py +978 -0
- leindex-1.0.0/src/leindex/search_utils.py +834 -0
- leindex-1.0.0/src/leindex/server.py +7841 -0
- leindex-1.0.0/src/leindex/stats_dashboard.py +520 -0
- leindex-1.0.0/src/leindex/storage/__init__.py +12 -0
- leindex-1.0.0/src/leindex/storage/dal_factory.py +715 -0
- leindex-1.0.0/src/leindex/storage/duckdb_storage.py +753 -0
- leindex-1.0.0/src/leindex/storage/elasticsearch_storage.py +831 -0
- leindex-1.0.0/src/leindex/storage/postgresql_storage.py +929 -0
- leindex-1.0.0/src/leindex/storage/sqlite_storage.py +1260 -0
- leindex-1.0.0/src/leindex/storage/storage_interface.py +728 -0
- leindex-1.0.0/src/leindex/storage/tantivy_storage.py +1200 -0
- leindex-1.0.0/src/leindex/storage/trie_index.py +166 -0
- leindex-1.0.0/src/leindex/system_utils.py +681 -0
- leindex-1.0.0/src/leindex/tantivy_config.py +258 -0
- leindex-1.0.0/src/leindex.egg-info/PKG-INFO +513 -0
- leindex-1.0.0/src/leindex.egg-info/SOURCES.txt +94 -0
- leindex-1.0.0/src/leindex.egg-info/dependency_links.txt +1 -0
- leindex-1.0.0/src/leindex.egg-info/entry_points.txt +3 -0
- leindex-1.0.0/src/leindex.egg-info/requires.txt +39 -0
- leindex-1.0.0/src/leindex.egg-info/top_level.txt +2 -0
- leindex-1.0.0/src/scripts/etl_script.py +559 -0
- leindex-1.0.0/src/scripts/install_agent.py +78 -0
leindex-1.0.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 scooter-lacroix
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
leindex-1.0.0/PKG-INFO
ADDED
|
@@ -0,0 +1,513 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: leindex
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: LeIndex: AI-powered code search and indexing system with MCP integration
|
|
5
|
+
Author: scooter-lacroix
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/scooter-lacroix/leindex
|
|
8
|
+
Project-URL: Bug Tracker, https://github.com/scooter-lacroix/leindex/issues
|
|
9
|
+
Requires-Python: <3.14,>=3.10
|
|
10
|
+
Description-Content-Type: text/markdown
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Requires-Dist: aiofiles>=23.2.1
|
|
13
|
+
Requires-Dist: aiohttp>=3.9.0
|
|
14
|
+
Requires-Dist: mcp>=0.3.0
|
|
15
|
+
Requires-Dist: pdfminer-six>=20250506
|
|
16
|
+
Requires-Dist: psutil>=7.0.0
|
|
17
|
+
Requires-Dist: pytest>=8.4.1
|
|
18
|
+
Requires-Dist: python-docx>=1.2.0
|
|
19
|
+
Requires-Dist: python-json-logger>=2.0.0
|
|
20
|
+
Requires-Dist: pyyaml>=6.0.0
|
|
21
|
+
Requires-Dist: lxml>=6.0.0
|
|
22
|
+
Requires-Dist: duckdb>=1.0.0
|
|
23
|
+
Requires-Dist: cffi>=1.17.0
|
|
24
|
+
Requires-Dist: cryptography>=45.0.0
|
|
25
|
+
Requires-Dist: pycparser>=2.22
|
|
26
|
+
Requires-Dist: six>=1.17.0
|
|
27
|
+
Requires-Dist: python-dateutil>=2.9.0
|
|
28
|
+
Requires-Dist: urllib3>=2.5.0
|
|
29
|
+
Requires-Dist: tantivy>=0.20.0
|
|
30
|
+
Requires-Dist: greenlet>=3.2.0
|
|
31
|
+
Requires-Dist: mako>=1.3.0
|
|
32
|
+
Requires-Dist: markupsafe>=3.0.0
|
|
33
|
+
Requires-Dist: httpx>=0.28.1
|
|
34
|
+
Requires-Dist: leann<0.4.0,>=0.3.5
|
|
35
|
+
Requires-Dist: sentence-transformers>=2.2.0
|
|
36
|
+
Requires-Dist: einops>=0.6.0
|
|
37
|
+
Requires-Dist: torch>=2.0.0
|
|
38
|
+
Requires-Dist: numpy>=1.24.0
|
|
39
|
+
Requires-Dist: pytest-asyncio>=1.3.0
|
|
40
|
+
Requires-Dist: msgpack>=1.0.0
|
|
41
|
+
Provides-Extra: postgresql
|
|
42
|
+
Requires-Dist: sqlalchemy>=2.0.0; extra == "postgresql"
|
|
43
|
+
Requires-Dist: alembic>=1.16.4; extra == "postgresql"
|
|
44
|
+
Requires-Dist: psycopg2-binary>=2.9.10; extra == "postgresql"
|
|
45
|
+
Requires-Dist: elasticsearch<9.0.0,>=8.0.0; extra == "postgresql"
|
|
46
|
+
Requires-Dist: elastic-transport>=8.17.0; extra == "postgresql"
|
|
47
|
+
Provides-Extra: all
|
|
48
|
+
Requires-Dist: leindex[postgresql]; extra == "all"
|
|
49
|
+
Dynamic: license-file
|
|
50
|
+
|
|
51
|
+
# LeIndex
|
|
52
|
+
|
|
53
|
+
<div align="center">
|
|
54
|
+
|
|
55
|
+
[](https://modelcontextprotocol.io)
|
|
56
|
+
[](https://www.python.org/)
|
|
57
|
+
[](LICENSE)
|
|
58
|
+
[](CHANGELOG.md)
|
|
59
|
+
|
|
60
|
+
**AI-Powered Code Search That Actually Understands Your Code**
|
|
61
|
+
|
|
62
|
+
*Lightning-fast semantic code search with zero dependencies. Find code by meaning, not just by matching text.*
|
|
63
|
+
|
|
64
|
+
</div>
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
<div align="center">
|
|
69
|
+
|
|
70
|
+
<img src="leindex.jpeg" alt="LeIndex Architecture" width="800">
|
|
71
|
+
|
|
72
|
+
*The LeIndex experience - powerful, fast, and beautiful*
|
|
73
|
+
|
|
74
|
+
</div>
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## โจ What Makes LeIndex Special?
|
|
79
|
+
|
|
80
|
+
**LeIndex** isn't just another code search tool. It's your intelligent code companion that understands **what** you're looking for, not just **where** it might be typed.
|
|
81
|
+
|
|
82
|
+
Imagine searching for "authentication flow" and finding not just files containing those words, but the actual authentication logic, login handlers, session management, and security patterns - even if they're named completely differently. That's the magic of semantic search! ๐ฏ
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## ๐ Quick Start (You'll Be Searching in Under 2 Minutes. It's Easier Than Making Coffee!)
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
## One-Click Installation
|
|
90
|
+
|
|
91
|
+
**The easiest way to get started:**
|
|
92
|
+
|
|
93
|
+
### Requirements
|
|
94
|
+
- Python 3.10 or higher
|
|
95
|
+
- 4GB RAM minimum (8GB+ for large codebases)
|
|
96
|
+
- About 1GB disk space
|
|
97
|
+
|
|
98
|
+
**Linux/Unix:**
|
|
99
|
+
```bash
|
|
100
|
+
curl -sSL https://raw.githubusercontent.com/scooter-lacroix/LeIndex/master/install.sh | bash
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
**macOS:**
|
|
104
|
+
```bash
|
|
105
|
+
curl -sSL https://raw.githubusercontent.com/scooter-lacroix/LeIndex/master/install_macos.sh | bash
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
**Windows:**
|
|
109
|
+
```powershell
|
|
110
|
+
irm https://raw.githubusercontent.com/scooter-lacroix/LeIndex/master/install.ps1 | iex
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
That's it. The installer will:
|
|
114
|
+
- โ
Install LeIndex MCP server
|
|
115
|
+
- โ
Detect your AI tools (Claude Code, Cursor, etc.)
|
|
116
|
+
- โ
Configure integrations automatically
|
|
117
|
+
- โ
Install optional skills for enhanced workflows
|
|
118
|
+
|
|
119
|
+
**Manual installation?** See below โ
|
|
120
|
+
|
|
121
|
+
---
|
|
122
|
+
|
|
123
|
+
```bash
|
|
124
|
+
# Install LeIndex - seriously, that's it
|
|
125
|
+
pip install leindex
|
|
126
|
+
|
|
127
|
+
# Index your codebase (no Docker, no databases, no headache)
|
|
128
|
+
leindex init /path/to/your/project
|
|
129
|
+
leindex index /path/to/your/project
|
|
130
|
+
|
|
131
|
+
# Search like a wizard
|
|
132
|
+
leindex-search "authentication logic"
|
|
133
|
+
|
|
134
|
+
# Or use it via MCP in Claude, Cursor, or your favorite AI assistant
|
|
135
|
+
# LeIndex MCP server does the heavy lifting automatically!
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
OR
|
|
139
|
+
|
|
140
|
+
### PIP Install
|
|
141
|
+
|
|
142
|
+
```bash
|
|
143
|
+
pip install leindex
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
**That's literally it.** No Docker. No databases. No configuration files (unless you want them). Just works. โจ
|
|
147
|
+
|
|
148
|
+
### Verify It's Alive
|
|
149
|
+
|
|
150
|
+
```bash
|
|
151
|
+
leindex --version
|
|
152
|
+
# Output: LeIndex 2.0.2 - Ready to search! ๐
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
### Install from Source (For the Adventurous)
|
|
156
|
+
|
|
157
|
+
```bash
|
|
158
|
+
git clone https://github.com/scooter-lacroix/leindex.git
|
|
159
|
+
cd leindex
|
|
160
|
+
pip install -e .
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
**Boom!** You're now searching your codebase at the speed of thought. ๐
|
|
164
|
+
|
|
165
|
+
---
|
|
166
|
+
|
|
167
|
+
## ๐ฏ Why Developers Love LeIndex
|
|
168
|
+
|
|
169
|
+
### ๐ฅ Zero Dependencies, Zero Drama
|
|
170
|
+
- **No Docker** - Your laptop will thank you
|
|
171
|
+
- **No PostgreSQL** - No database setup nightmares
|
|
172
|
+
- **No Elasticsearch** - No Java memory leaks
|
|
173
|
+
- **No RabbitMQ** - No message queue complexity
|
|
174
|
+
- **Just pure Python magic** - `pip install` and you're done
|
|
175
|
+
|
|
176
|
+
### โก Blazing Fast Performance
|
|
177
|
+
- **LEANN vector search** - Find similar code in milliseconds
|
|
178
|
+
- **Tantivy full-text search** - Rust-powered Lucene goodness
|
|
179
|
+
- **Hybrid scoring** - Best of both worlds: semantic + lexical
|
|
180
|
+
- **Handles 100K+ files** - Scale from side projects to monorepos
|
|
181
|
+
|
|
182
|
+
### ๐ง Semantic Understanding
|
|
183
|
+
- **CodeRankEmbed embeddings** - Understands code meaning and intent
|
|
184
|
+
- **Finds by concept** - Search "error handling" and find try/except, error types, logging, and recovery patterns
|
|
185
|
+
- **Smart symbol search** - Jump to definitions and references instantly
|
|
186
|
+
- **Regex power** - For when you need precise pattern matching
|
|
187
|
+
|
|
188
|
+
### ๐ Privacy-First & Self-Hosted
|
|
189
|
+
- **Your code stays yours** - Nothing leaves your machine
|
|
190
|
+
- **Works offline** - No internet required after installation
|
|
191
|
+
- **No telemetry** - We don't track your searches
|
|
192
|
+
- **Enterprise-ready** - Deploy on your own infrastructure
|
|
193
|
+
|
|
194
|
+
### ๐ค MCP-Native Design
|
|
195
|
+
- **First-class MCP support** - Built from the ground up for Model Context Protocol
|
|
196
|
+
- **AI assistant ready** - Works seamlessly with Claude, Cursor, Windsurf, and more
|
|
197
|
+
- **Token efficient** - Saves ~200 tokens per session (no hook overhead!)
|
|
198
|
+
- **Optional skill integration** - For complex multi-project workflows
|
|
199
|
+
|
|
200
|
+
---
|
|
201
|
+
|
|
202
|
+
## ๐ช The LeIndex Magic Show
|
|
203
|
+
|
|
204
|
+
### ๐ Search That Reads Your Mind
|
|
205
|
+
|
|
206
|
+
```python
|
|
207
|
+
# Search semantically
|
|
208
|
+
results = indexer.search("authentication flow")
|
|
209
|
+
|
|
210
|
+
# Get results that actually make sense:
|
|
211
|
+
# - Login handlers (even if named 'sign_in')
|
|
212
|
+
# - Session management (even if called 'user_state')
|
|
213
|
+
# - JWT verification (even if labeled 'token_check')
|
|
214
|
+
# - Password hashing (even if in 'crypto_utils')
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
### ๐ The Secret Sauce (Technology Stack)
|
|
218
|
+
|
|
219
|
+
| Component | Technology | Superpower |
|
|
220
|
+
|-----------|------------|------------|
|
|
221
|
+
| **Vector Search** | [LEANN](https://github.com/lerp-cli/leann) | Storage-efficient semantic similarity |
|
|
222
|
+
| **Code Brain** | [CodeRankEmbed](https://huggingface.co/nomic-ai/CodeRankEmbed) | Understands code meaning & intent |
|
|
223
|
+
| **Text Search** | [Tantivy](https://github.com/quickwit-oss/tantivy-py) | Rust-powered Lucene (fast!) |
|
|
224
|
+
| **Metadata** | [SQLite](https://www.sqlite.org/) | Reliable ACID-compliant storage |
|
|
225
|
+
| **Analytics** | [DuckDB](https://duckdb.org/) | In-memory analytical queries |
|
|
226
|
+
| **Async Engine** | asyncio | Built-in Python async (no RabbitMQ needed!) |
|
|
227
|
+
|
|
228
|
+
### ๐๏ธ Architecture That Makes Sense
|
|
229
|
+
|
|
230
|
+
```
|
|
231
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
232
|
+
โ The LeIndex Experience โ
|
|
233
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
|
|
234
|
+
โ โ
|
|
235
|
+
โ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโ โ
|
|
236
|
+
โ โ MCP Server โโโโถโ Core Engine โโโโถโ LEANN โ โ
|
|
237
|
+
โ โ (Your AI โ โ (The Brains)โ โ (Vectors) โ โ
|
|
238
|
+
โ โ Assistant) โ โ โ โ โ โ
|
|
239
|
+
โ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโ โ
|
|
240
|
+
โ โ โ โ โ
|
|
241
|
+
โ โ โผ โผ โ
|
|
242
|
+
โ โ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโ โ
|
|
243
|
+
โ โ โ Query Router โโโโถโ Tantivy โ โ
|
|
244
|
+
โ โ โ (Traffic โ โ(Full-Text)โ โ
|
|
245
|
+
โ โ โ Cop) โ โ โ โ
|
|
246
|
+
โ โ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโ โ
|
|
247
|
+
โ โ โ โ โ
|
|
248
|
+
โ โผ โผ โผ โ
|
|
249
|
+
โ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโ โ
|
|
250
|
+
โ โ CLI Tools โ โ Data Access โ โ SQLite โ โ
|
|
251
|
+
โ โ (Power User) โ โ Layer โ โ (Metadata)โ โ
|
|
252
|
+
โ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโ โ
|
|
253
|
+
โ โ โ
|
|
254
|
+
โ โผ โ
|
|
255
|
+
โ โโโโโโโโโโโโโโโโ โ
|
|
256
|
+
โ โ DuckDB โ โ
|
|
257
|
+
โ โ (Analytics) โ โ
|
|
258
|
+
โ โโโโโโโโโโโโโโโโ โ
|
|
259
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
260
|
+
|
|
261
|
+
๐ก Everything runs locally. No cloud. No dependencies. Just speed.
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
|
|
265
|
+
## ๐ฏ Usage: Let's Search Some Code!
|
|
266
|
+
|
|
267
|
+
### ๐ค MCP Integration (The Cool Way)
|
|
268
|
+
|
|
269
|
+
LeIndex comes with a built-in MCP server that makes your AI assistant code-aware:
|
|
270
|
+
|
|
271
|
+
**Available MCP Superpowers:**
|
|
272
|
+
- `manage_project` - Set up and manage indexing for your projects
|
|
273
|
+
- `search_content` - Search code with semantic + full-text powers
|
|
274
|
+
- `get_diagnostics` - Get project stats and health checks
|
|
275
|
+
|
|
276
|
+
**Configuration in your MCP client (Claude, Cursor, etc.):**
|
|
277
|
+
|
|
278
|
+
```json
|
|
279
|
+
{
|
|
280
|
+
"mcpServers": {
|
|
281
|
+
"leindex": {
|
|
282
|
+
"command": "leindex",
|
|
283
|
+
"args": ["mcp"],
|
|
284
|
+
"env": {}
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
**Start the MCP server:**
|
|
291
|
+
```bash
|
|
292
|
+
leindex mcp
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
Now your AI assistant can search your codebase like a pro! ๐
|
|
296
|
+
|
|
297
|
+
**When to use what:**
|
|
298
|
+
|
|
299
|
+
| Approach | Best For |
|
|
300
|
+
|----------|----------|
|
|
301
|
+
| **MCP Tools** | Single-project searches, simple queries, direct API access |
|
|
302
|
+
| **Skills** | Multi-project operations, complex workflows, automated pipelines |
|
|
303
|
+
|
|
304
|
+
### ๐ Python API (For the Coders)
|
|
305
|
+
|
|
306
|
+
```python
|
|
307
|
+
from leindex import LeIndex
|
|
308
|
+
|
|
309
|
+
# Initialize and index
|
|
310
|
+
indexer = LeIndex("~/my-awesome-project")
|
|
311
|
+
indexer.index()
|
|
312
|
+
|
|
313
|
+
# Search semantically - it understands meaning!
|
|
314
|
+
results = indexer.search("authentication flow")
|
|
315
|
+
|
|
316
|
+
# Filter like a boss
|
|
317
|
+
results = indexer.search(
|
|
318
|
+
query="database connection",
|
|
319
|
+
file_patterns=["*.py"], # Only Python files
|
|
320
|
+
exclude_patterns=["test_*.py"] # But not tests
|
|
321
|
+
)
|
|
322
|
+
|
|
323
|
+
# Access the good stuff
|
|
324
|
+
for result in results:
|
|
325
|
+
print(f"{result.file}:{result.line}")
|
|
326
|
+
print(result.content)
|
|
327
|
+
print(f"Relevance Score: {result.score}")
|
|
328
|
+
```
|
|
329
|
+
|
|
330
|
+
### ๐ง CLI Tools (For the Terminal Lovers)
|
|
331
|
+
|
|
332
|
+
```bash
|
|
333
|
+
# Initialize indexing for a project
|
|
334
|
+
leindex init /path/to/project
|
|
335
|
+
|
|
336
|
+
# Run the indexing (it's fast, we promise)
|
|
337
|
+
leindex index /path/to/project
|
|
338
|
+
|
|
339
|
+
# Search from terminal
|
|
340
|
+
leindex-search "authentication logic"
|
|
341
|
+
|
|
342
|
+
# Search with filters
|
|
343
|
+
leindex-search "database" --ext py --exclude test_*
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
---
|
|
347
|
+
|
|
348
|
+
## โ๏ธ Configuration (Optional but Powerful)
|
|
349
|
+
|
|
350
|
+
LeIndex works great out of the box, but you can tweak it to your heart's content with `config.yaml`:
|
|
351
|
+
|
|
352
|
+
```yaml
|
|
353
|
+
# Data Access Layer (The Engine Room)
|
|
354
|
+
dal_settings:
|
|
355
|
+
backend_type: "sqlite_duckdb" # The good stuff
|
|
356
|
+
db_path: "./data/leindex.db" # Where metadata lives
|
|
357
|
+
duckdb_db_path: "./data/leindex.db.duckdb" # Analytics heaven
|
|
358
|
+
|
|
359
|
+
# Vector Store (Semantic Search Magic)
|
|
360
|
+
vector_store:
|
|
361
|
+
backend_type: "leann" # Storage-efficient vectors
|
|
362
|
+
index_path: "./leann_index" # Where vectors chill
|
|
363
|
+
embedding_model: "nomic-ai/CodeRankEmbed" # Code brain
|
|
364
|
+
embedding_dim: 768 # Vector dimensions
|
|
365
|
+
|
|
366
|
+
# Async Processing (Speed Demon)
|
|
367
|
+
async_processing:
|
|
368
|
+
enabled: true
|
|
369
|
+
worker_count: 4 # Parallel indexing
|
|
370
|
+
max_queue_size: 10000 # Queue buffer
|
|
371
|
+
|
|
372
|
+
# File Filtering (Keep It Lean)
|
|
373
|
+
file_filtering:
|
|
374
|
+
max_file_size: 1073741824 # 1GB per file
|
|
375
|
+
type_specific_limits:
|
|
376
|
+
".py": 1073741824 # Python files up to 1GB
|
|
377
|
+
".json": 104857600 # JSON files up to 100MB
|
|
378
|
+
|
|
379
|
+
# Directory Filtering (Ignore the Junk)
|
|
380
|
+
directory_filtering:
|
|
381
|
+
skip_large_directories:
|
|
382
|
+
- "**/node_modules/**" # No JavaScript dependency hell
|
|
383
|
+
- "**/.git/**" # No git history
|
|
384
|
+
- "**/venv/**" # No virtual environments
|
|
385
|
+
- "**/__pycache__/**" # No Python cache
|
|
386
|
+
```
|
|
387
|
+
|
|
388
|
+
---
|
|
389
|
+
|
|
390
|
+
## ๐ Performance Stats (We're Not Slow)
|
|
391
|
+
|
|
392
|
+
| Metric | LeIndex | Typical Code Search | Difference |
|
|
393
|
+
|--------|---------|-------------------|-------------|
|
|
394
|
+
| **Indexing Speed** | ~10K files/min | ~500 files/min | **20x faster** |
|
|
395
|
+
| **Search Latency (p50)** | ~50ms | ~500ms | **10x faster** |
|
|
396
|
+
| **Search Latency (p99)** | ~200ms | ~5s | **25x faster** |
|
|
397
|
+
| **Max Scalability** | 100K+ files | 10K files | **10x more** |
|
|
398
|
+
| **Memory Usage** | <4GB | >8GB | **2x less** |
|
|
399
|
+
|
|
400
|
+
*Benchmarks on 100K file Python codebase, standard hardware. Your mileage may vary, but it'll still be fast!*
|
|
401
|
+
|
|
402
|
+
---
|
|
403
|
+
|
|
404
|
+
## ๐ The Evolution: Of LeIndex
|
|
405
|
+
|
|
406
|
+
LeIndex is a complete reimagining the code indexing experience:
|
|
407
|
+
|
|
408
|
+
- โ
**CLI streamlined** - Simple `leindex` commands
|
|
409
|
+
- โ
**Environment unified** - `LEINDEX_*` environment variables
|
|
410
|
+
- โ
**Revolutionary stack** - No external dependencies
|
|
411
|
+
- โ
**Lightweight architecture** - Pure Python with LEANN + Tantivy + SQLite + DuckDB
|
|
412
|
+
|
|
413
|
+
**What we gained:**
|
|
414
|
+
- โ
Simplicity
|
|
415
|
+
- โ
Speed
|
|
416
|
+
- โ
Token efficiency (~200 tokens/session saved)
|
|
417
|
+
- โ
Pure MCP architecture
|
|
418
|
+
- โ
Developer happiness
|
|
419
|
+
|
|
420
|
+
---
|
|
421
|
+
|
|
422
|
+
## ๐ Documentation That Doesn't Suck
|
|
423
|
+
|
|
424
|
+
- [Installation Guide](INSTALLATION.md) - Detailed setup instructions
|
|
425
|
+
- [MCP Configuration](MCP_CONFIGURATION.md) - MCP server setup and examples
|
|
426
|
+
- [Architecture Deep Dive](ARCHITECTURE.md) - System design and internals
|
|
427
|
+
- [API Reference](API.md) - Complete API documentation
|
|
428
|
+
- [Migration Guide](MIGRATION.md) - Upgrading from code-indexer
|
|
429
|
+
- [Contributing](CONTRIBUTING.md) - Join the fun!
|
|
430
|
+
|
|
431
|
+
---
|
|
432
|
+
|
|
433
|
+
## ๐งช Development (For the Curious)
|
|
434
|
+
|
|
435
|
+
### Project Structure
|
|
436
|
+
|
|
437
|
+
```
|
|
438
|
+
leindex/
|
|
439
|
+
โโโ src/leindex/ # The magic happens here
|
|
440
|
+
โ โโโ dal/ # Data Access Layer
|
|
441
|
+
โ โโโ storage/ # Storage backends
|
|
442
|
+
โ โโโ search/ # Search engines
|
|
443
|
+
โ โโโ core_engine/ # Core indexing & search
|
|
444
|
+
โ โโโ config_manager.py # Config wizardry
|
|
445
|
+
โ โโโ project_settings.py # Project settings
|
|
446
|
+
โ โโโ constants.py # Shared constants
|
|
447
|
+
โ โโโ server.py # MCP server
|
|
448
|
+
โโโ tests/ # Test suite
|
|
449
|
+
โโโ config.yaml # Configuration
|
|
450
|
+
โโโ pyproject.toml # Project metadata
|
|
451
|
+
```
|
|
452
|
+
|
|
453
|
+
### Running Tests
|
|
454
|
+
|
|
455
|
+
```bash
|
|
456
|
+
# Install dev dependencies
|
|
457
|
+
pip install -e ".[dev]"
|
|
458
|
+
|
|
459
|
+
# Run tests
|
|
460
|
+
pytest tests/
|
|
461
|
+
|
|
462
|
+
# Run with coverage (because we care)
|
|
463
|
+
pytest --cov=leindex tests/
|
|
464
|
+
```
|
|
465
|
+
|
|
466
|
+
---
|
|
467
|
+
|
|
468
|
+
## ๐ค Contributing (Join the Party!)
|
|
469
|
+
|
|
470
|
+
We love contributions! Whether it's bug fixes, new features, documentation improvements, or just spreading the word - it's all appreciated.
|
|
471
|
+
|
|
472
|
+
Please see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines. We promise we're friendly! ๐
|
|
473
|
+
|
|
474
|
+
---
|
|
475
|
+
|
|
476
|
+
## ๐ License
|
|
477
|
+
|
|
478
|
+
MIT License - see [LICENSE](LICENSE) for details. Use it anywhere, modify it, share it. Go wild!
|
|
479
|
+
|
|
480
|
+
---
|
|
481
|
+
|
|
482
|
+
## ๐ Acknowledgments (Standing on Giants)
|
|
483
|
+
|
|
484
|
+
LeIndex is built on amazing open-source projects:
|
|
485
|
+
|
|
486
|
+
- [LEANN](https://github.com/lerp-cli/leann) - Storage-efficient vector search
|
|
487
|
+
- [Tantivy](https://github.com/quickwit-oss/tantivy-py) - Pure Python full-text search (Rust Lucene)
|
|
488
|
+
- [DuckDB](https://duckdb.org/) - Fast analytical database
|
|
489
|
+
- [SQLite](https://www.sqlite.org/) - Embedded relational database
|
|
490
|
+
- [CodeRankEmbed](https://huggingface.co/nomic-ai/CodeRankEmbed) - Code embeddings
|
|
491
|
+
- [Model Context Protocol](https://modelcontextprotocol.io) - AI integration
|
|
492
|
+
|
|
493
|
+
**Massive thanks to all the contributors!** ๐
|
|
494
|
+
|
|
495
|
+
---
|
|
496
|
+
|
|
497
|
+
## ๐ฌ Support & Community
|
|
498
|
+
|
|
499
|
+
- **GitHub Issues:** [https://github.com/scooter-lacroix/leindex/issues](https://github.com/scooter-lacroix/leindex/issues)
|
|
500
|
+
- **Documentation:** [https://github.com/scooter-lacroix/leindex](https://github.com/scooter-lacroix/leindex)
|
|
501
|
+
- **Star us on GitHub** - It helps more people discover LeIndex! โญ
|
|
502
|
+
|
|
503
|
+
---
|
|
504
|
+
|
|
505
|
+
<div align="center">
|
|
506
|
+
|
|
507
|
+
**Built with โค๏ธ for developers who love their code**
|
|
508
|
+
|
|
509
|
+
*โญ Star us on GitHub โ it makes us smile!*
|
|
510
|
+
|
|
511
|
+
**Ready to search smarter?** [Install LeIndex now](#-installation-easier-than-making-coffee) ๐
|
|
512
|
+
|
|
513
|
+
</div>
|