endee-llamaindex 0.1.3__py3-none-any.whl → 0.1.5__py3-none-any.whl

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: endee-llamaindex
3
- Version: 0.1.3
3
+ Version: 0.1.5
4
4
  Summary: Vector Database for Fast ANN Searches
5
5
  Home-page: https://endee.io
6
6
  Author: Endee Labs
@@ -11,13 +11,17 @@ Classifier: Operating System :: OS Independent
11
11
  Requires-Python: >=3.6
12
12
  Description-Content-Type: text/markdown
13
13
  Requires-Dist: llama-index>=0.12.34
14
- Requires-Dist: endee>=0.1.4
14
+ Requires-Dist: endee==0.1.9
15
+ Requires-Dist: fastembed>=0.3.0
16
+ Provides-Extra: gpu
17
+ Requires-Dist: fastembed-gpu>=0.3.0; extra == "gpu"
15
18
  Dynamic: author
16
19
  Dynamic: author-email
17
20
  Dynamic: classifier
18
21
  Dynamic: description
19
22
  Dynamic: description-content-type
20
23
  Dynamic: home-page
24
+ Dynamic: provides-extra
21
25
  Dynamic: requires-dist
22
26
  Dynamic: requires-python
23
27
  Dynamic: summary
@@ -31,18 +35,19 @@ Build powerful RAG applications with Endee vector database and LlamaIndex.
31
35
  ## Table of Contents
32
36
 
33
37
  1. [Installation](#1-installation)
34
- 2. [Setting up Credentials](#2-setting-up-endee-and-openai-credentials)
35
- 3. [Creating Sample Documents](#3-creating-sample-documents)
36
- 4. [Setting up Endee with LlamaIndex](#4-setting-up-endee-with-llamaindex)
37
- 5. [Creating a Vector Index](#5-creating-a-vector-index-from-documents)
38
- 6. [Basic Retrieval](#6-basic-retrieval-with-query-engine)
39
- 7. [Using Metadata Filters](#7-using-metadata-filters)
40
- 8. [Advanced Filtering](#8-advanced-filtering-with-multiple-conditions)
41
- 9. [Custom Retriever Setup](#9-custom-retriever-setup)
42
- 10. [Custom Retriever with Query Engine](#10-using-a-custom-retriever-with-a-query-engine)
43
- 11. [Direct VectorStore Querying](#11-direct-vectorstore-querying)
44
- 12. [Saving and Loading Indexes](#12-saving-and-loading-indexes)
45
- 13. [Cleanup](#13-cleanup)
38
+ 2. [Testing locally](#testing-locally)
39
+ 3. [Setting up Credentials](#2-setting-up-endee-and-openai-credentials)
40
+ 4. [Creating Sample Documents](#3-creating-sample-documents)
41
+ 5. [Setting up Endee with LlamaIndex](#4-setting-up-endee-with-llamaindex)
42
+ 6. [Creating a Vector Index](#5-creating-a-vector-index-from-documents)
43
+ 7. [Basic Retrieval](#6-basic-retrieval-with-query-engine)
44
+ 8. [Using Metadata Filters](#7-using-metadata-filters)
45
+ 9. [Advanced Filtering](#8-advanced-filtering-with-multiple-conditions)
46
+ 10. [Custom Retriever Setup](#9-custom-retriever-setup)
47
+ 11. [Custom Retriever with Query Engine](#10-using-a-custom-retriever-with-a-query-engine)
48
+ 12. [Direct VectorStore Querying](#11-direct-vectorstore-querying)
49
+ 13. [Saving and Loading Indexes](#12-saving-and-loading-indexes)
50
+ 14. [Cleanup](#13-cleanup)
46
51
 
47
52
  ---
48
53
 
@@ -50,12 +55,66 @@ Build powerful RAG applications with Endee vector database and LlamaIndex.
50
55
 
51
56
  Get started by installing the required package.
52
57
 
58
+ ### Basic Installation (Dense-only search)
59
+
53
60
  ```bash
54
61
  pip install endee-llamaindex
55
62
  ```
56
63
 
57
64
  > **Note:** This will automatically install `endee` and `llama-index` as dependencies.
58
65
 
66
+ ### Full Installation (with Hybrid Search support)
67
+
68
+ For hybrid search capabilities (dense + sparse vectors), install with the `hybrid` extra:
69
+
70
+ ```bash
71
+ pip install endee-llamaindex[hybrid]
72
+ ```
73
+
74
+ This includes FastEmbed for sparse vector encoding (SPLADE, BM25, etc.).
75
+
76
+ ### GPU-Accelerated Hybrid Search
77
+
78
+ For GPU-accelerated sparse encoding:
79
+
80
+ ```bash
81
+ pip install endee-llamaindex[hybrid-gpu]
82
+ ```
83
+
84
+ ### All Features
85
+
86
+ To install all optional dependencies:
87
+
88
+ ```bash
89
+ pip install endee-llamaindex[all]
90
+ ```
91
+
92
+ ### Installation Options Summary
93
+
94
+ | Installation | Use Case | Includes |
95
+ |--------------|----------|----------|
96
+ | `pip install endee-llamaindex` | Dense vector search only | Core dependencies |
97
+ | `pip install endee-llamaindex[hybrid]` | Dense + sparse hybrid search | + FastEmbed (CPU) |
98
+ | `pip install endee-llamaindex[hybrid-gpu]` | GPU-accelerated hybrid search | + FastEmbed (GPU) |
99
+ | `pip install endee-llamaindex[all]` | All features | All optional deps |
100
+
101
+ ---
102
+
103
+ ## Testing locally
104
+
105
+ From the project root:
106
+
107
+ ```bash
108
+ python -m venv env && source env/bin/activate # optional
109
+ pip install -e .
110
+ pip install pytest sentence-transformers huggingface-hub
111
+ export ENDEE_API_TOKEN="your-endee-api-token" # or set in endee_llamaindex/test_cases/setup_class.py
112
+
113
+ cd endee_llamaindex/test_cases && PYTHONPATH=.. python -m pytest . -v
114
+ ```
115
+
116
+ See [TESTING.md](TESTING.md) for more options and single-test runs.
117
+
59
118
  ---
60
119
 
61
120
  ## 2. Setting up Endee and OpenAI credentials
@@ -145,7 +204,7 @@ vector_store = EndeeVectorStore.from_params(
145
204
  index_name=index_name,
146
205
  dimension=dimension,
147
206
  space_type="cosine", # Can be "cosine", "l2", or "ip"
148
- precision="medium" # Index precision: "low", "medium", "high", or None
207
+ precision="float16" # Options: "binary", "float16", "float32", "int16d", "int8d" (default: "float16")
149
208
  )
150
209
 
151
210
  # Create storage context with our vector store
@@ -160,9 +219,37 @@ print(f"Initialized Endee vector store with index: {index_name}")
160
219
  |-----------|-------------|---------|
161
220
  | `space_type` | Distance metric for similarity | `cosine`, `l2`, `ip` |
162
221
  | `dimension` | Vector dimension | Must match embedding model |
163
- | `precision` | Index precision setting | `"low"`, `"medium"` (default), `"high"`, or `None` |
164
- | `key` | Encryption key for metadata | 256-bit hex key (64 hex characters) |
222
+ | `precision` | Index precision setting | `"binary"`, `"float16"` (default), `"float32"`, `"int16d"`, `"int8d"` |
165
223
  | `batch_size` | Vectors per API call | Default: `100` |
224
+ | `hybrid` | Enable hybrid search (dense + sparse) | Default: `False` |
225
+ | `M` | Optional HNSW M parameter (bi-directional links) | Optional (backend default if not specified) |
226
+ | `ef_con` | Optional HNSW ef_construction parameter | Optional (backend default if not specified) |
227
+
228
+ ### Hybrid Search and Sparse Models
229
+
230
+ When you enable hybrid search by providing a positive `sparse_dim` and a `model_name`, the vector store automatically computes sparse (bag-of-words‑style) vectors in addition to dense vectors.
231
+
232
+ - **Sparse dimension (`sparse_dim`)**:
233
+ - For the built-in SPLADE models, the recommended `sparse_dim` is **30522** (matching the model vocabulary size).
234
+ - For dense‑only search, omit `sparse_dim` (or set it to `0`).
235
+ - **Supported sparse models (`model_name`)**:
236
+ - `"splade_pp"` → `prithivida/Splade_PP_en_v1` (SPLADE++)
237
+ - `"splade_cocondenser"` → `naver/splade-cocondenser-ensembledistil`
238
+
239
+ Example hybrid configuration:
240
+
241
+ ```python
242
+ vector_store = EndeeVectorStore.from_params(
243
+ api_token=endee_api_token,
244
+ index_name=index_name,
245
+ dimension=dimension, # dense dimension (e.g., 1536 for OpenAI)
246
+ space_type="cosine",
247
+ precision="float16",
248
+ hybrid=True,
249
+ sparse_dim=30522, # sparse dimension for SPLADE models
250
+ model_name="splade_pp", # or "splade_cocondenser"
251
+ )
252
+ ```
166
253
 
167
254
  ---
168
255
 
@@ -239,16 +326,47 @@ print(response)
239
326
 
240
327
  ### Available Filter Operators
241
328
 
242
- | Operator | Description |
243
- |----------|-------------|
244
- | `FilterOperator.EQ` | Equal to |
245
- | `FilterOperator.NE` | Not equal to |
246
- | `FilterOperator.GT` | Greater than |
247
- | `FilterOperator.GTE` | Greater than or equal |
248
- | `FilterOperator.LT` | Less than |
249
- | `FilterOperator.LTE` | Less than or equal |
250
- | `FilterOperator.IN` | In list |
251
- | `FilterOperator.NIN` | Not in list |
329
+ | Operator | Description | Backend Symbol | Example |
330
+ |----------|-------------|----------------|---------|
331
+ | `FilterOperator.EQ` | Equal to | `$eq` | `rating == 5` |
332
+ | `FilterOperator.IN` | In list | `$in` | `category in ["ai", "ml"]` |
333
+
334
+
335
+ > **Important Notes:**
336
+ > - Currently, the Endee LlamaIndex integration only supports **EQ** and **IN** metadata filters.
337
+ > - Range-style operators (LT, LTE, GT, GTE) are **not** supported in this adapter.
338
+
339
+ ### Filter Examples
340
+
341
+ Here are practical examples showing how to use the supported filter operators:
342
+
343
+ ```python
344
+ from llama_index.core.vector_stores.types import MetadataFilters, MetadataFilter, FilterOperator
345
+
346
+ # Example 1: Equal to (EQ)
347
+ # Find documents with rating equal to 5
348
+ rating_filter = MetadataFilter(key="rating", value=5, operator=FilterOperator.EQ)
349
+ filters = MetadataFilters(filters=[rating_filter])
350
+ # Backend: {"rating": {"$eq": 5}}
351
+
352
+ # Example 2: In list (IN)
353
+ # Find documents in AI or ML categories
354
+ category_filter = MetadataFilter(key="category", value=["ai", "ml"], operator=FilterOperator.IN)
355
+ filters = MetadataFilters(filters=[category_filter])
356
+ # Backend: {"category": {"$in": ["ai", "ml"]}}
357
+
358
+ # Example 3: Combined filters (AND logic)
359
+ # Find AI documents with rating equal to 5
360
+ filters = MetadataFilters(filters=[
361
+ MetadataFilter(key="category", value="ai", operator=FilterOperator.EQ),
362
+ MetadataFilter(key="rating", value=5, operator=FilterOperator.EQ)
363
+ ])
364
+ # Backend: [{"category": {"$eq": "ai"}}, {"rating": {"$eq": 5}}]
365
+
366
+ # Create a query engine with filters
367
+ filtered_engine = index.as_query_engine(filters=filters)
368
+ response = filtered_engine.query("What is machine learning?")
369
+ ```
252
370
 
253
371
  ---
254
372
 
@@ -439,10 +557,14 @@ Delete the index when you're done to free up resources.
439
557
  | `api_token` | `str` | Your Endee API token | Required |
440
558
  | `index_name` | `str` | Name of the index | Required |
441
559
  | `dimension` | `int` | Vector dimension | Required |
442
- | `space_type` | `str` | Distance metric | `"cosine"` |
443
- | `precision` | `str` | Index precision setting | `"medium"` |
444
- | `key` | `str` | Encryption key for metadata (256-bit hex) | `None` |
560
+ | `space_type` | `str` | Distance metric (`"cosine"`, `"l2"`, `"ip"`) | `"cosine"` |
561
+ | `precision` | `str` | Index precision (`"binary"`, `"float16"`, `"float32"`, `"int16d"`, `"int8d"`) | `"float16"` |
445
562
  | `batch_size` | `int` | Vectors per API call | `100` |
563
+ | `hybrid` | `bool` | Enable hybrid search (dense + sparse vectors) | `False` |
564
+ | `sparse_dim` | `int` | Sparse dimension for hybrid index | `None` |
565
+ | `model_name` | `str` | Model name for sparse embeddings (e.g., `'splade_pp'`, `'bert_base'`) | `None` |
566
+ | `M` | `int` | Optional HNSW M parameter (bi-directional links per node) | `None` (backend default) |
567
+ | `ef_con` | `int` | Optional HNSW ef_construction parameter | `None` (backend default) |
446
568
 
447
569
  ### Distance Metrics
448
570
 
@@ -454,38 +576,39 @@ Delete the index when you're done to free up resources.
454
576
 
455
577
  ### Precision Settings
456
578
 
457
- The `precision` parameter controls the trade-off between search accuracy and performance:
579
+ The `precision` parameter controls the vector storage format and affects memory usage and search performance:
458
580
 
459
581
  | Precision | Description | Use Case |
460
582
  |-----------|-------------|----------|
461
- | `"low"` | Faster searches, lower accuracy | Large-scale applications where speed is critical |
462
- | `"medium"` | Balanced performance and accuracy | General purpose applications (default) |
463
- | `"high"` | Slower searches, higher accuracy | Applications requiring maximum precision |
464
- | `None` | Default system precision | Use system defaults |
583
+ | `"float32"` | Full precision floating point | Maximum accuracy, higher memory usage |
584
+ | `"float16"` | Half precision floating point | Balanced accuracy and memory (default) |
585
+ | `"binary"` | Binary vectors | Extremely compact, best for binary embeddings |
586
+ | `"int8d"` | 8-bit integer quantization | High compression, good accuracy |
587
+ | `"int16d"` | 16-bit integer quantization | Better accuracy than int8d, moderate compression |
465
588
 
466
- ### Encryption Support
589
+ ### HNSW Parameters (Optional)
467
590
 
468
- You can encrypt metadata stored in Endee by providing a 256-bit encryption key (64 hex characters). This ensures sensitive information is encrypted at rest.
591
+ HNSW (Hierarchical Navigable Small World) parameters control index construction and search quality. These are **optional** - if not provided, the Endee backend uses optimized defaults.
469
592
 
470
- ```python
471
- # Generate a 256-bit key (example - use a secure method in production)
472
- import secrets
473
- encryption_key = secrets.token_hex(32) # 32 bytes = 64 hex characters
593
+ | Parameter | Description | Impact |
594
+ |-----------|-------------|--------|
595
+ | `M` | Number of bi-directional links per node | Higher M = better recall, more memory |
596
+ | `ef_con` | Size of dynamic candidate list during construction | Higher ef_con = better quality, slower indexing |
597
+
598
+ **Example with custom HNSW parameters:**
474
599
 
475
- # Create vector store with encryption
600
+ ```python
476
601
  vector_store = EndeeVectorStore.from_params(
477
- api_token=endee_api_token,
478
- index_name=index_name,
479
- dimension=dimension,
602
+ api_token="your-token",
603
+ index_name="custom_index",
604
+ dimension=384,
480
605
  space_type="cosine",
481
- precision="medium",
482
- key=encryption_key # Metadata will be encrypted
606
+ M=32, # Optional: custom M value
607
+ ef_con=256 # Optional: custom ef_construction
483
608
  )
484
-
485
- # Important: Store this key securely! You'll need it to access the index later.
486
609
  ```
487
610
 
488
- > **Warning:** If you lose the encryption key, you will not be able to decrypt your metadata. Store it securely (e.g., in a secrets manager).
611
+ **Note:** Only specify M and ef_con if you need to fine-tune performance. The backend defaults work well for most use cases.
489
612
 
490
613
  ---
491
614
 
@@ -0,0 +1,8 @@
1
+ endee_llamaindex/__init__.py,sha256=ctCcicNLMO3LpXPGLwvQifvQLX7TEd8CYgFO6Nd9afc,83
2
+ endee_llamaindex/base.py,sha256=JJ6KOSv32utKh93DDLTJFu8_wd-WUWi42hWVgIeGIZc,31533
3
+ endee_llamaindex/constants.py,sha256=-RMx-48CsOklYnarwae5d-BrixCWQfzPawWB-ZgH6gA,2128
4
+ endee_llamaindex/utils.py,sha256=EIdDGZ8clesbiCJSgowonVBtGrimEwa-YV2qj05GMcE,5263
5
+ endee_llamaindex-0.1.5.dist-info/METADATA,sha256=346YtslXIy6EK2V2Iy0OxZhQlRXxjOI_lTNulUPQI4U,19879
6
+ endee_llamaindex-0.1.5.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
7
+ endee_llamaindex-0.1.5.dist-info/top_level.txt,sha256=AReiKL0lBXSdKPsQlDusPIH_qbS_txOSUctuCR0rRNQ,17
8
+ endee_llamaindex-0.1.5.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.9.0)
2
+ Generator: setuptools (80.10.2)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,7 +0,0 @@
1
- endee_llamaindex/__init__.py,sha256=ctCcicNLMO3LpXPGLwvQifvQLX7TEd8CYgFO6Nd9afc,83
2
- endee_llamaindex/base.py,sha256=I_i2cvGpran4EG0Eu2Wpr5dic-818VsJ_ZYaFSzj0D8,29032
3
- endee_llamaindex/utils.py,sha256=psGw_VkJlirKiFpk233E8l2xVfPf3gcq1C0SxMQxUsA,25468
4
- endee_llamaindex-0.1.3.dist-info/METADATA,sha256=iNmNAsblquqz6e8TEmKReytv1WJ0cPNuRPYMTpDfYmI,15026
5
- endee_llamaindex-0.1.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
6
- endee_llamaindex-0.1.3.dist-info/top_level.txt,sha256=AReiKL0lBXSdKPsQlDusPIH_qbS_txOSUctuCR0rRNQ,17
7
- endee_llamaindex-0.1.3.dist-info/RECORD,,