Spaces:
Running
Running
Your Name
Claude
commited on
Commit
·
b1071b6
1
Parent(s):
5b3af4d
Change top_k from 3 to 10 trials for better coverage
Browse files10 trials = ~7,790 chars, fits comfortably in 12k context window
Provides better coverage while still focused
Changed 3 locations:
- Line 1475: General queries
- Line 1644: COMPARE queries
- Line 1676: SEARCH_TRIALS queries
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- foundation_engine.py +3 -3
foundation_engine.py
CHANGED
|
@@ -1472,7 +1472,7 @@ def process_query_simple_test(conversation):
|
|
| 1472 |
|
| 1473 |
# Try to search
|
| 1474 |
start = time.time()
|
| 1475 |
-
context = retrieve_context_with_embeddings(conversation, top_k=
|
| 1476 |
search_time = time.time() - start
|
| 1477 |
|
| 1478 |
if not context:
|
|
@@ -1641,7 +1641,7 @@ def process_query(conversation):
|
|
| 1641 |
context_parts = []
|
| 1642 |
for i, treatment in enumerate(treatments[:2], 1): # Compare first 2
|
| 1643 |
logger.info(f"[COMPARE] Searching trials for {treatment}...")
|
| 1644 |
-
treatment_trials = retrieve_context_with_embeddings(treatment, top_k=
|
| 1645 |
|
| 1646 |
if treatment_trials:
|
| 1647 |
context_parts.append(f"=== TRIALS FOR {treatment.upper()} ===\n{treatment_trials}\n")
|
|
@@ -1673,7 +1673,7 @@ def process_query(conversation):
|
|
| 1673 |
logger.info("Step 1: RAG search...")
|
| 1674 |
output_parts.append("✓ Step 1: RAG search started...\n")
|
| 1675 |
# Pass entities for STRICT company filtering
|
| 1676 |
-
context = retrieve_context_with_embeddings(search_query, top_k=
|
| 1677 |
|
| 1678 |
if not context:
|
| 1679 |
return "No matching trials found in RAG search."
|
|
|
|
| 1472 |
|
| 1473 |
# Try to search
|
| 1474 |
start = time.time()
|
| 1475 |
+
context = retrieve_context_with_embeddings(conversation, top_k=10)
|
| 1476 |
search_time = time.time() - start
|
| 1477 |
|
| 1478 |
if not context:
|
|
|
|
| 1641 |
context_parts = []
|
| 1642 |
for i, treatment in enumerate(treatments[:2], 1): # Compare first 2
|
| 1643 |
logger.info(f"[COMPARE] Searching trials for {treatment}...")
|
| 1644 |
+
treatment_trials = retrieve_context_with_embeddings(treatment, top_k=10, entities=parsed_query)
|
| 1645 |
|
| 1646 |
if treatment_trials:
|
| 1647 |
context_parts.append(f"=== TRIALS FOR {treatment.upper()} ===\n{treatment_trials}\n")
|
|
|
|
| 1673 |
logger.info("Step 1: RAG search...")
|
| 1674 |
output_parts.append("✓ Step 1: RAG search started...\n")
|
| 1675 |
# Pass entities for STRICT company filtering
|
| 1676 |
+
context = retrieve_context_with_embeddings(search_query, top_k=10, entities=parsed_query)
|
| 1677 |
|
| 1678 |
if not context:
|
| 1679 |
return "No matching trials found in RAG search."
|