Skip to main content

A high-performance static internet index for LLM RAG applications

Project description

llmsearchindex

LLMSearchIndex is a Python library for internet-scale retrieval in LLM RAG applications using a fully local search index.

We trained a search index on 203,169,792 web pages sourced from:

This index can be used as external context to significantly improve LLM responses without requiring external API calls at query time.

Installation

pip install llmsearchindex

PyPI: https://pypi.org/project/llmsearchindex/

Model: https://huggingface.co/zakerytclarke/llmindex

Github: https://github.com/zakerytclarke/llmsearchindex

Example Usage:

from llmsearchindex import LLMIndex

# Initializes and downloads index
index = LLMIndex()

# Standard search (Fastest)
results = index.search("who invented sliced bread", top_k=5)

# High-precision search (Reranked)
results = index.search("who invented sliced bread", top_k=5, rerank=True)

for result in results:
  print(result.get('text'))
  print(result.get('url'))
  print("==="*100)

System requirements

  • ~6 GB RAM
  • ~10 GB disk space
  • CPU inference supported (GPU optional)

Architecture

flowchart LR
    A[User Query] --> B(Embed Sentence Transformers all-MiniLM-L6)
    B --> C(PCA: 384d → 64d)
    C --> D(Binary Quantize)
    X[HuggingFace FineWeb] --> G
    Y[HuggingFace Wikipedia] --> G
    D --> E{FAISS Index}
    E --> G(Fetch Indexed Rows from HuggingFace Server)
    G --> H{Rerank?}
    H -->|Yes| I(Cosine Similarity)
    H -->|No| J[Final Results]
    I --> J
    B -->I

Resources

Embeddings: https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2

FAISS Vector search: https://github.com/facebookresearch/faiss

Wikipedia: https://huggingface.co/datasets/wikimedia/wikipedia

FineWeb: https://huggingface.co/datasets/HuggingFaceFW/fineweb

License- MIT License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

llmsearchindex-1.1.0.tar.gz (6.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

llmsearchindex-1.1.0-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

Details for the file llmsearchindex-1.1.0.tar.gz.

File metadata

  • Download URL: llmsearchindex-1.1.0.tar.gz
  • Upload date:
  • Size: 6.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for llmsearchindex-1.1.0.tar.gz
Algorithm Hash digest
SHA256 31b7532731071ad3c64418f862abbb5f4fc1ec453a32a81a52834ccdd734660b
MD5 558aae9057c7934a4c195f578d620fb8
BLAKE2b-256 0d9683227c12de339ef2b30204e060092705445b0188ecd39c4d99803038b21f

See more details on using hashes here.

File details

Details for the file llmsearchindex-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: llmsearchindex-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for llmsearchindex-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cf45fe91f2c10a713bcb6cc5445eedf0b601ccafbf62104aa86bc71eb95f9ec9
MD5 3072c0aa450ead78285ba9a271859745
BLAKE2b-256 03846f6e994dbd9a2e6ae2ba4d0fcb755d72aad213691f6974fa11b906c7ea95

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page