AI
+
Libraries



Basic Anatomy of a RAG-bot

Prompt
LLM
Fine-tuning (RLHF)
"You are a helpful librarian. Answer the following patron question about the Princeton Library. QUESTION: {{ question }}"Basic Anatomy of a RAG-bot

Context
LLM
Fine-tuning (RLHF)
"You are a helpful librarian. Answer the following patron question about the Princeton Library using only information in the provided context. QUESTION: {{ question }} CONTEXT: {{context}}"Prompt
"Firestone is open 8:30am - 6pm"

List all articles about the Soviet dissident movement written in the last five years but not authored by Ben Nathans
I don’t have real-time access to databases or the internet to provide the latest articles...
Basic Anatomy of a RAG-bot

Context
LLM
Fine-tuning (RLHF)
Prompt
knowledge base


Retrieval Augmented Generation (RAG)
- Texts are cut into chunks equal to the LLM's context size
- Text chunks are then transformed into numerical representations called text embeddings.
- Text embeddings that are similar to the question are retrieved and added as context to the prompt.
"Firestone is open 8:30am - 6pm"
"Small World opens at 11 am"
"The US Open is coming to Philadelphia"
"The library's main entrances is closed."
When is the library open?

[0.332,0.774,0.563 ...]

List all articles about the Soviet dissident movement written in the last five years but not authored by Ben Nathans
Chain of Thought
"You are a helpful library research assistant. Think step-by-step and help the user solve their research problem."
To solve the problem.
* First, I would go to library.princeton.edu
* Select the articles tab
* Then I would enter "Soviet dissident movement"
* adjust the Publication Date filter...

Agents & Tools
MCP
Search Agent
"I need to search 'Soviet dissidents' where type is article and date is greater than 2020"
results = { "title":"Soviet Dissidents and their Friends","author","Fred Tyming"}
Serp Tool
"Google Scholar search..."

Chain

Graph

AI Taskforce
By Andrew Janco
AI Taskforce
- 40


