@@ -262,27 +262,13 @@ def _process_query_with_cot(self, query: str) -> Dict[str, Any]:
262262 pdf_context = self .vector_store .query_pdf_collection (query )
263263 initial_context .extend (pdf_context )
264264 logger .info (f"Retrieved { len (pdf_context )} chunks from PDF Collection" )
265- # Log each chunk with citation number but not full content
266- for i , chunk in enumerate (pdf_context ):
267- source = chunk ["metadata" ].get ("source" , "Unknown" )
268- pages = chunk ["metadata" ].get ("page_numbers" , [])
269- logger .info (f"Source [{ i + 1 } ]: { source } (pages: { pages } )" )
270- # Only log content preview at debug level
271- content_preview = chunk ["content" ][:150 ] + "..." if len (chunk ["content" ]) > 150 else chunk ["content" ]
272- logger .debug (f"Content preview for source [{ i + 1 } ]: { content_preview } " )
265+ # Don't log individual sources to keep console clean
273266 elif self .collection == "Repository Collection" :
274267 logger .info (f"Retrieving context from Repository Collection for query: '{ query } '" )
275268 repo_context = self .vector_store .query_repo_collection (query )
276269 initial_context .extend (repo_context )
277270 logger .info (f"Retrieved { len (repo_context )} chunks from Repository Collection" )
278- # Log each chunk with citation number but not full content
279- for i , chunk in enumerate (repo_context ):
280- source = chunk ["metadata" ].get ("source" , "Unknown" )
281- file_path = chunk ["metadata" ].get ("file_path" , "Unknown" )
282- logger .info (f"Source [{ i + 1 } ]: { source } (file: { file_path } )" )
283- # Only log content preview at debug level
284- content_preview = chunk ["content" ][:150 ] + "..." if len (chunk ["content" ]) > 150 else chunk ["content" ]
285- logger .debug (f"Content preview for source [{ i + 1 } ]: { content_preview } " )
271+ # Don't log individual sources to keep console clean
286272 # For General Knowledge, no context is needed
287273 else :
288274 logger .info ("Using General Knowledge collection, no context retrieval needed" )
@@ -306,9 +292,8 @@ def _process_query_with_cot(self, query: str) -> Dict[str, Any]:
306292 continue
307293 step_research = self .agents ["researcher" ].research (query , step )
308294 research_results .append ({"step" : step , "findings" : step_research })
309- # Log which sources were used for this step
310- source_indices = [initial_context .index (finding ) + 1 for finding in step_research if finding in initial_context ]
311- logger .info (f"Research for step: { step } \n Using sources: { source_indices } " )
295+ # Don't log source indices to keep console clean
296+ logger .info (f"Research for step: { step } " )
312297 else :
313298 # If no researcher or no context, use the steps directly
314299 research_results = [{"step" : step , "findings" : []} for step in plan .split ("\n " ) if step .strip ()]
@@ -328,7 +313,8 @@ def _process_query_with_cot(self, query: str) -> Dict[str, Any]:
328313 result ["findings" ] if result ["findings" ] else [{"content" : "Using general knowledge" , "metadata" : {"source" : "General Knowledge" }}]
329314 )
330315 reasoning_steps .append (step_reasoning )
331- logger .info (f"Reasoning for step: { result ['step' ]} \n { step_reasoning } " )
316+ # Log just the step, not the full reasoning
317+ logger .info (f"Reasoning for step: { result ['step' ]} " )
332318
333319 # Step 4: Synthesize final answer
334320 logger .info ("Step 4: Synthesis" )
@@ -337,7 +323,7 @@ def _process_query_with_cot(self, query: str) -> Dict[str, Any]:
337323 return self ._generate_general_response (query )
338324
339325 final_answer = self .agents ["synthesizer" ].synthesize (query , reasoning_steps )
340- logger .info (f "Final synthesized answer: \n { final_answer } " )
326+ logger .info ("Final answer synthesized successfully " )
341327
342328 return {
343329 "answer" : final_answer ,
@@ -360,26 +346,12 @@ def _process_query_standard(self, query: str) -> Dict[str, Any]:
360346 logger .info (f"Retrieving context from PDF Collection for query: '{ query } '" )
361347 pdf_context = self .vector_store .query_pdf_collection (query )
362348 logger .info (f"Retrieved { len (pdf_context )} chunks from PDF Collection" )
363- # Log each chunk with citation number but not full content
364- for i , chunk in enumerate (pdf_context ):
365- source = chunk ["metadata" ].get ("source" , "Unknown" )
366- pages = chunk ["metadata" ].get ("page_numbers" , [])
367- logger .info (f"Source [{ i + 1 } ]: { source } (pages: { pages } )" )
368- # Only log content preview at debug level
369- content_preview = chunk ["content" ][:150 ] + "..." if len (chunk ["content" ]) > 150 else chunk ["content" ]
370- logger .debug (f"Content preview for source [{ i + 1 } ]: { content_preview } " )
349+ # Don't log individual sources to keep console clean
371350 elif self .collection == "Repository Collection" :
372351 logger .info (f"Retrieving context from Repository Collection for query: '{ query } '" )
373352 repo_context = self .vector_store .query_repo_collection (query )
374353 logger .info (f"Retrieved { len (repo_context )} chunks from Repository Collection" )
375- # Log each chunk with citation number but not full content
376- for i , chunk in enumerate (repo_context ):
377- source = chunk ["metadata" ].get ("source" , "Unknown" )
378- file_path = chunk ["metadata" ].get ("file_path" , "Unknown" )
379- logger .info (f"Source [{ i + 1 } ]: { source } (file: { file_path } )" )
380- # Only log content preview at debug level
381- content_preview = chunk ["content" ][:150 ] + "..." if len (chunk ["content" ]) > 150 else chunk ["content" ]
382- logger .debug (f"Content preview for source [{ i + 1 } ]: { content_preview } " )
354+ # Don't log individual sources to keep console clean
383355
384356 # Combine all context
385357 all_context = pdf_context + repo_context
@@ -451,12 +423,9 @@ def _generate_response(self, query: str, context: List[Dict[str, Any]]) -> Dict[
451423
452424 # Print concise source information
453425 print ("\n Sources detected:" )
454- for source , details in sources .items ():
455- if isinstance (details , set ): # PDF with pages
456- pages = ", " .join (sorted (details ))
457- print (f"Document: { source } (pages: { pages } )" )
458- else : # Code with file path
459- print (f"Code file: { source } " )
426+ # Print a single line for each source without additional details
427+ for source in sources :
428+ print (f"- { source } " )
460429
461430 return {
462431 "answer" : response_text ,
0 commit comments