mrme77/dfars-assistant
0
1"""Build the local Chroma vector index for DFARS sections."""2 3from pathlib import Path4 5from src.retrieval.section_store import load_sections6from src.retrieval.vector_search import build_vector_index7 8 9def main() -> None:10 """Build the Chroma vector index from the best available section index."""11 source_path = _source_index_path()12 sections = load_sections(source_path)13 count = build_vector_index(sections)14 print(f"Embedded {count} DFARS sections from {source_path}.")15 16 17def _source_index_path() -> Path:18 """Choose enriched sections when available, otherwise base sections."""19 enriched_path = Path("indexes/dfars_sections_enriched.jsonl")20 if enriched_path.exists():21 return enriched_path22 return Path("indexes/dfars_sections.jsonl")23 24 25if __name__ == "__main__":26 main()27 