Spaces:
Sleeping

p4r5kpftnp-cmd commited on
Commit
1dc8f6a
·
1 Parent(s): 7181ddb

Retrieval fixes: robust nprobe tuning + goals-only query

Browse files

1. nprobe: set via faiss.extract_index_ivf() instead of attribute
assignment on the top-level index. FAISS silently ignores nprobe set
on wrapper indexes (IndexIDMap etc.), so reaching the IVF layer
directly guards against a future wrap making the tuning a no-op.
Verified the persisted index defaults to nprobe=16 and load bumps it
to 32. Non-IVF indexes and test doubles are tolerated (RuntimeError /
TypeError respectively) since search-breadth tuning must never break
index loading.

2. Retrieval query: goals only, newline-joined. Previously the retrieve
node space-joined goals + Lean error messages into one string. The
LeanDojo ByT5 encoder was trained on canonical proof states
("h : T\n⊢ goal"); error text is off-distribution noise that skews
the embedding. Errors still reach the LLM through the generation
prompt — they just no longer pollute retrieval. With no open goals
(pure syntax error) the query is empty and the retriever returns [],
which generation already handles.

Sanity check ("n : ℕ\n⊢ n + 0 = n"): top-5 = Nat.add_comm,
Nat.add_right_cancel, Nat.succ_add, Num.add_succ, Nat.add_assoc.
116/116 tests pass.

2 files changed +16 -4
Files changed (2)
src/langgraph_agent.py+7-1
src/retriever.py+9-3