Skip to main content

Core interfaces for hybrid search implementations (CUDA version)

Project description

just-semantic-search

PyPI version Python Version License Downloads

LLM-agnostic semantic-search library with hybrid search support and multiple backends.

Features

  • 🔍 Hybrid search combining semantic and keyword search
  • 🚀 Multiple backend support (Meilisearch, more coming soon)
  • 📄 Smart document splitting with semantic awareness
  • 🔌 LLM-agnostic - works with any embedding model
  • 🎯 Optimized for scientific and technical content
  • 🛠 Easy to use API and CLI tools

Installation

Make sure you have at least Python 3.11 installed.

Using pip

pip install just-semantic-search        # Core package
pip install just-semantic-search-meili  # Meilisearch backend

Using Poetry

poetry add just-semantic-search        # Core package
poetry add just-semantic-search-meili  # Meilisearch backend

From Source

# Install Poetry if you haven't already
curl -sSL https://install.python-poetry.org | python3 -

# Clone the repository
git clone https://github.com/your-username/just-semantic-search.git
cd just-semantic-search

# Install dependencies and create virtual environment
poetry install

# Activate the virtual environment
poetry shell

Docker Setup for Meilisearch

The project includes a Docker Compose configuration for running Meilisearch. Simply run:

./bin/meili.sh

This will start a Meilisearch instance with vector search enabled and persistent data storage.

Quick Start

Document Splitting

from just_semantic_search.article_semantic_splitter import ArticleSemanticSplitter
from sentence_transformers import SentenceTransformer

# Initialize model and splitter
model = SentenceTransformer('thenlper/gte-base')
splitter = ArticleSemanticSplitter(model)

# Split document with metadata
documents = splitter.split_file(
    "path/to/document.txt",
    embed=True,
    title="Document Title",
    source="https://source.url"
)

Hybrid Search with Meilisearch

from just_semantic_search.meili.rag import MeiliConfig, MeiliRAG

# Configure Meilisearch
config = MeiliConfig(
    host="127.0.0.1",
    port=7700,
    api_key="your_api_key"
)

# Initialize RAG
rag = MeiliRAG(
    "test_index",
    "thenlper/gte-base",
    config,
    create_index_if_not_exists=True
)

# Add documents and search
rag.add_documents_sync(documents)
results = rag.search(
    text_query="What are CAD-genes?",
    vector=model.encode("What are CAD-genes?")
)

Project Structure

The project consists of multiple components:

  • core: Core interfaces for hybrid search implementations
  • meili: Meilisearch backend implementation

Contributing

Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.

License

This project is licensed under the Apache 2.0 License - see the LICENSE file for details.

Citation

If you use this software in your research, please cite:

@software{just_semantic_search,
  title = {just-semantic-search: LLM-agnostic semantic search library},
  author = {Karmazin, Alex and Kulaga, Anton},
  year = {2024},
  url = {https://github.com/your-username/just-semantic-search}
}

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

just_semantic_search_cuda-0.3.5.tar.gz (18.5 kB view details)

Uploaded Source

Built Distribution

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

just_semantic_search_cuda-0.3.5-py3-none-any.whl (22.1 kB view details)

Uploaded Python 3

File details

Details for the file just_semantic_search_cuda-0.3.5.tar.gz.

File metadata

  • Download URL: just_semantic_search_cuda-0.3.5.tar.gz
  • Upload date:
  • Size: 18.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.1 CPython/3.12.3 Linux/6.8.0-55-lowlatency

File hashes

Hashes for just_semantic_search_cuda-0.3.5.tar.gz
Algorithm Hash digest
SHA256 f663e82c7cdb339639dfa8b97100b5ba0abc254f9a1dac6c0b12b2ba8e9ca9f8
MD5 45ff238f683c0e09485173d613fa7269
BLAKE2b-256 3531c7608aa496b0e04739507bdba86efb9bcbab97b4ae0e8ea0f262f9ed66e5

See more details on using hashes here.

File details

Details for the file just_semantic_search_cuda-0.3.5-py3-none-any.whl.

File metadata

File hashes

Hashes for just_semantic_search_cuda-0.3.5-py3-none-any.whl
Algorithm Hash digest
SHA256 b391bbc0d71fb4456c2fd07dfa20f900418e113a9af11314f026f52756d4813a
MD5 729ae55b04ecd8fdef5efb64a5909d5d
BLAKE2b-256 1c46fafaae5a0b683493f77687155f9450837f275489eb67d71bb10dbae569ed

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