-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path__init__.py
More file actions
39 lines (32 loc) · 1.3 KB
/
__init__.py
File metadata and controls
39 lines (32 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
"""RAG submodule — semantic retrieval over SEC filings, earnings transcripts, and theses.
Shared library code used by both alpha-engine-research (retrieval consumer:
qual analyst tools) and alpha-engine-data (ingestion producer: weekly Saturday
RAGIngestion step). Previously duplicated across both repos with drift; moved
here in alpha-engine-lib v0.3.0 as the single source of truth.
Top-level imports re-export the most common surface so consumers can write
``from alpha_engine_lib.rag import retrieve`` without reaching into submodules.
Pgvector + psycopg2 are heavy dependencies; install via the ``[rag]`` extra:
pip install "alpha-engine-lib[rag] @ git+https://github.com/cipher813/alpha-engine-lib@v0.3.0"
"""
# Auto-load .env so RAG_DATABASE_URL and VOYAGE_API_KEY are available
# whether run from CLI, Lambda (already in env), or imported in tests.
try:
from dotenv import load_dotenv
load_dotenv()
except ImportError:
pass # python-dotenv not installed (e.g. Lambda) — env vars set externally
from .db import get_connection, is_available
from .embeddings import embed_texts
from .retrieval import (
retrieve,
ingest_document,
document_exists,
)
__all__ = [
"get_connection",
"is_available",
"embed_texts",
"retrieve",
"ingest_document",
"document_exists",
]