Sign inSign up

galsl/semantic-search

By galsl

•Updated 10 months ago

A local implementation of semantic code search that operates entirely on the local filesystem.

Image
Databases & storage
0

286

galsl/semantic-search repository overview

Local File System Code Search using Hybrid Approach

A local implementation of semantic code search that operates entirely on the local filesystem. Based on code_search_s3vectors.py functionality but adapted for local storage.

Features:

  1. C++ code parsing using libclang
  2. Creates code chunks with metadata
  3. Supports dual embedding providers:
    • AWS Bedrock (amazon.titan-embed-text-v2:0)
    • Local sentence-transformers (all-MiniLM-L6-v2 or other models)
  4. Local file system storage (mirrors source tree structure)
  5. Three search modes:
    • Semantic only (vector similarity)
    • Metadata only (filter-based)
    • Hybrid (filter + semantic search)
  6. Two search methods with timing comparison:
    • Brute-force (linear scan)
    • FAISS index (IVF/HNSW for large datasets)
  7. LLM-based query parsing (natural language → metadata filters)

Usage:

# Initialize index
python3 local_FS_search_using_hybrid_approach.py init \\
    --index ./my_code_index \\
    --embedding-provider aws  # or 'local'

# Index C++ files
python3 local_FS_search_using_hybrid_approach.py index \\
    --index ./my_code_index \\
    src/*.cpp

# Search (semantic)
python3 local_FS_search_using_hybrid_approach.py search \\
    --index ./my_code_index \\
    "authentication logic"

# Search (hybrid)
python3 local_FS_search_using_hybrid_approach.py search \\
    --index ./my_code_index \\
    --mode hybrid \\
    "bool methods in User class for validation"

# Compare brute-force vs FAISS performance
python3 local_FS_search_using_hybrid_approach.py search \\
    --index ./my_code_index \\
    --compare-methods \\
    "error handling"

Tag summary

Content type

Image

Digest

sha256:bcb4df161…

Size

561.2 MB

Last updated

10 months ago

docker pull galsl/semantic-search