How Global Search works
When you select Search all sources in the AI chat context settings, the assistant uses an advanced system called Retrieval-Augmented Generation (RAG). Instead of blindly sending your entire workspace to the AI, which would be prohibitively slow and exceed context limits, Contradic intelligently searches and pulls only the most relevant excerpts.
How the AI retrieves information
Section titled “How the AI retrieves information”Behind the scenes, Contradic performs several automated steps to ensure you get accurate and complete answers:
- Search Planning: Before searching, the AI analyzes your question and the conversation history to formulate an analysis plan. It generates up to 6 different optimal search queries to find the information, anticipating variations in terminology.
- Parallel Search Execution: The system runs these searches across your workspace using a combination of two methods:
- Exact matching (full text): to find specific names, contract references, dates, or precise legal terminology.
- Semantic matching (vector): to find similar concepts and clauses that share the same meaning, even if they are phrased differently.
- Evidence Selection: Contradic quickly analyzes the hundreds of retrieved paragraphs and carefully selects the specific chunks (short excerpts) that are most relevant to answering your exact question.
- Additional Searches: If critical evidence is still missing after the first pass, the system can autonomously formulate new queries and perform a second targeted search to fill the gaps.
Why use RAG over analyzing the whole workspace?
Section titled “Why use RAG over analyzing the whole workspace?”- Cost and speed efficiency: Feeding thousands of documents into an AI model for every single message consumes an enormous amount of tokens and can take many minutes to generate an answer. By extracting and sending only the most critical evidence, the analysis is significantly faster and uses a fraction of the token budget.
- Higher accuracy: Providing too much irrelevant context can easily distract the AI and increase the risk of hallucinations. Narrowing the context down strictly to targeted evidence yields more precise and factual answers.
- Iterative discovery: While global search extracts a highly focused set of evidence, it might not capture everything on the very first try for extremely broad questions. Because the process is lightweight, you can simply refine your question or ask follow-ups. The AI will effortlessly re-run the search process multiple times to retrieve new relevant chunks and build up your context.