Documentation Index
Fetch the complete documentation index at: https://mintlify.com/pranavkrishnasuresh/chemAgent/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Thequery_chemistry.py module serves as the primary RAG (Retrieval-Augmented Generation) runner script that orchestrates the entire chemistry query pipeline. It integrates term extraction, PubChem data retrieval, and LLM response generation.
Functions
query_chemistry_related
The main entry point for processing chemistry-related queries through the RAG pipeline.The user’s chemistry question or query text to process
The generated LLM response based on PubChem context, or an error message if no relevant information is found
Pipeline Flow
The function executes a three-step RAG pipeline:- Term Extraction: Uses
extract_chemistry_terms()to identify chemistry-related terms from the query - Data Retrieval: Calls
fetch_pubchem_data()to retrieve relevant information from PubChem API - Response Generation: Invokes
generate_llm_response()to synthesize a contextual answer using the retrieved data
Example Usage
Return Behavior
Integration with ChemAgent
This function is called by the ChemAgent’s planning and execution workflow when:- A user query requires factual chemistry knowledge
- Chemical compound information needs to be retrieved
- The agent needs to augment its response with authoritative data from PubChem
Source Location
plan_execute_agent/pubchem_rag/query_chemistry.py:13