Repository: Marker-Inc-Korea/AutoRAG
Issue: [BUG] VectorDB not working at the query expansion
Root cause: Validation Gap

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Full Error log**
```
 │                                                                                                                           │               
                             │ /Users/rfagundes/Documents/Projects/AutoRAG_Braxted/autorag/evaluator.py:188 in start_trial                               │               
                             │                                                                                                                           │               
                             │   185 │   │   │   if i == 0:                                                                                              │               
                             │   186 │   │   │   │   previous_result = self.qa_data                                                                      │               
                             │   187 │   │   │   logger.info(f"Running node line {node_line_name}...")                                                   │               
                             │ ❱ 188 │   │   │   previous_result = run_node_line(node_line, node_line_dir, previous_result)                              │               
                             │   189 │   │   │                                                                                                           │               
                             │   190 │   │   │   trial_summary_df = self._append_node_line_summary(                                                      │               
                             │   191 │   │   │   │   node_line_name, node_line_dir, trial_summary_df                                                     │               
                             │                                                                                                                           │               
                             │ /Users/rfagundes/Documents/Projects/AutoRAG_Braxted/autorag/node_line.py:47 in run_node_line                              │               
                             │                                                                                                                           │               
                             │   44 │                                                                                                                    │               
                             │   45 │   summary_lst = []                                                                                                 │               
                             │   46 │   for node in nodes:                                                                                               │               
                             │ ❱ 47 │   │   previous_result = node.run(previous_result, node_line_dir)                                                   │               
                             │   48 │   │   node_summary_df = load_summary_file(                                                                         │               
                             │   49 │   │   │   os.path.join(node_line_dir, node.node_type, "summary.csv")                                               │               
                             │   50 │   │   )                                                                                                            │               
                             │                                                                                                                           │               
                             │ /Users/rfagundes/Documents/Projects/AutoRAG_Braxted/autorag/schema/node.py:57 in run                                      │               
                             │                                                                                                                           │               
                             │    54 │   def run(self, previous_result: pd.DataFrame, node_line_dir: str) -> pd.DataFrame:                               │               
                             │    55 │   │   logger.info(f"Running node {self.node_type}...")                                                            │               
                             │    56 │   │   input_modules, input_params = self.get_param_combinations()                                                 │               
                             │ ❱  57 │   │   return self.run_node(                                                                                       │               
                             │    58 │   │   │   modules=input_modules,                                                                                  │               
                             │    59 │   │   │   module_params=input_params,                                                                             │               
                             │    60 │   │   │   previous_result=previous_result,                                                                        │               
                             │                                                                                                                           │               
                             │ /Users/rfagundes/Documents/Projects/AutoRAG_Braxted/autorag/nodes/queryexpansion/run.py:132 in run_query_expansion_node   │               
                             │                                                                                                                           │               
                             │   129 │   │   ]                                                                                                           │               
                             │   130 │   │                                                                                                               │               
                             │   131 │   │   # run evaluation                                                                                            │               
                             │ ❱ 132 │   │   evaluation_results = list(                                                                                  │               
                             │   133 │   │   │   map(                                                                                                    │               
                             │   134 │   │   │   │   lambda result: evaluate_one_query_expansion_node(                                                   │               
                             │   135 │   │   │   │   │   retrieval_callables,                                                                            │               
                             │                                                                                                                           │               
                             │ /Users/rfagundes/Documents/Projects/AutoRAG_Braxted/autorag/nodes/queryexpansion/run.py:134 in <lambda>                   │               
                             │                                                                                                                           │               
                             │   131 │   │   # run evaluation                                                                                            │               
                             │   132 │   │   evaluation_results = list(                                                                                  │               
                             │   133 │   │   │   map(                                                                                                    │               
                             │ ❱ 134 │   │   │   │   lambda result: evaluate_one_query_expansion_node(                                                   │               
                             │   135 │   │   │   │   │   retrieval_callables,                                                                            │               
                             │   136 │   │   │   │   │   retrieval_params,                                                                               │               
                             │   137 │   │   │   │   │   [                                                                                               │               
                             │                                                                                                                           │               
                             │ /Users/rfagundes/Documents/Projects/AutoRAG_Braxted/autorag/nodes/queryexpansion/run.py:212 in                            │               
                             │ evaluate_one_query_expansion_node                                                                                         │               
                             │                                                                                                                           │               
                             │   209 │   previous_result["queries"] = [                                                                                  │               
                             │   210 │   │   metric_input.queries for metric_input in metric_inputs                                                      │               
                             │   211 │   ]                                                                                                               │               
                             │ ❱ 212 │   retrieval_results = list(                                                                                       │               
                             │   213 │   │   map(                                                                                                        │               
                             │   214 │   │   │   lambda x: x[0].run_evaluator(                                                                           │               
                             │   215 │   │   │   │   project_dir=project_dir, previous_result=previous_result, **x[1]                                    │               
                             │                                                                                                                           │               
                             │ /Users/rfagundes/Documents/Projects/AutoRAG_Braxted/autorag/nodes/queryexpansion/run.py:214 in <lambda>                   │               
                             │                                                                                                                           │               
                             │   211 │   ]                                                                                                               │               
                             │   212 │   retrieval_results = list(                                                                                       │               
                             │   213 │   │   map(                                                                                                        │               
                             │ ❱ 214 │   │   │   lambda x: x[0].run_evaluator(                                                                           │               
                             │   215 │   │   │   │   project_dir=project_dir, previous_result=previous_result, **x[1]                                    │               
                             │   216 │   │   │   ),                                                                                                      │               
                             │   217 │   │   │   zip(retrieval_funcs, retrieval_params),                                                                 │               
                             │                                                                                                                           │               
                             │ /Users/rfagundes/Documents/Projects/AutoRAG_Braxted/autorag/schema/base.py:26 in run_evaluator                            │               
                             │                                                                                                                           │               
                             │   23 │   │   **kwargs,                                                                                                    │               
                             │   24 │   ):                                                                                                               │               
                             │   25 │   │   instance = cls(project_dir, *args, **kwargs)                                                                 │               
                             │ ❱ 26 │   │   result = instance.pure(previous_result, *args, **kwargs)                                                     │               
                             │   27 │   │   del instance                                                                                                 │               
                             │   28 │   │   return result                                                                                                │               
                             │   29                                                                                                                      │               
                             │                                                                                                                           │               
                             │ /Users/rfagundes/Documents/Projects/AutoRAG_Braxted/autorag/utils/util.py:69 in wrapper                                   │               
                             │                                                                                                                           │               
                             │    66 │   def decorator_result_to_dataframe(func: Callable):                                                              │               
                             │    67 │   │   @functools.wraps(func)                                                                                      │               
                             │    68 │   │   def wrapper(*args, **kwargs) -> pd.DataFrame:                                                               │               
                             │ ❱  69 │   │   │   results = func(*args, **kwargs)                                                                         │               
                             │    70 │   │   │   if len(column_names) == 1:                                                                              │               
                             │    71 │   │   │   │   df_input = {column_names[0]: results}                                                               │               
                             │    72 │   │   │   else:                                                                                                   │               
                             │                                                                                                                           │               
                             │ /Users/rfagundes/Documents/Projects/AutoRAG_Braxted/autorag/nodes/retrieval/vectordb.py:72 in pure                        │               
                             │                                                                                                                           │               
                             │    69 │   │   queries = self.cast_to_run(previous_result)                                                                 │               
                             │    70 │   │   pure_params = pop_params(self._pure, kwargs)                                                                │               
                             │    71 │   │   # import pdb; pdb.set_trace()                                                                               │               
                             │ ❱  72 │   │   ids, scores = self._pure(queries, **pure_params)                                                            │               
                             │    73 │   │   contents = fetch_contents(self.corpus_df, ids)                                                              │               
                             │    74 │   │   return contents, ids, scores                                                                                │               
                             │    75                                                                                                                     │               
                             │                                                                                                                           │               
                             │ /Users/rfagundes/Documents/Projects/AutoRAG_Braxted/autorag/nodes/retrieval/vectordb.py:111 in _pure                      │               
                             │                                                                                                                           │               
                             │   108 │   │   │   for query_list in queries                                                                               │               
                             │   109 │   │   ]                                                                                                           │               
                             │   110 │   │   loop = get_event_loop()                                                                                     │               
                             │ ❱ 111 │   │   results = loop.run_until_complete(                                                                          │               
                             │   112 │   │   │   process_batch(tasks, batch_size=embedding_batch)                                                        │               
                             │   113 │   │   )                                                                                                           │               
                             │   114 │   │   id_result = list(map(lambda x: x[0], results))                                                              │               
                             │                                                                                                                           │               
                             │ /opt/homebrew/Cellar/python@3.12/3.12.7_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/base_events.py │               
                             │ :687 in run_until_complete                                                                                                │               
                             │                                                                                                                           │               
                             │    684 │   │   if not future.done():                                                                                      │               
                             │    685 │   │   │   raise RuntimeError('Event loop stopped before Future completed.')                                      │               
                             │    686 │   │                                                                                                              │               
                             │ ❱  687 │   │   return future.result()                                                                                     │               
                             │    688 │                                                                                                                  │               
                             │    689 │   def stop(self):                                                                                                │               
                             │    690 │   │   """Stop running the event loop.                                                                            │               
                             │                                                                                                                           │               
                             │ /Users/rfagundes/Documents/Projects/AutoRAG_Braxted/autorag/utils/util.py:302 in process_batch                            │               
                             │                                                                                                                           │               
                             │   299 │                                                                                                                   │               
                             │   300 │   for i in range(0, len(tasks), batch_size):                                                                      │               
                             │   301 │   │   batch = tasks[i : i + batch_size]                                                                           │               
                             │ ❱ 302 │   │   batch_results = await asyncio.gather(*batch)                                                                │               
                             │   303 │   │   results.extend(batch_results)                                                                               │               
                             │   304 │                                                                                                                   │               
                             │   305 │   return results                                                                                                  │               
                             │                                                                                                                           │               
                             │ /Users/rfagundes/Documents/Projects/AutoRAG_Braxted/autorag/nodes/retrieval/vectordb.py:192 in vectordb_pure              │               
                             │                                                                                                                           │               
                             │   189 │   │   )                                                                                                           │               
                             │   190 │   ]                                                                                                               │               
                             │   191 │   # import pdb; pdb.set_trace()                                                                                   │               
                             │ ❱ 192 │   id_result, score_result = zip(*result)                                                                          │               
                             │   193 │   return list(id_result), list(score_result)                                                                      │               
                             │   194                                                                                                                     │               
                             │   195 async def filter_exist_ids(                                                                                         │               
                             ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯               
                             ValueError: not enough values to unpack (expected 2, got 0)  
```

**Code that bug is happened**
If applicable, add the code that bug is happened.
(Especially, your AutoRAG YAML file or python codes that you wrote)

**Desktop (please complete the following information):**
 - OS: [e.g. Windows, Linux, MacOS]
 - Python version [e.g. 3.10]

**Additional context**
Add any other context about the problem here.


It looks like you are using vectordb name "default" at your YAML file, is that correct? I do not recommend you use the name "default". I think it causes error because the name "default" is directed to default vectordb. Which is using openai embedding model and collection_name openai. It will be cause error when you set collection or embedding model to others, in the situation you are using vectordb name “default"

—

Btw, I added test code for this.