Run a metadata-filtered search (e.g. content_type + technology) and an unfiltered similarity search in parallel. Merge filtered-first, dedup by chunk ID. Filtered results give precision; unfiltered results fill context gaps the filters miss.
RAGQdrant
Query Rewriting Before Vector Search
Rewrite conversational messages into standalone search queries using an LLM + chat history before hitting the vector store. "Yeah what about that?" becomes "What mobile development services are available?" Single biggest retrieval quality improvement I've made.
RAGLLM
HPSS for Harmonic-to-Noise Ratio
Instead of autocorrelation-based HNR, split the STFT into harmonic and percussive components via librosa's HPSS (median filtering on the spectrogram), then compute 10·log₁₀(E_harmonic / E_percussive). Different from Praat's HNR but captures voice quality well.
Audiolibrosa
librosa pyin (probabilistic YIN) and Parselmouth (Praat autocorrelation) give noticeably different F0 contours on the same audio. pyin catches quiet voiced segments; Praat handles octave jumps better. Return both and let the consumer decide.
AudioParselmouth
Parallel LLM Calls for Latency
When you need multiple independent LLM classifications (intent, entity extraction, query rewriting, ambiguity check), run them concurrently with a ThreadPoolExecutor. Total latency = slowest call, not the sum. deepcopy the state first; mutable dicts + threads = subtle bugs.
LangGraphPython
When Retrieval Returns Nothing
If the vector store returns zero relevant documents, skip the LLM entirely and return a templated honest response. The retriever is your ground truth. Letting the LLM fill the gap is how hallucinations happen in production.
RAGLLM