rag.core.config¶
Configuration for the papers RAG pipeline.
Attributes¶
Classes¶
Runtime settings for ingest + query. |
Functions¶
|
Walk parents until the monorepo root (contains |
|
Load |
Module Contents¶
- rag.core.config.find_repo_root(*, start: pathlib.Path | None = None) pathlib.Path[source]¶
Walk parents until the monorepo root (contains
libs/rag-core) is found.- Parameters:
start (Path or None) – Directory to start from. Defaults to this file’s location.
- Returns:
Absolute path to the monorepo root.
- Return type:
Path
- Raises:
FileNotFoundError – If no ancestor contains
libs/rag-core.
- rag.core.config.load_repo_dotenv() None[source]¶
Load
.envfrom cwd and the monorepo root.Existing process environment wins (
override=False). Streamlit sets cwd to the script directory, so a repo-root.envis missed by a bareload_dotenv().
- class rag.core.config.RagConfig[source]¶
Runtime settings for ingest + query.
- Variables:
papers_dir (Path) – Directory of PDF papers to ingest.
chroma_dir (Path) – Persistent Chroma directory (created if missing).
collection_name (str) – Chroma collection name.
embed_model_name (str) – HuggingFace embedding model id (local).
llm_model_name (str) – OpenAI chat model id.
chunk_size (int) – SentenceSplitter chunk size.
chunk_overlap (int) – SentenceSplitter overlap.
similarity_top_k (int) – Retrieval top-k for the query engine.
strategy (RagStrategy) – In-process orchestration backend (LlamaIndex or LangChain).
- strategy: rag.core.strategy.RagStrategy[source]¶
- classmethod from_env(*, repo_root: pathlib.Path | None = None, strategy: rag.core.strategy.RagStrategy | None = None) RagConfig[source]¶
Build config from environment variables with repo-relative defaults.
- Parameters:
repo_root (Path or None) – Monorepo root. Discovered automatically when omitted.
strategy (RagStrategy or None) – Orchestration backend. Defaults to
RAG_STRATEGYor LlamaIndex.
- Returns:
Resolved configuration.
- Return type: