"""libs — pgvector knowledge base modules.

Re-exports public API from chunker, embedding_service, ingest, search.
Uses sys.path-aware imports to work regardless of working directory.
"""

import os
import sys

# Ensure this directory is on sys.path for sibling module imports
_this_dir = os.path.dirname(os.path.abspath(__file__))
if _this_dir not in sys.path:
    sys.path.insert(0, _this_dir)

from chunker import chunk_text  # type: ignore[import-not-found]  # noqa: E402
from embedding_service import get_embedding, get_embeddings_batch  # type: ignore[import-not-found]  # noqa: E402
from ingest import delete_document, ingest_document, reindex_document  # type: ignore[import-not-found]  # noqa: E402
from search import hybrid_search, keyword_search, semantic_search  # type: ignore[import-not-found]  # noqa: E402

__all__ = [
    "chunk_text",
    "get_embedding",
    "get_embeddings_batch",
    "ingest_document",
    "delete_document",
    "reindex_document",
    "semantic_search",
    "keyword_search",
    "hybrid_search",
]
