mirror of
https://github.com/mruwnik/memory.git
synced 2026-01-02 17:22:58 +01:00
Enable query analysis by default (runs in parallel with HyDE)
Query analysis and HyDE are both LLM-based operations that run in parallel via asyncio.gather, so enabling query analysis adds no extra latency when HyDE is also enabled. Query analysis provides: - Modality detection from query content - Query cleaning and reformulation - Query variants for better recall 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
f9e9ad5f4b
commit
7e1770f384
@ -57,11 +57,11 @@ export const SearchForm = ({ isLoading, onSearch }: SearchFormProps) => {
|
|||||||
const [dynamicFilters, setDynamicFilters] = useState<Record<string, any>>({})
|
const [dynamicFilters, setDynamicFilters] = useState<Record<string, any>>({})
|
||||||
const [limit, setLimit] = useState(10)
|
const [limit, setLimit] = useState(10)
|
||||||
// Search enhancement options - initialize to match server defaults
|
// Search enhancement options - initialize to match server defaults
|
||||||
// Server defaults: BM25=true, HyDE=true, Reranking=true, QueryAnalysis=false
|
// All enabled by default (query analysis runs in parallel with HyDE, no extra latency)
|
||||||
const [useBm25, setUseBm25] = useState<boolean | undefined>(true)
|
const [useBm25, setUseBm25] = useState<boolean | undefined>(true)
|
||||||
const [useHyde, setUseHyde] = useState<boolean | undefined>(true)
|
const [useHyde, setUseHyde] = useState<boolean | undefined>(true)
|
||||||
const [useReranking, setUseReranking] = useState<boolean | undefined>(true)
|
const [useReranking, setUseReranking] = useState<boolean | undefined>(true)
|
||||||
const [useQueryAnalysis, setUseQueryAnalysis] = useState<boolean | undefined>(false)
|
const [useQueryAnalysis, setUseQueryAnalysis] = useState<boolean | undefined>(true)
|
||||||
const { getMetadataSchemas, getTags } = useMCP()
|
const { getMetadataSchemas, getTags } = useMCP()
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|||||||
@ -470,7 +470,9 @@ async def search_chunks(
|
|||||||
else settings.ENABLE_RERANKING
|
else settings.ENABLE_RERANKING
|
||||||
)
|
)
|
||||||
use_query_analysis = (
|
use_query_analysis = (
|
||||||
config.useQueryAnalysis if config.useQueryAnalysis is not None else False
|
config.useQueryAnalysis
|
||||||
|
if config.useQueryAnalysis is not None
|
||||||
|
else settings.ENABLE_QUERY_ANALYSIS
|
||||||
)
|
)
|
||||||
|
|
||||||
internal_limit = limit * CANDIDATE_MULTIPLIER
|
internal_limit = limit * CANDIDATE_MULTIPLIER
|
||||||
|
|||||||
@ -178,6 +178,7 @@ ENABLE_BM25_SEARCH = boolean_env("ENABLE_BM25_SEARCH", True)
|
|||||||
ENABLE_SEARCH_SCORING = boolean_env("ENABLE_SEARCH_SCORING", True)
|
ENABLE_SEARCH_SCORING = boolean_env("ENABLE_SEARCH_SCORING", True)
|
||||||
ENABLE_HYDE_EXPANSION = boolean_env("ENABLE_HYDE_EXPANSION", True)
|
ENABLE_HYDE_EXPANSION = boolean_env("ENABLE_HYDE_EXPANSION", True)
|
||||||
HYDE_TIMEOUT = float(os.getenv("HYDE_TIMEOUT", "3.0"))
|
HYDE_TIMEOUT = float(os.getenv("HYDE_TIMEOUT", "3.0"))
|
||||||
|
ENABLE_QUERY_ANALYSIS = boolean_env("ENABLE_QUERY_ANALYSIS", True) # Runs in parallel with HyDE
|
||||||
ENABLE_RERANKING = boolean_env("ENABLE_RERANKING", True)
|
ENABLE_RERANKING = boolean_env("ENABLE_RERANKING", True)
|
||||||
RERANK_MODEL = os.getenv("RERANK_MODEL", "rerank-2-lite")
|
RERANK_MODEL = os.getenv("RERANK_MODEL", "rerank-2-lite")
|
||||||
MAX_PREVIEW_LENGTH = int(os.getenv("MAX_PREVIEW_LENGTH", DEFAULT_CHUNK_TOKENS * 16))
|
MAX_PREVIEW_LENGTH = int(os.getenv("MAX_PREVIEW_LENGTH", DEFAULT_CHUNK_TOKENS * 16))
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user