Agentic Semantic Search using Small Language Models (SLM)
Jason A. Clark @jasonclark
Professor, Machine Learning Librarian
Montana State University
Jason A. Clark
2026
What’s the problem?
Jason A. Clark
2026
Problem Statement
November 30, 2022
We were given access to a weirdly confident intern that can’t explain how they got their answers.
It is a seamless interface that breaks search interaction + retrieval patterns.
Jason A. Clark
2026
Jason A. Clark
2026
Problem Statement
Jason A. Clark
2026
Jason A. Clark
2026
Problem Statement
More crawling, fewer referrals.
More telling, less linking.
It is a seamless interface that breaks search interaction + retrieval patterns.
Source: “The crawl before the fall… of referrals” Cloudflare Radar
Jason A. Clark
2025
Jason A. Clark
2025
What can we do?
Jason A. Clark
2026
Research Motivation - Speculative Design, Frictional AI, Seamful Design
Rethink the human-computer interaction.
An artifactual interface that shows the work of semantic retrieval?
Jason A. Clark
2026
Jason A. Clark
2026
Prototype - “Agentic Search” Artifact using Small Language Models
Jason A. Clark
2026
Jason A. Clark
2026
Prototype - “Agentic Semantic Search” Artifact
Agent Label + “Thinking”
Observation to Focus Context
Jason A. Clark
2026
Jason A. Clark
2026
Prototype - “Agentic Semantic Search” Artifact
Clear Action
Final Answer with Sources
Trust Signal
Jason A. Clark
2026
Jason A. Clark
2026
Wait… Why? How?
Jason A. Clark
2026
Why? How?
Take advantage of the affordances of the dialogic chat interface.
Jason A. Clark
2026
Jason A. Clark
2026
System Prompt - ReAct (Reasoning + Acting) Cycle (30 lines of directions, excerpted…)
# MSU Research Agent Prompt
## Role and Goal
You are a **Research Assistant** for **Montana State University (MSU)**. Your sole goal is to answer user queries by gathering, evaluating, and synthesizing information using the available tools, focusing exclusively on MSU expertise.
## Core Process: The ReAct Cycle
You **MUST** operate using the **Thought -> Action -> Observation** cycle until the query is fully answered.
### **Source of Truth and Reasoning:**
1. **Observations are your absolute source of truth.** You must rely **only** on the information returned in your `Observation:` steps.
2. **You must ignore all foundational model knowledge.** If your observations contradict your pre-existing knowledge, **the observation is correct.**
3. Your `Thought:` must explicitly state your reasoning, evaluate observations, and formulate the plan for the *next single step*.
4. Execute *exactly one* `Action:` per cycle.
## Available Tools and Strategy
* **Action Format:** `Action: tool_name: query`
* **Tool Limitation:** You only have the two tools listed below.
Jason A. Clark
2026
Jason A. Clark
2026
Semantic Search - Wikipedia (prompt) (30 lines of directions, excerpted…)
# MSU Research Agent Prompt
….
## Available Tools
| Tool | Purpose | Example |
| :--- | :--- | :--- |
| `wikipedia: [query]` | General concepts only. Use to find keywords and technical terms. Do not assume any person mentioned is affiliated with MSU. | `Action: wikipedia: deep learning` |
| `search_msu_expertise: [query]` | **Your exclusive tool** for locating MSU faculty, labs, and programs. Use keywords gathered from wikipedia to sharpen queries. | `Action: search_msu_expertise: convolutional neural networks` |
## Stop Condition and Final Answer Format
Jason A. Clark
2026
Jason A. Clark
2026
Semantic Search - Wikipedia (code)
def stream_query(question, max_turns=5, max_msu_searches=3):
i = 0
bot = Agent(system_prompt)
max_wikipedia_calls = 1
wikipedia_calls = 0
msu_searches = 0
if max_turns <= 0:
return
try:
# Deterministic first step: use Wikipedia once for concepts/keywords.
i += 1
first_thought = "I need general concepts and keywords before searching MSU expertise."
action = "wikipedia"
action_input = question
yield 'thought', first_thought
yield 'action', f"{action}: {action_input}"
Source: Complete Search Agent available here.
Jason A. Clark
2026
Jason A. Clark
2026
Local Dataset - Grounded Retrieval (code)
def search_msu_expertise(query):
"""Performs a search for MSU expertise and researcher interests.
Args:
query: The search query in the custom search engine.
Returns:
A dictionary containing a list of dictionaries, where each inner
dictionary contains 'title', 'link', 'snippets', and 'description'
for each search result.
"""
# Set up your own local dataset or database to query and ground search agent retrieval in a library or archive collection
"""
url = f"https://discoveryengine.googleapis.com/v1/projects/{projectID}/locations/global/collections/default_collection/engines/{agentID}/servingConfigs/default_search:searchLite?key={apiKey}"
Source: Complete Search Agent available here.
Jason A. Clark
2026
Jason A. Clark
2026
So, What?
Jason A. Clark
2026
Research Results - Speculative Design, Frictional AI, Seamful Design
Jason A. Clark
2026
Jason A. Clark
2026
Research Implication - Semantic Search Formula using Agentic Patterns
Tool 1:
Semantic query refinement tool: LLM directed to interpret the underlying meaning, context, and intent of a user's query rather than just matching keywords..
+
Pass through the LLM’s semantic interpretation of the query to a retrieval tool and dataset.
+
Tool 2:
Retrieval Tool: uses interpreted query to search a local data source (database, spreadsheet, series of JSON files, etc.)
Jason A. Clark
2026
Jason A. Clark
2026
Research Implication - What is your Semantic Search + Agent Formula?
Tool 1:
E.g., Wikidata API term refinement
+
Pass through the LLM’s semantic interpretation of the query to a retrieval tool and dataset
+
Tool 2:
E.g., Search of National Archives Catalog (https://www.archives.gov/research/catalog/help/api).
Jason A. Clark
2026
Jason A. Clark
2026
Take this System Prompt into your Teaching + Instruction
# MSU Research Agent Prompt
## Role and Goal
You are a **Research Assistant** for **Montana State University (MSU)**. Your sole goal is to answer user queries by gathering, evaluating, and synthesizing information using the available tools, focusing exclusively on MSU expertise.
## Core Process: The ReAct Cycle
You **MUST** operate using the **Thought -> Action -> Observation** cycle until the query is fully answered.
### **Source of Truth and Reasoning:**
1. **Observations are your absolute source of truth.** You must rely **only** on the information returned in your `Observation:` steps.
2. **You must ignore all foundational model knowledge.** If your observations contradict your pre-existing knowledge, **the observation is correct.**
3. Your `Thought:` must explicitly state your reasoning, evaluate observations, and formulate the plan for the *next single step*.
4. Execute *exactly one* `Action:` per cycle.
## Available Tools and Strategy
* **Action Format:** `Action: tool_name: query`
* **Tool Limitation:** You only have the two tools listed below.
Jason A. Clark
2026
Jason A. Clark
2026
Push our values and data into these systems. Claude MCP Integration
Integration with Consumer LLM
Jason A. Clark
2026
Jason A. Clark
2026
Push our values and data into these systems. Claude MCP Integration
Trust Signal + Sources in Consumer LLM
Jason A. Clark
2026
Jason A. Clark
2026
Research Implication
Language Models + Agentic Search
- Try and practice through implementation.
- Natural Language Interfaces + language models for retrieval are here.
- Adopt your own formula.
Jason A. Clark
2026
Jason A. Clark
2026
Latent Space Knowledge Graphs as World Models for Word Models:
An Alternative to GraphRAG for LLM Retrieval and Analysis
AI Literacy Summit
2026
Additional Research - Project Details
Can language models have world models?
Can language models use/intepret graph data?
AI Literacy Summit
2026
Additional Research
Code repository
https://github.com/jasonclark/kg-world-model-retrieval
Code and Sample N-Triple file - knowledge-graph-grounded LLM
https://gist.github.com/jasonclark/a6f5f832077da8546726888d16b25692
Slides
Knowledge Graphs and World Models for Retrieval and Analysis [talk Fantastic Futures 2026]
Previous research:�Clark, J. A., Williams, H. K. R., & Rossmann, D. (2022). Wikidata and knowledge graphs in practice: Using semantic SEO to create discoverable, accessible, machine‑readable definitions of the people, places, and services in Libraries and Archives. Information Services and Use, 42(3‑4), 377‑390. https://doi.org/10.3233/ISU-22017
AI Literacy Summit
2026
**Thank you**
Jason A. Clark
jaclark@montana.edu
@jasonclark
(Bluesky + GitHub)
Jason A. Clark
2026
Development Stack - “Agentic Search” Artifact using Small Language Models
Jason A. Clark
2026
Jason A. Clark
2026
Language Models - Tools and Getting Started
Jason A. Clark
2026
Jason A. Clark
2026
References and Follow-up Resources
Clarivate. (2025). Pulse of the library 2025: Global survey of academic, public and national libraries on how AI and other emerging priorities are shaping the future of libraries. https://clarivate.com/pulse-of-the-library/
Dunne, A., & Raby, F. (2013). Speculative everything: Design, fiction, and social dreaming. The MIT Press.
https://mitpress.mit.edu/9780262019842/speculative-everything/
Ericson, P., Khairova, N., & De Vos, M. (Eds.). (2024). HHAI-WS 2024: Proceedings of the Workshops at the Third International Conference on Hybrid Human-Artificial Intelligence (co-located with HHAI 2024), Malmö, Sweden, June 10–11, 2024. https://ceur-ws.org/Vol-3825/ (Frictional AI Workshop)
Natali, C., Naiseh, M., Cabitza, F., & Frischmann, B. (2025). Better AI with designed friction: Theories, applications and research agenda. In Frontiers in Artificial Intelligence and Applications: Vol. 408: HHAI 2025 (pp. 518–521). IOS Press. https://doi.org/10.3233/FAIA250680
Upol Ehsan, Q. Vera Liao, Samir Passi, Mark O. Riedl, and Hal Daumé III. (2024.) Seamful XAI: Operationalizing Seamful Design in Explainable AI. Proc. ACM Hum.-Comput. Interact. 8, CSCW1, Article 119 (April 2024), 29 pages. https://doi.org/10.1145/3637396
Jason A. Clark
2026
Jason A. Clark
2026