Upload 4 files
Browse filesFiles changed (4)
8 unmodified lines9101112131415145 unmodified lines161162163164165166167168169170171172173174175176177178179180181182183184185186187188449 unmodified lines6386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208212 unmodified lines8248258268278288298308318328338348358368 unmodified linesimport uuidfrom datetime import datetimefrom typing import Any, Dict, List, Literal, Optional, Tuplefrom urllib.parse import quoteimport httpxfrom pydantic import BaseModel, ConfigDict, Field145 unmodified lines)_URL_INSTRUCTION = ("IMPORTANT — URLS AND LINKS: ""You must ONLY include URLs that are explicitly present in the context or ""knowledge base provided to you, OR that appear in this fixed verified list of ""KU Library URLs: ""https://library.ku.ac.ae | ""https://library.ku.ac.ae/hours | ""https://library.ku.ac.ae/AskUs | ""https://library.ku.ac.ae/ill/ | ""https://library.ku.ac.ae/rooms/ | ""https://library.ku.ac.ae/eresources | ""https://library.ku.ac.ae/orcid | ""https://library.ku.ac.ae/oa/ | ""https://library.ku.ac.ae/alumni/ | ""https://library.ku.ac.ae/med/ | ""https://library.ku.ac.ae/requesttitle/ | ""https://library.ku.ac.ae/google | ""https://khazna.ku.ac.ae | ""https://khalifa.primo.exlibrisgroup.com/discovery/search?vid=971KUOSTAR_INST:KU | ""https://khalifa.primo.exlibrisgroup.com/discovery/account?vid=971KUOSTAR_INST:KU§ion=overview | ""https://kustar.libcal.com/calendar/events | ""https://ku-library.github.io/researchbee/. ""NEVER invent, guess, or construct URLs that are not in the above list or ""explicitly present in the provided context. ""When a relevant verified URL exists for your answer, ALWAYS include it as a "449 unmodified lines{{"corrected":"...","natural":"...","boolean":"(\"A\" OR \"B\") AND (\"C\" OR \"D\")","year_from":"","year_to":"","peer_reviewed":false,"open_access":false}}"""def _safe_db_url(url: str) -> str:from urllib.parse import quote as _quoteif "?url=" in url:base, inner = url.split("?url=", 1)return base + "?url=" + _quote(inner, safe="")return url_DB_SUBJECTS: Dict[str, List[Tuple[str, str, str]]] = {"physics": [("APS Journals", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://journals.aps.org"), "American Physical Society — core physics journals."),("AIP Publishing", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://pubs.aip.org"), "Core physics and applied physics literature."),("IOPScience", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://iopscience.iop.org"), "Core physics journal platform."),("arXiv", "https://arxiv.org", "Open-access preprints in physics and maths."),("ScienceDirect", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://www.sciencedirect.com"), "Full text across applied and interdisciplinary physics."),("Scopus", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://www.scopus.com"), "Discovery and citation tracking."),],"chemistry": [("ACS Publications", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://pubs.acs.org"), "Core chemistry journals from the American Chemical Society."),("SciFinder-n", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://scifinder-n.cas.org"), "Substance, reaction, reference, and patent searching."),("Reaxys", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://www.reaxys.com"), "Reaction and property searching."),("RSC Journals", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://pubs.rsc.org"), "Royal Society of Chemistry journals."),("ScienceDirect", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://www.sciencedirect.com"), "Full text chemistry journals and books."),("Scopus", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://www.scopus.com"), "Discovery and citation tracking."),],"chemical_engineering": [("ScienceDirect", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://www.sciencedirect.com"), "Strong full text for chemical engineering journals and books."),("ACS Publications", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://pubs.acs.org"), "Core chemistry and chemical engineering coverage."),("SciFinder-n", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://scifinder-n.cas.org"), "Chemical substances, reactions, references, and patents."),("Reaxys", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://www.reaxys.com"), "Reaction and property searching."),("Knovel", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://app.knovel.com"), "Engineering handbooks and technical reference data."),("Scopus", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://www.scopus.com"), "Broad discovery and citation tracking."),],"computer_science": [("ACM Digital Library", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://dl.acm.org"), "Core computer science literature."),("IEEE Xplore", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://ieeexplore.ieee.org"), "Strong for CS, AI, networks, and systems."),("arXiv", "https://arxiv.org", "Important preprint source for CS, AI, and ML."),("INSPEC", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://www.theiet.org/publishing/inspec"), "Indexing for computing and engineering topics."),("ScienceDirect", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://www.sciencedirect.com"), "Full text across CS and applied computing."),("Scopus", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://www.scopus.com"), "Broad discovery and citation tracking."),],"robotics": [("IEEE Xplore", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://ieeexplore.ieee.org"), "Core source for robotics, AI, automation, and intelligent systems."),("ACM Digital Library", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://dl.acm.org"), "AI, ML, and computing research."),("arXiv", "https://arxiv.org", "Essential for current AI, robotics, and ML preprints."),("INSPEC", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://www.theiet.org/publishing/inspec"), "Indexing for robotics, computing, electronics, and control."),("ScienceDirect", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://www.sciencedirect.com"), "Full text for AI, robotics, and applied engineering."),],"electrical_engineering": [("IEEE Xplore", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://ieeexplore.ieee.org"), "Core electrical engineering database."),("INSPEC", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://www.theiet.org/publishing/inspec"), "Strong indexing for EE, electronics, and physics."),("ScienceDirect", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://www.sciencedirect.com"), "Full text for electrical engineering and control."),("ASTM Compass", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://compass.astm.org"), "Standards and testing methods."),("Scopus", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://www.scopus.com"), "Broad discovery and citation tracking."),],"mechanical_engineering": [("ASME Digital Library", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://asmedigitalcollection.asme.org"), "Core mechanical engineering literature."),("ScienceDirect", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://www.sciencedirect.com"), "Full text across mechanics, thermal, and manufacturing topics."),("Knovel", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://app.knovel.com"), "Engineering reference data and handbooks."),("ASTM Compass", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://compass.astm.org"), "Standards and materials testing information."),("Scopus", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://www.scopus.com"), "Broad discovery and citation tracking."),],"civil_engineering": [("ASCE Library", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://ascelibrary.org"), "Core civil and structural engineering journals and conference papers."),("ICE Virtual Library", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://www.icevirtuallibrary.com"), "Civil engineering literature and proceedings."),("ASTM Compass", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://compass.astm.org"), "Standards and testing methods for materials and engineering."),("ScienceDirect", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://www.sciencedirect.com"), "Full text across civil engineering areas."),("Knovel", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://app.knovel.com"), "Handbooks and design reference data."),],"aerospace": [("AIAA", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://arc.aiaa.org/"), "Core aerospace journals, conference papers, and standards."),("ASME Digital Library", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://asmedigitalcollection.asme.org"), "Thermal, mechanical, and fluid systems relevant to aerospace."),("ScienceDirect", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://www.sciencedirect.com"), "Strong full text for aerospace, mechanics, and materials."),("IEEE Xplore", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://ieeexplore.ieee.org"), "Avionics, control systems, and guidance."),("Scopus", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://www.scopus.com"), "Broad discovery and citation tracking."),],"petroleum": [("OnePetro", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://onepetro.org"), "Core petroleum engineering and oil and gas literature."),("EarthDoc", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://www.earthdoc.org"), "Geoscience and petroleum-related literature."),("ScienceDirect", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://www.sciencedirect.com"), "Full text for petroleum, energy, and engineering topics."),("Knovel", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://app.knovel.com"), "Engineering handbooks and oil/gas reference material."),("Scopus", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://www.scopus.com"), "Broad discovery and citation tracking."),],"energy": [("ScienceDirect", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://www.sciencedirect.com"), "Strong energy engineering and sustainability full text."),("OnePetro", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://onepetro.org"), "Energy sector and petroleum crossover topics."),("IEEE Xplore", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://ieeexplore.ieee.org"), "Power systems, electrical energy, and smart grids."),("Knovel", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://app.knovel.com"), "Engineering handbooks and energy reference content."),("Scopus", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://www.scopus.com"), "Broad discovery and citation tracking."),],"mathematics": [("MathSciNet", "https://mathscinet.ams.org", "Core mathematics review and discovery database."),("SpringerLink", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://link.springer.com"), "Strong mathematics and statistics book and journal coverage."),("ScienceDirect", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://www.sciencedirect.com"), "Full text for mathematics, statistics, and data science."),("JSTOR", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://www.jstor.org"), "Foundational mathematics and statistics literature."),("arXiv", "https://arxiv.org", "Preprints in mathematics, statistics, and data science."),("Scopus", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://www.scopus.com"), "Broad discovery and citation tracking."),],"materials": [("ScienceDirect", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://www.sciencedirect.com"), "Strong materials science full text."),("SpringerLink", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://link.springer.com"), "Strong materials and nanoscience coverage."),("AIP Publishing", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://pubs.aip.org"), "Applied materials and physics crossover."),("IOPScience", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://iopscience.iop.org"), "Materials and physics crossover."),("Knovel", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://app.knovel.com"), "Reference data and engineering materials handbooks."),("Scopus", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://www.scopus.com"), "Broad discovery and citation tracking."),],"nuclear": [("ScienceDirect", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://www.sciencedirect.com"), "Strong nuclear engineering and energy full text."),("AIP Publishing", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://pubs.aip.org"), "Nuclear and applied physics crossover."),("Knovel", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://app.knovel.com"), "Engineering reference and handbooks."),("Scopus", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://www.scopus.com"), "Discovery and citation tracking."),("Web of Science", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://www.webofscience.com"), "Broad citation discovery."),],"quantum_computing": [("IEEE Xplore", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://ieeexplore.ieee.org"), "Quantum computing engineering implementations."),("ACM Digital Library", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://dl.acm.org"), "Algorithms, theory, and computing literature."),("APS Journals", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://journals.aps.org"), "Quantum information and foundational physics."),("arXiv", "https://arxiv.org", "Essential for current quantum computing preprints."),("Scopus", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://www.scopus.com"), "Discovery and citation tracking."),],"biomedical": [("PubMed", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://pubmed.ncbi.nlm.nih.gov"), "Core biomedical and life sciences literature."),("IEEE Xplore", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://ieeexplore.ieee.org"), "Biomedical engineering and medical devices."),("Embase", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://www.embase.com"), "Biomedical and pharmacological literature."),("ScienceDirect", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://www.sciencedirect.com"), "Full text for biomedical engineering and applied sciences."),("Scopus", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://www.scopus.com"), "Discovery and citation tracking."),],"biology": [("PubMed", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://pubmed.ncbi.nlm.nih.gov"), "Core life sciences and biomedical literature."),("ScienceDirect", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://www.sciencedirect.com"), "Full text biology and molecular sciences content."),("Embase", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://www.embase.com"), "Biomedical crossover topics."),("PubMed Central", "https://www.ncbi.nlm.nih.gov/pmc", "Open full-text biomedical articles — no login required."),("Scopus", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://www.scopus.com"), "Discovery and citation tracking."),],"medical": [("PubMed @ KU", "http://www.ncbi.nlm.nih.gov/pubmed/?otool=iaekustlib", "Core medical literature — use this KU link for full-text access."),("Embase", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://www.embase.com"), "Biomedical and pharmacological literature."),("CINAHL Ultimate", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://search.ebscohost.com/login.aspx?authtype=ip,uid&profile=ehost&defaultdb=cul"), "Nursing and allied health literature."),("Cochrane Library", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://www.cochranelibrary.com"), "Evidence synthesis and systematic reviews — gold standard."),("UpToDate", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://www.uptodate.com"), "Point-of-care clinical decision support."),("ClinicalKey Student", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://www.clinicalkey.com/student/login"), "Clinical reference and learning resource."),],"business": [("Business Source Complete", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://search.ebscohost.com"), "Core business and management literature."),("Emerald Insight", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://www.emerald.com/insight"), "Management, strategy, and leadership journals."),("ProQuest Databases", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://search.proquest.com"), "Broad business and interdisciplinary discovery."),("JSTOR", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://www.jstor.org"), "Business, economics, and policy literature."),("Scopus", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://www.scopus.com"), "Broad discovery and citation tracking."),],"earth_science": [("GeoscienceWorld", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://pubs.geoscienceworld.org"), "Core earth science journals and conference content."),("EarthDoc", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://www.earthdoc.org"), "Geoscience and subsurface literature."),("ScienceDirect", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://www.sciencedirect.com"), "Full text for geoscience and planetary topics."),("Scopus", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://www.scopus.com"), "Discovery and citation tracking."),("Web of Science", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://www.webofscience.com"), "Broad citation discovery."),],"environment": [("ScienceDirect", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://www.sciencedirect.com"), "Strong sustainability and environmental full text."),("ProQuest Databases", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://search.proquest.com"), "Environmental policy and interdisciplinary discovery."),("Web of Science", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://www.webofscience.com"), "Broad citation discovery."),("Scopus", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://www.scopus.com"), "Broad discovery and citation tracking."),("Business Source Complete", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://search.ebscohost.com"), "Sustainability, policy, and corporate responsibility."),],"engineering_management": [("Scopus", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://www.scopus.com"), "Broad discovery across engineering and management research."),("Emerald Insight", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://www.emerald.com/insight"), "Management, operations, and leadership literature."),("ScienceDirect", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://www.sciencedirect.com"), "Engineering and management full text."),("Business Source Complete", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://search.ebscohost.com"), "Business, management, and strategy literature."),("ProQuest Databases", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://search.proquest.com"), "Broad business and interdisciplinary discovery."),],"metrics": [("Journal Citation Reports", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://jcr.clarivate.com"), "Impact factors and journal rankings (Web of Science)."),("Scopus / CiteScore", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://www.scopus.com"), "CiteScore and source-level metrics."),("SciVal", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://www.scival.com"), "Research performance analytics."),("Web of Science", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://www.webofscience.com"), "Citation discovery and journal evaluation context."),],"theses": [("ProQuest Dissertations & Theses Global", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://www.proquest.com/pqdtglobal"), "International dissertations and theses."),("Khazna", "https://khazna.ku.ac.ae/", "KU institutional repository and research outputs."),("PRIMO", "https://khalifa.primo.exlibrisgroup.com/discovery/search?vid=971KUOSTAR_INST:KU", "Discovery for dissertations, theses, and KU holdings."),],2 unmodified lines_DB_GENERAL: List[Tuple[str, str, str]] = [("PRIMO (KU Library Discovery)", "https://khalifa.primo.exlibrisgroup.com/discovery/search?vid=971KUOSTAR_INST:KU", "Best starting point — search all KU books, articles, and journals."),("Scopus", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://www.scopus.com"), "Largest abstract and citation database — all disciplines."),("Web of Science", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://www.webofscience.com"), "Premier citation index — all disciplines."),("ScienceDirect", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://www.sciencedirect.com"), "Large full-text platform across science, engineering, and medicine."),("SpringerLink", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://link.springer.com"), "Springer journals and books across all disciplines."),("ProQuest Databases", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://search.proquest.com"), "Broad multidisciplinary discovery."),("Emerald Insight", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://www.emerald.com/insight"), "Social sciences, management, and interdisciplinary research."),("JSTOR", _safe_db_url("https://khalifa.idm.oclc.org/login?url=https://www.jstor.org"), "Foundational and archival literature across many fields."),]8 unmodified lines9101112131415145 unmodified lines161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193449 unmodified lines6436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268272 unmodified lines8308318328338348358368378388398408418428 unmodified linesimport uuidfrom datetime import datetimefrom typing import Any, Dict, List, Literal, Optional, Tuplefrom urllib.parse import quoteimport httpxfrom pydantic import BaseModel, ConfigDict, Field145 unmodified lines)FIXED_VERIFIED_URLS = ("https://library.ku.ac.ae","https://library.ku.ac.ae/hours","https://library.ku.ac.ae/AskUs","https://library.ku.ac.ae/ill/","https://library.ku.ac.ae/rooms/","https://library.ku.ac.ae/eresources","https://library.ku.ac.ae/orcid","https://library.ku.ac.ae/oa/","https://library.ku.ac.ae/alumni/","https://library.ku.ac.ae/med/","https://library.ku.ac.ae/requesttitle/","https://library.ku.ac.ae/google","https://khazna.ku.ac.ae","https://khalifa.primo.exlibrisgroup.com/discovery/search?vid=971KUOSTAR_INST:KU","https://khalifa.primo.exlibrisgroup.com/discovery/account?vid=971KUOSTAR_INST:KU§ion=overview","https://kustar.libcal.com/calendar/events","https://ku-library.github.io/researchbee/","mailto:libse@ku.ac.ae",)_URL_INSTRUCTION = ("IMPORTANT — URLS AND LINKS: ""You must ONLY include URLs that are explicitly present in the context or ""knowledge base provided to you, OR that appear in this fixed verified list of ""KU Library URLs: " + " | ".join(FIXED_VERIFIED_URLS) + ". ""NEVER invent, guess, or construct URLs that are not in the above list or ""explicitly present in the provided context. ""When a relevant verified URL exists for your answer, ALWAYS include it as a "449 unmodified lines{{"corrected":"...","natural":"...","boolean":"(\"A\" OR \"B\") AND (\"C\" OR \"D\")","year_from":"","year_to":"","peer_reviewed":false,"open_access":false}}"""OPENATHENS_REDIRECT_BASE = "https://go.openathens.net/redirector/ku.ac.ae?url="def _openathens_url(target: str) -> str:"""Build a KU OpenAthens redirect without double-encoding its target."""from urllib.parse import quote as _quotereturn OPENATHENS_REDIRECT_BASE + _quote(target, safe="")_DB_SUBJECTS: Dict[str, List[Tuple[str, str, str]]] = {"physics": [("APS Journals", _openathens_url("https://journals.aps.org"), "American Physical Society — core physics journals."),("AIP Publishing", _openathens_url("https://pubs.aip.org"), "Core physics and applied physics literature."),("IOPScience", _openathens_url("https://iopscience.iop.org"), "Core physics journal platform."),("arXiv", "https://arxiv.org", "Open-access preprints in physics and maths."),("ScienceDirect", _openathens_url("https://www.sciencedirect.com"), "Full text across applied and interdisciplinary physics."),("Scopus", _openathens_url("https://www.scopus.com"), "Discovery and citation tracking."),],"chemistry": [("ACS Publications", _openathens_url("https://pubs.acs.org"), "Core chemistry journals from the American Chemical Society."),("SciFinder-n", _openathens_url("https://scifinder-n.cas.org"), "Substance, reaction, reference, and patent searching."),("Reaxys", _openathens_url("https://www.reaxys.com"), "Reaction and property searching."),("RSC Journals", _openathens_url("https://pubs.rsc.org"), "Royal Society of Chemistry journals."),("ScienceDirect", _openathens_url("https://www.sciencedirect.com"), "Full text chemistry journals and books."),("Scopus", _openathens_url("https://www.scopus.com"), "Discovery and citation tracking."),],"chemical_engineering": [("ScienceDirect", _openathens_url("https://www.sciencedirect.com"), "Strong full text for chemical engineering journals and books."),("ACS Publications", _openathens_url("https://pubs.acs.org"), "Core chemistry and chemical engineering coverage."),("SciFinder-n", _openathens_url("https://scifinder-n.cas.org"), "Chemical substances, reactions, references, and patents."),("Reaxys", _openathens_url("https://www.reaxys.com"), "Reaction and property searching."),("Knovel", _openathens_url("https://app.knovel.com"), "Engineering handbooks and technical reference data."),("Scopus", _openathens_url("https://www.scopus.com"), "Broad discovery and citation tracking."),],"computer_science": [("ACM Digital Library", _openathens_url("https://dl.acm.org"), "Core computer science literature."),("IEEE Xplore", _openathens_url("https://ieeexplore.ieee.org"), "Strong for CS, AI, networks, and systems."),("arXiv", "https://arxiv.org", "Important preprint source for CS, AI, and ML."),("INSPEC", _openathens_url("https://www.theiet.org/publishing/inspec"), "Indexing for computing and engineering topics."),("ScienceDirect", _openathens_url("https://www.sciencedirect.com"), "Full text across CS and applied computing."),("Scopus", _openathens_url("https://www.scopus.com"), "Broad discovery and citation tracking."),],"robotics": [("IEEE Xplore", _openathens_url("https://ieeexplore.ieee.org"), "Core source for robotics, AI, automation, and intelligent systems."),("ACM Digital Library", _openathens_url("https://dl.acm.org"), "AI, ML, and computing research."),("arXiv", "https://arxiv.org", "Essential for current AI, robotics, and ML preprints."),("INSPEC", _openathens_url("https://www.theiet.org/publishing/inspec"), "Indexing for robotics, computing, electronics, and control."),("ScienceDirect", _openathens_url("https://www.sciencedirect.com"), "Full text for AI, robotics, and applied engineering."),],"electrical_engineering": [("IEEE Xplore", _openathens_url("https://ieeexplore.ieee.org"), "Core electrical engineering database."),("INSPEC", _openathens_url("https://www.theiet.org/publishing/inspec"), "Strong indexing for EE, electronics, and physics."),("ScienceDirect", _openathens_url("https://www.sciencedirect.com"), "Full text for electrical engineering and control."),("ASTM Compass", _openathens_url("https://compass.astm.org"), "Standards and testing methods."),("Scopus", _openathens_url("https://www.scopus.com"), "Broad discovery and citation tracking."),],"mechanical_engineering": [("ASME Digital Library", _openathens_url("https://asmedigitalcollection.asme.org"), "Core mechanical engineering literature."),("ScienceDirect", _openathens_url("https://www.sciencedirect.com"), "Full text across mechanics, thermal, and manufacturing topics."),("Knovel", _openathens_url("https://app.knovel.com"), "Engineering reference data and handbooks."),("ASTM Compass", _openathens_url("https://compass.astm.org"), "Standards and materials testing information."),("Scopus", _openathens_url("https://www.scopus.com"), "Broad discovery and citation tracking."),],"civil_engineering": [("ASCE Library", _openathens_url("https://ascelibrary.org"), "Core civil and structural engineering journals and conference papers."),("ICE Virtual Library", _openathens_url("https://www.icevirtuallibrary.com"), "Civil engineering literature and proceedings."),("ASTM Compass", _openathens_url("https://compass.astm.org"), "Standards and testing methods for materials and engineering."),("ScienceDirect", _openathens_url("https://www.sciencedirect.com"), "Full text across civil engineering areas."),("Knovel", _openathens_url("https://app.knovel.com"), "Handbooks and design reference data."),],"aerospace": [("AIAA", _openathens_url("https://arc.aiaa.org/"), "Core aerospace journals, conference papers, and standards."),("ASME Digital Library", _openathens_url("https://asmedigitalcollection.asme.org"), "Thermal, mechanical, and fluid systems relevant to aerospace."),("ScienceDirect", _openathens_url("https://www.sciencedirect.com"), "Strong full text for aerospace, mechanics, and materials."),("IEEE Xplore", _openathens_url("https://ieeexplore.ieee.org"), "Avionics, control systems, and guidance."),("Scopus", _openathens_url("https://www.scopus.com"), "Broad discovery and citation tracking."),],"petroleum": [("OnePetro", _openathens_url("https://onepetro.org"), "Core petroleum engineering and oil and gas literature."),("EarthDoc", _openathens_url("https://www.earthdoc.org"), "Geoscience and petroleum-related literature."),("ScienceDirect", _openathens_url("https://www.sciencedirect.com"), "Full text for petroleum, energy, and engineering topics."),("Knovel", _openathens_url("https://app.knovel.com"), "Engineering handbooks and oil/gas reference material."),("Scopus", _openathens_url("https://www.scopus.com"), "Broad discovery and citation tracking."),],"energy": [("ScienceDirect", _openathens_url("https://www.sciencedirect.com"), "Strong energy engineering and sustainability full text."),("OnePetro", _openathens_url("https://onepetro.org"), "Energy sector and petroleum crossover topics."),("IEEE Xplore", _openathens_url("https://ieeexplore.ieee.org"), "Power systems, electrical energy, and smart grids."),("Knovel", _openathens_url("https://app.knovel.com"), "Engineering handbooks and energy reference content."),("Scopus", _openathens_url("https://www.scopus.com"), "Broad discovery and citation tracking."),],"mathematics": [("MathSciNet", "https://mathscinet.ams.org", "Core mathematics review and discovery database."),("SpringerLink", _openathens_url("https://link.springer.com"), "Strong mathematics and statistics book and journal coverage."),("ScienceDirect", _openathens_url("https://www.sciencedirect.com"), "Full text for mathematics, statistics, and data science."),("JSTOR", _openathens_url("https://www.jstor.org"), "Foundational mathematics and statistics literature."),("arXiv", "https://arxiv.org", "Preprints in mathematics, statistics, and data science."),("Scopus", _openathens_url("https://www.scopus.com"), "Broad discovery and citation tracking."),],"materials": [("ScienceDirect", _openathens_url("https://www.sciencedirect.com"), "Strong materials science full text."),("SpringerLink", _openathens_url("https://link.springer.com"), "Strong materials and nanoscience coverage."),("AIP Publishing", _openathens_url("https://pubs.aip.org"), "Applied materials and physics crossover."),("IOPScience", _openathens_url("https://iopscience.iop.org"), "Materials and physics crossover."),("Knovel", _openathens_url("https://app.knovel.com"), "Reference data and engineering materials handbooks."),("Scopus", _openathens_url("https://www.scopus.com"), "Broad discovery and citation tracking."),],"nuclear": [("ScienceDirect", _openathens_url("https://www.sciencedirect.com"), "Strong nuclear engineering and energy full text."),("AIP Publishing", _openathens_url("https://pubs.aip.org"), "Nuclear and applied physics crossover."),("Knovel", _openathens_url("https://app.knovel.com"), "Engineering reference and handbooks."),("Scopus", _openathens_url("https://www.scopus.com"), "Discovery and citation tracking."),("Web of Science", _openathens_url("https://www.webofscience.com"), "Broad citation discovery."),],"quantum_computing": [("IEEE Xplore", _openathens_url("https://ieeexplore.ieee.org"), "Quantum computing engineering implementations."),("ACM Digital Library", _openathens_url("https://dl.acm.org"), "Algorithms, theory, and computing literature."),("APS Journals", _openathens_url("https://journals.aps.org"), "Quantum information and foundational physics."),("arXiv", "https://arxiv.org", "Essential for current quantum computing preprints."),("Scopus", _openathens_url("https://www.scopus.com"), "Discovery and citation tracking."),],"biomedical": [("PubMed", _openathens_url("https://pubmed.ncbi.nlm.nih.gov"), "Core biomedical and life sciences literature."),("IEEE Xplore", _openathens_url("https://ieeexplore.ieee.org"), "Biomedical engineering and medical devices."),("Embase", _openathens_url("https://www.embase.com"), "Biomedical and pharmacological literature."),("ScienceDirect", _openathens_url("https://www.sciencedirect.com"), "Full text for biomedical engineering and applied sciences."),("Scopus", _openathens_url("https://www.scopus.com"), "Discovery and citation tracking."),],"biology": [("PubMed", _openathens_url("https://pubmed.ncbi.nlm.nih.gov"), "Core life sciences and biomedical literature."),("ScienceDirect", _openathens_url("https://www.sciencedirect.com"), "Full text biology and molecular sciences content."),("Embase", _openathens_url("https://www.embase.com"), "Biomedical crossover topics."),("PubMed Central", "https://www.ncbi.nlm.nih.gov/pmc", "Open full-text biomedical articles — no login required."),("Scopus", _openathens_url("https://www.scopus.com"), "Discovery and citation tracking."),],"medical": [("PubMed", "https://pubmed.ncbi.nlm.nih.gov/", "Core biomedical and life-sciences literature."),("Embase", _openathens_url("https://www.embase.com"), "Biomedical and pharmacological literature."),("CINAHL Ultimate", _openathens_url("https://search.ebscohost.com/login.aspx?authtype=ip,uid&profile=ehost&defaultdb=cul"), "Nursing and allied health literature."),("Cochrane Library", _openathens_url("https://www.cochranelibrary.com"), "Evidence synthesis and systematic reviews — gold standard."),("UpToDate", _openathens_url("https://www.uptodate.com"), "Point-of-care clinical decision support."),("ClinicalKey Student", _openathens_url("https://www.clinicalkey.com/student/login"), "Clinical reference and learning resource."),],"business": [("Business Source Complete", _openathens_url("https://search.ebscohost.com"), "Core business and management literature."),("Emerald Insight", _openathens_url("https://www.emerald.com/insight"), "Management, strategy, and leadership journals."),("ProQuest Databases", _openathens_url("https://search.proquest.com"), "Broad business and interdisciplinary discovery."),("JSTOR", _openathens_url("https://www.jstor.org"), "Business, economics, and policy literature."),("Scopus", _openathens_url("https://www.scopus.com"), "Broad discovery and citation tracking."),],"earth_science": [("GeoscienceWorld", _openathens_url("https://pubs.geoscienceworld.org"), "Core earth science journals and conference content."),("EarthDoc", _openathens_url("https://www.earthdoc.org"), "Geoscience and subsurface literature."),("ScienceDirect", _openathens_url("https://www.sciencedirect.com"), "Full text for geoscience and planetary topics."),("Scopus", _openathens_url("https://www.scopus.com"), "Discovery and citation tracking."),("Web of Science", _openathens_url("https://www.webofscience.com"), "Broad citation discovery."),],"environment": [("ScienceDirect", _openathens_url("https://www.sciencedirect.com"), "Strong sustainability and environmental full text."),("ProQuest Databases", _openathens_url("https://search.proquest.com"), "Environmental policy and interdisciplinary discovery."),("Web of Science", _openathens_url("https://www.webofscience.com"), "Broad citation discovery."),("Scopus", _openathens_url("https://www.scopus.com"), "Broad discovery and citation tracking."),("Business Source Complete", _openathens_url("https://search.ebscohost.com"), "Sustainability, policy, and corporate responsibility."),],"engineering_management": [("Scopus", _openathens_url("https://www.scopus.com"), "Broad discovery across engineering and management research."),("Emerald Insight", _openathens_url("https://www.emerald.com/insight"), "Management, operations, and leadership literature."),("ScienceDirect", _openathens_url("https://www.sciencedirect.com"), "Engineering and management full text."),("Business Source Complete", _openathens_url("https://search.ebscohost.com"), "Business, management, and strategy literature."),("ProQuest Databases", _openathens_url("https://search.proquest.com"), "Broad business and interdisciplinary discovery."),],"metrics": [("Journal Citation Reports", _openathens_url("https://jcr.clarivate.com"), "Impact factors and journal rankings (Web of Science)."),("Scopus / CiteScore", _openathens_url("https://www.scopus.com"), "CiteScore and source-level metrics."),("SciVal", _openathens_url("https://www.scival.com"), "Research performance analytics."),("Web of Science", _openathens_url("https://www.webofscience.com"), "Citation discovery and journal evaluation context."),],"theses": [("ProQuest Dissertations & Theses Global", _openathens_url("https://www.proquest.com/pqdtglobal"), "International dissertations and theses."),("Khazna", "https://khazna.ku.ac.ae/", "KU institutional repository and research outputs."),("PRIMO", "https://khalifa.primo.exlibrisgroup.com/discovery/search?vid=971KUOSTAR_INST:KU", "Discovery for dissertations, theses, and KU holdings."),],2 unmodified lines_DB_GENERAL: List[Tuple[str, str, str]] = [("PRIMO (KU Library Discovery)", "https://khalifa.primo.exlibrisgroup.com/discovery/search?vid=971KUOSTAR_INST:KU", "Best starting point — search all KU books, articles, and journals."),("Scopus", _openathens_url("https://www.scopus.com"), "Largest abstract and citation database — all disciplines."),("Web of Science", _openathens_url("https://www.webofscience.com"), "Premier citation index — all disciplines."),("ScienceDirect", _openathens_url("https://www.sciencedirect.com"), "Large full-text platform across science, engineering, and medicine."),("SpringerLink", _openathens_url("https://link.springer.com"), "Springer journals and books across all disciplines."),("ProQuest Databases", _openathens_url("https://search.proquest.com"), "Broad multidisciplinary discovery."),("Emerald Insight", _openathens_url("https://www.emerald.com/insight"), "Social sciences, management, and interdisciplinary research."),("JSTOR", _openathens_url("https://www.jstor.org"), "Foundational and archival literature across many fields."),]
24 unmodified lines25262728293031323334353637384 unmodified lines4344454647484932 unmodified lines828384858687888914 unmodified lines104105106107108109110120 unmodified lines23123223323423523623724 unmodified lines)from src.agentcore.models import ChatMessagefrom src.agentcore.constants import (ASK_LIBRARIAN_URL,DATABASE_RECOMMEND_RE,_DB_GENERAL,_DB_SUBJECTS,_GUARDRAIL,_URL_INSTRUCTION,)from src.agentcore.utils import (_build_history_messages,_escape,4 unmodified lines)from src.agentcore.classify import _looks_library_hours_questionlogger = logging.getLogger(__name__)def _campus_answer() -> str:return (32 unmodified linessystem = ("You are LibBee, the Khalifa University Library AI Assistant. ""Answer the user's question using ONLY the context provided below. ""Be concise, friendly, and use HTML <br> for line breaks where needed. ""IMPORTANT — LINKS: When the context contains a URL (starting with https:// or http://), ""include it as a clickable HTML link using <a href=\"URL\" target=\"_blank\">link text</a>. ""For example, if context mentions 'library.ku.ac.ae/ill/' include it as a link. ""NEVER invent or guess URLs that do not appear in the context. "14 unmodified linesmsgs.extend(_build_history_messages(history))msgs.append({"role": "user", "content": question})response = await llm.ainvoke(msgs)return response.content.strip()except Exception as e:logger.error(f"_rag_answer error: {e}")return (120 unmodified lines"<strong>ProQuest Dissertations & Theses Global</strong><br>""KU subscribes to ProQuest D&T Global — the world's largest database of ""theses and dissertations from universities worldwide.<br>"'🔗 <a href="https://khalifa.idm.oclc.org/login?url=https://www.proquest.com/pqdtglobal" target="_blank">'"Access via KU Library</a><br><br>""<strong>Other sources</strong><br>"'• <a href="https://ethos.bl.uk" target="_blank">EThOS</a> — UK theses (British Library)<br>'24 unmodified lines252627282930313233343536373839404 unmodified lines4546474849505152535455565758596061626364656667686932 unmodified lines10210310410510610710810911014 unmodified lines125126127128129130131120 unmodified lines25225325425525625725824 unmodified lines)from src.agentcore.models import ChatMessagefrom src.agentcore.constants import (ASK_LIBRARIAN_URL,DATABASE_RECOMMEND_RE,FIXED_VERIFIED_URLS,_DB_GENERAL,_DB_SUBJECTS,_GUARDRAIL,_URL_INSTRUCTION,)from src.services.html_sanitizer import markdown_to_safe_html, sanitize_answer_htmlfrom src.agentcore.utils import (_build_history_messages,_escape,4 unmodified lines)from src.agentcore.classify import _looks_library_hours_questionlogger = logging.getLogger(__name__)_CONTEXT_URL_RE = re.compile(r"(?:https?://|mailto:|tel:)[^\s<>\"']+")def _verified_rag_urls(context: str) -> set[str]:"""Return the exact URLs a knowledge-base answer is allowed to emit."""urls = set(FIXED_VERIFIED_URLS)for match in _CONTEXT_URL_RE.findall(context or ""):candidate = html.unescape(match).rstrip(".,;:!?)]}")if candidate:urls.add(candidate)return urlsdef _prepare_rag_answer(answer: str, context: str) -> str:"""Normalize LLM formatting and enforce the KB URL allow-list in code."""normalized = markdown_to_safe_html(answer)return sanitize_answer_html(normalized, allowed_urls=_verified_rag_urls(context))def _campus_answer() -> str:return (32 unmodified linessystem = ("You are LibBee, the Khalifa University Library AI Assistant. ""Answer the user's question using ONLY the context provided below. ""Be concise, friendly, and use HTML <br> for line breaks where needed. ""Return sanitized HTML, not Markdown. Never use **bold**, # headings, or [text](URL). ""IMPORTANT — LINKS: When the context contains a URL starting with https://, ""include it as a clickable HTML link using <a href=\"URL\" target=\"_blank\">link text</a>. ""For example, if context mentions 'library.ku.ac.ae/ill/' include it as a link. ""NEVER invent or guess URLs that do not appear in the context. "14 unmodified linesmsgs.extend(_build_history_messages(history))msgs.append({"role": "user", "content": question})response = await llm.ainvoke(msgs)return _prepare_rag_answer(response.content.strip(), context)except Exception as e:logger.error(f"_rag_answer error: {e}")return (120 unmodified lines"<strong>ProQuest Dissertations & Theses Global</strong><br>""KU subscribes to ProQuest D&T Global — the world's largest database of ""theses and dissertations from universities worldwide.<br>"'🔗 <a href="https://go.openathens.net/redirector/ku.ac.ae?url=https%3A%2F%2Fwww.proquest.com%2Fpqdtglobal" target="_blank">'"Access via KU Library</a><br><br>""<strong>Other sources</strong><br>"'• <a href="https://ethos.bl.uk" target="_blank">EThOS</a> — UK theses (British Library)<br>'
497 unmodified lines49849950050150250350416 unmodified lines52152252352452552652718 unmodified lines546547548549550551552497 unmodified lines"This gives you foundational and seminal works on the topic.<br><br>""<strong>Forward citation (who has cited this paper since publication?)</strong><br>""Use these tools — paste in the DOI or title:<br>"'• <a href="https://www-scopus-com.khalifa.idm.oclc.org/pages/ai" target="_blank"><strong>Scopus</strong></a> ''— search the article, then click "Cited by N documents"<br>''• <a href="https://www.webofscience.com" target="_blank"><strong>Web of Science</strong></a> ''— search the article, click "Times Cited"<br>'16 unmodified lines"• Check the journal's website for a peer-review statement or editorial process description<br>""• In PRIMO, tick the <em>Peer-reviewed</em> filter in the left sidebar<br>""• Check if the journal is indexed in "'<a href="https://www-scopus-com.khalifa.idm.oclc.org" target="_blank">Scopus</a> or ''<a href="https://www.webofscience.com" target="_blank">Web of Science</a> — '"indexed = generally peer-reviewed<br><br>""<strong>Is it a legitimate journal?</strong><br>"18 unmodified linesreturn (f"<br><br><strong>📊 Finding highly cited papers on {topic_escaped}</strong><br>""PRIMO doesn't sort by citation count, but these tools do:<br>"'• <a href="https://www-scopus-com.khalifa.idm.oclc.org" target="_blank"><strong>Scopus</strong></a> ''— search your topic → Sort by <em>Cited by (highest)</em><br>''• <a href="https://www.webofscience.com" target="_blank"><strong>Web of Science</strong></a> ''— search → Sort by <em>Times Cited</em><br>'497 unmodified lines49849950050150250350416 unmodified lines52152252352452552652718 unmodified lines546547548549550551552497 unmodified lines"This gives you foundational and seminal works on the topic.<br><br>""<strong>Forward citation (who has cited this paper since publication?)</strong><br>""Use these tools — paste in the DOI or title:<br>"'• <a href="https://go.openathens.net/redirector/ku.ac.ae?url=https%3A%2F%2Fwww.scopus.com%2Fpages%2Fai" target="_blank"><strong>Scopus</strong></a> ''— search the article, then click "Cited by N documents"<br>''• <a href="https://www.webofscience.com" target="_blank"><strong>Web of Science</strong></a> ''— search the article, click "Times Cited"<br>'16 unmodified lines"• Check the journal's website for a peer-review statement or editorial process description<br>""• In PRIMO, tick the <em>Peer-reviewed</em> filter in the left sidebar<br>""• Check if the journal is indexed in "'<a href="https://go.openathens.net/redirector/ku.ac.ae?url=https%3A%2F%2Fwww.scopus.com" target="_blank">Scopus</a> or ''<a href="https://www.webofscience.com" target="_blank">Web of Science</a> — '"indexed = generally peer-reviewed<br><br>""<strong>Is it a legitimate journal?</strong><br>"18 unmodified linesreturn (f"<br><br><strong>📊 Finding highly cited papers on {topic_escaped}</strong><br>""PRIMO doesn't sort by citation count, but these tools do:<br>"'• <a href="https://go.openathens.net/redirector/ku.ac.ae?url=https%3A%2F%2Fwww.scopus.com" target="_blank"><strong>Scopus</strong></a> ''— search your topic → Sort by <em>Cited by (highest)</em><br>''• <a href="https://www.webofscience.com" target="_blank"><strong>Web of Science</strong></a> ''— search → Sort by <em>Times Cited</em><br>'
24 unmodified lines2526272829303133 unmodified lines656667686970717273171 unmodified lines245246247248249250251252253254255256257258248 unmodified lines50750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057124 unmodified lines)from src.agentcore.models import SearchContextPayloadfrom src.agentcore.constants import ASK_LIBRARIAN_URL, PRIMO_AI_URLfrom src.agentcore.utils import (_escape,_find_staff_by_token,33 unmodified linesprimo_ai_query = quote(context.ai_tool_query or context.display_topic or context.topic)urls: Dict[str, str] = {"leapspace": f"https://www.sciencedirect.com/leapspace?query={ai_query}","scopus_ai": f"https://www-scopus-com.khalifa.idm.oclc.org/pages/ai?query={ai_query}","ebsco_ai": (f"https://research-ebsco-com.khalifa.idm.oclc.org/c/yst6t2/search/results"f"?q={ai_query}"f"&autocorrect=y"f"&expanders=concept"171 unmodified linescontext.topic, context.year_from, context.year_to, context.peer_reviewed) if is_med else ""KU = "https://khalifa.idm.oclc.org/login?url="platforms = [("PRIMO AI Assistant", primo_ai, "primo"),("LeapSpace", "https://www.sciencedirect.com/leapspace?query=" + ai_q, "leapspace"),("Scopus AI", "https://www-scopus-com.khalifa.idm.oclc.org/pages/ai?query=" + ai_q, "scopus"),("EBSCO Research AI","https://research-ebsco-com.khalifa.idm.oclc.org/c/yst6t2/search/results?q=" + ai_q+ "&autocorrect=y&expanders=concept&limiters=None&searchMode=enhanced&searchSegment=all-results", "ebsco"),("Consensus", "https://consensus.app/results/?q=" + ai_q, "consensus"),("Semantic Scholar", "https://www.semanticscholar.org/search?q=" + ai_q + "&sort=relevance", "semanticscholar"),248 unmodified linesif any(k in all_lower for k in ["medicine","medical","clinical","nursing","pharmacy","health","pubmed","embase","cinahl","cochrane","uptodate"]):db_subject = "Medicine & Health Sciences"dbs = [("PubMed@KU","http://www.ncbi.nlm.nih.gov/pubmed/?otool=iaekustlib","Core biomedical literature"),("Embase",KU+"https://www.embase.com","Biomedical, drugs, devices, clinical medicine"),("CINAHL Ultimate",KU+"https://search.ebscohost.com/login.aspx?authtype=ip,uid&profile=ehost&defaultdb=cul","Nursing and allied health"),("Cochrane Library",KU+"https://www.cochranelibrary.com","Systematic reviews and evidence-based medicine"),("UpToDate",KU+"https://www.uptodate.com","Point-of-care clinical decision support"),]elif any(k in all_lower for k in ["machine learning","deep learning","artificial intelligence","neural network","computer science","software","algorithm","cybersecurity","robotics","nlp"]):db_subject = "Computer Science & AI"dbs = [("IEEE Xplore",KU+"https://ieeexplore.ieee.org","Core CS, AI, electronics and systems"),("ACM Digital Library",KU+"https://dl.acm.org","Computer science journals, proceedings and books"),("ScienceDirect",KU+"https://www.sciencedirect.com","Full text across CS and applied computing"),("Scopus",KU+"https://www.scopus.com","Discovery and citation tracking"),("Web of Science",KU+"https://www.webofscience.com","Citation index"),]elif any(k in all_lower for k in ["climate","global warming","environment","sustainability","ecology","carbon","emission","renewable","sea level","maldives","island"]):db_subject = "Environment & Climate"dbs = [("ScienceDirect",KU+"https://www.sciencedirect.com","Full text across science, environment and engineering"),("Scopus",KU+"https://www.scopus.com","Broad discovery and citation tracking"),("Web of Science",KU+"https://www.webofscience.com","High-impact journal coverage and citation index"),("SpringerLink",KU+"https://link.springer.com","Springer journals and books"),]elif any(k in all_lower for k in ["engineering","mechanical","civil","electrical","aerospace","structural","petroleum","chemical","materials"]):db_subject = "Engineering"dbs = [("IEEE Xplore",KU+"https://ieeexplore.ieee.org","Electrical, electronics and systems engineering"),("ScienceDirect",KU+"https://www.sciencedirect.com","Full text across engineering disciplines"),("Knovel",KU+"https://app.knovel.com","Engineering handbooks and reference data"),("Scopus",KU+"https://www.scopus.com","Discovery and citation tracking"),("Web of Science",KU+"https://www.webofscience.com","Citation index"),]elif any(k in all_lower for k in ["business","management","finance","economics","leadership","marketing","strategy","entrepreneurship"]):db_subject = "Business & Management"dbs = [("Business Source Complete",KU+"https://search.ebscohost.com","Core business and management literature"),("Emerald Insight",KU+"https://www.emerald.com/insight","Management, strategy and leadership"),("Scopus",KU+"https://www.scopus.com","Broad discovery and citation tracking"),("ScienceDirect",KU+"https://www.sciencedirect.com","Business and social sciences full text"),]elif any(k in all_lower for k in ["physics","chemistry","quantum","nuclear","materials science","nanotechnology","optics"]):db_subject = "Physics, Chemistry & Materials"dbs = [("ScienceDirect",KU+"https://www.sciencedirect.com","Full text across physical sciences"),("ACS Publications",KU+"https://pubs.acs.org","Core chemistry and chemical engineering"),("APS Journals",KU+"https://journals.aps.org","American Physical Society core physics journals"),("Scopus",KU+"https://www.scopus.com","Discovery and citation tracking"),("Web of Science",KU+"https://www.webofscience.com","Citation index"),]else:db_subject = "General"dbs = [("EBSCO",KU+"https://search.ebscohost.com","Multidisciplinary full text"),("ScienceDirect",KU+"https://www.sciencedirect.com","Science, engineering and medicine"),("SpringerLink",KU+"https://link.springer.com","Journals and books across all disciplines"),("Taylor & Francis",KU+"https://www.tandfonline.com","Humanities, social sciences and STEM"),("Emerald Insight",KU+"https://www.emerald.com/insight","Management and social sciences"),("Scopus",KU+"https://www.scopus.com","Citation discovery, all disciplines"),("Web of Science",KU+"https://www.webofscience.com","Citation index, all disciplines"),]dbs_html_rows = ""24 unmodified lines2526272829303133 unmodified lines656667686970717273171 unmodified lines245246247248249250251252253254255256248 unmodified lines50550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856924 unmodified lines)from src.agentcore.models import SearchContextPayloadfrom src.agentcore.constants import ASK_LIBRARIAN_URL, PRIMO_AI_URL, _openathens_urlfrom src.agentcore.utils import (_escape,_find_staff_by_token,33 unmodified linesprimo_ai_query = quote(context.ai_tool_query or context.display_topic or context.topic)urls: Dict[str, str] = {"leapspace": f"https://www.sciencedirect.com/leapspace?query={ai_query}","scopus_ai": _openathens_url(f"https://www.scopus.com/pages/ai?query={ai_query}"),"ebsco_ai": (f"https://research.ebsco.com/c/yst6t2/search/results"f"?q={ai_query}"f"&autocorrect=y"f"&expanders=concept"171 unmodified linescontext.topic, context.year_from, context.year_to, context.peer_reviewed) if is_med else ""platforms = [("PRIMO AI Assistant", primo_ai, "primo"),("LeapSpace", "https://www.sciencedirect.com/leapspace?query=" + ai_q, "leapspace"),("Scopus AI", _openathens_url("https://www.scopus.com/pages/ai?query=" + ai_q), "scopus"),("EBSCO Research AI","https://research.ebsco.com/c/yst6t2/search/results?q=" + ai_q+ "&autocorrect=y&expanders=concept&limiters=None&searchMode=enhanced&searchSegment=all-results", "ebsco"),("Consensus", "https://consensus.app/results/?q=" + ai_q, "consensus"),("Semantic Scholar", "https://www.semanticscholar.org/search?q=" + ai_q + "&sort=relevance", "semanticscholar"),248 unmodified linesif any(k in all_lower for k in ["medicine","medical","clinical","nursing","pharmacy","health","pubmed","embase","cinahl","cochrane","uptodate"]):db_subject = "Medicine & Health Sciences"dbs = [("PubMed","https://pubmed.ncbi.nlm.nih.gov/","Core biomedical literature"),("Embase",_openathens_url("https://www.embase.com"),"Biomedical, drugs, devices, clinical medicine"),("CINAHL Ultimate",_openathens_url("https://search.ebscohost.com/login.aspx?authtype=ip,uid&profile=ehost&defaultdb=cul"),"Nursing and allied health"),("Cochrane Library",_openathens_url("https://www.cochranelibrary.com"),"Systematic reviews and evidence-based medicine"),("UpToDate",_openathens_url("https://www.uptodate.com"),"Point-of-care clinical decision support"),]elif any(k in all_lower for k in ["machine learning","deep learning","artificial intelligence","neural network","computer science","software","algorithm","cybersecurity","robotics","nlp"]):db_subject = "Computer Science & AI"dbs = [("IEEE Xplore",_openathens_url("https://ieeexplore.ieee.org"),"Core CS, AI, electronics and systems"),("ACM Digital Library",_openathens_url("https://dl.acm.org"),"Computer science journals, proceedings and books"),("ScienceDirect",_openathens_url("https://www.sciencedirect.com"),"Full text across CS and applied computing"),("Scopus",_openathens_url("https://www.scopus.com"),"Discovery and citation tracking"),("Web of Science",_openathens_url("https://www.webofscience.com"),"Citation index"),]elif any(k in all_lower for k in ["climate","global warming","environment","sustainability","ecology","carbon","emission","renewable","sea level","maldives","island"]):db_subject = "Environment & Climate"dbs = [("ScienceDirect",_openathens_url("https://www.sciencedirect.com"),"Full text across science, environment and engineering"),("Scopus",_openathens_url("https://www.scopus.com"),"Broad discovery and citation tracking"),("Web of Science",_openathens_url("https://www.webofscience.com"),"High-impact journal coverage and citation index"),("SpringerLink",_openathens_url("https://link.springer.com"),"Springer journals and books"),]elif any(k in all_lower for k in ["engineering","mechanical","civil","electrical","aerospace","structural","petroleum","chemical","materials"]):db_subject = "Engineering"dbs = [("IEEE Xplore",_openathens_url("https://ieeexplore.ieee.org"),"Electrical, electronics and systems engineering"),("ScienceDirect",_openathens_url("https://www.sciencedirect.com"),"Full text across engineering disciplines"),("Knovel",_openathens_url("https://app.knovel.com"),"Engineering handbooks and reference data"),("Scopus",_openathens_url("https://www.scopus.com"),"Discovery and citation tracking"),("Web of Science",_openathens_url("https://www.webofscience.com"),"Citation index"),]elif any(k in all_lower for k in ["business","management","finance","economics","leadership","marketing","strategy","entrepreneurship"]):db_subject = "Business & Management"dbs = [("Business Source Complete",_openathens_url("https://search.ebscohost.com"),"Core business and management literature"),("Emerald Insight",_openathens_url("https://www.emerald.com/insight"),"Management, strategy and leadership"),("Scopus",_openathens_url("https://www.scopus.com"),"Broad discovery and citation tracking"),("ScienceDirect",_openathens_url("https://www.sciencedirect.com"),"Business and social sciences full text"),]elif any(k in all_lower for k in ["physics","chemistry","quantum","nuclear","materials science","nanotechnology","optics"]):db_subject = "Physics, Chemistry & Materials"dbs = [("ScienceDirect",_openathens_url("https://www.sciencedirect.com"),"Full text across physical sciences"),("ACS Publications",_openathens_url("https://pubs.acs.org"),"Core chemistry and chemical engineering"),("APS Journals",_openathens_url("https://journals.aps.org"),"American Physical Society core physics journals"),("Scopus",_openathens_url("https://www.scopus.com"),"Discovery and citation tracking"),("Web of Science",_openathens_url("https://www.webofscience.com"),"Citation index"),]else:db_subject = "General"dbs = [("EBSCO",_openathens_url("https://search.ebscohost.com"),"Multidisciplinary full text"),("ScienceDirect",_openathens_url("https://www.sciencedirect.com"),"Science, engineering and medicine"),("SpringerLink",_openathens_url("https://link.springer.com"),"Journals and books across all disciplines"),("Taylor & Francis",_openathens_url("https://www.tandfonline.com"),"Humanities, social sciences and STEM"),("Emerald Insight",_openathens_url("https://www.emerald.com/insight"),"Management and social sciences"),("Scopus",_openathens_url("https://www.scopus.com"),"Citation discovery, all disciplines"),("Web of Science",_openathens_url("https://www.webofscience.com"),"Citation index, all disciplines"),]dbs_html_rows = ""
src/agentcore/constants.py+157-151
src/agentcore/intents_library.py+30-9
src/agentcore/intents_search.py+3-3
src/agentcore/rendering.py+41-43