AI concepts in economicsDownload notebook ↓

Vector databases

A vector database stores a numerical representation of each item and finds the items closest to a point of interest. When the coordinates capture meaning, a search can find related ideas even when they are expressed in different words.

What does Berlin tell us about Rome?

Imagine a space in which the arrow from a capital to its country points in a consistent direction. Berlin to Germany gives us one such arrow. Vienna to Austria gives us another. Start at Rome and follow the same arrow. Which country is closest to where you land?

Germany − Berlin + Rome ≈ Italy
Capital-to-country offset in two dimensionsBerlinGermanyRomeItalyViennaAustriaquery point
The circle marks the point we searched for. Italy is its nearest neighbor. The coordinates are hand-chosen so we can draw this word-vector analogy in two dimensions.

Building a library on AI and work

Suppose you want to know how AI changes what workers do. One paper might discuss “output per hour” and another “labor productivity.” A searchable library should help you find both. Below, I build such a library, retrieve evidence for a question, and use a paper tracker to find new work worth adding. The same passages can later supply evidence for an answer in a RAG system.

From a collection of PDFs to a growing reading list
  1. 1Prepare sources
  2. 2Split the text into chunks
  3. 3Embed and index
  4. 4Retrieve the nearest passages
  5. 5Screen new papers
  6. 6Review and expand

1 Prepare sources

Start by collecting PDFs on a specific question. For the example, take Generative AI at Work, which studies productivity among customer-support agents, and AI and Jobs: Evidence from Online Vacancies, which studies hiring. Both concern AI and work, but they measure different outcomes. Keeping the citation attached to each passage matters as soon as we want to use it as evidence.

A PDF is laid out for a reader. Columns, footnotes and equations can come out in the wrong order when a program extracts the text. I used Marker from a local Python script to convert the papers to Markdown, a text format that preserves headings and can represent equations. I preferred Marker for the equations in this collection. If you have the original LaTeX manuscript, Pandoc can convert that source to Markdown too.

What I keep from one paper
Original paperOne ID and version
1 · Main text
Markdown with headings, paragraphs and equations in reading order.
2 · Figures
The extracted image, caption, and an AI-written description, linked to the figure number and its place in the paper.
3 · Tables
Rows and columns with their headers, units and notes, linked to the original table and page.
4 · Metadata
Title, authors, source link and version. The research format also made room for 100- and 500-word summaries.

The worked example uses short, independently written notes in place of full papers so that every passage and search result fits on the page. A figure description can also be searchable: a result about falling wages could then take the reader to the chart, where the axes and units can be checked.

2 Split the text into chunks

Once a paper is in Markdown, what size piece should a search return? A whole paper may cover theory, data and findings. A chunk is a passage small enough to point the reader to one of those discussions. One option is to split at paragraph or section boundaries. Another is to choose a maximum number of characters and decide how many characters two neighboring passages share.

In the paper tracker I used a target of 768 characters per chunk, with 50 characters of overlap, preferring a nearby sentence ending where possible. Overlap keeps some context on either side of the break. For a visible example, the notebook uses 102-character chunks on a short teaching note about the customer-support study. The highlighted sentence is exactly 50 characters long.

Two chunks from the same paper · Generative AI at Work
Chunk 1

A customer-support firm introduced an AI assistant. Agents using AI resolved more issues in each hour.

Chunk 2

Agents using AI resolved more issues in each hour. The largest gains went to less experienced workers.

If a figure or table is included, its description or headers travel with it. A number such as “14 percent” is hard to interpret once it loses its outcome, population and comparison group.

3 Embed and index

An embedding assigns a passage a point in a numerical space. The capital example used two coordinates. For the paper tracker, I used SPECTER2, a model developed for scientific literature. It represents a passage with 768 coordinates. We interpret how two points relate to each other; a single coordinate has no simple economic label such as “wages.”

I stored each vector in Chroma, alongside the passage, paper ID, version and location in the text. This builds the index. Given a point, Chroma can return the nearby passages and the information the reader needs to open the source.

Other choices for embeddings and storage

A general-purpose sentence model such as MiniLM is an alternative to SPECTER2. If the papers already live in PostgreSQL, pgvector can store and search their vectors there. To compare choices, write a few economics questions with known supporting passages and see which system brings those passages back.

A second view of the library

Vector search works on its own. I also built a knowledge graph to record explicit links among papers and economic concepts. A passage might be near a question about wages in vector space; the graph can separately tell us which papers discuss both wages and automation. The tracker gives matches to graph concepts 10% of its screening score. The other 90% comes from two text comparisons described in step 5.

One paper Human capital Labor markets Artificialintelligence Automation Wages
The square is one paper in the collection. Follow its links to human capital and labor markets. The circles and their links show how concepts are connected in this graph.
View the full graph
All 19 papers, 914 concepts and 2,059 links in the archived graph. The darker links trace the excerpt. Five small disconnected groups appear below the main network. Positions arrange the network for display and do not represent embedding coordinates.

4 Retrieve the nearest passages

How does giving customer support workers an AI assistant affect their productivity?

To encode this question means to translate its words into a point in the same space as the passages. Using the same model gives the question and the papers a common set of coordinates. We then compare their directions using cosine similarity. A higher score means a closer match in meaning. It says nothing by itself about the size of an economic effect.

Closest papers to the question
Paper and closest passageCosine similarity
1. Generative AI at WorkA customer-support firm introduced an AI assistant. Agents using AI resolved more issues in each hour.0.936
2. AI and Jobs: Evidence from Online VacanciesUS employers more exposed to AI reduced hiring for non-AI jobs. At the industry and occupation level, this study found no discernible link with wage or employment growth.0.880

Two papers, three passages. Each paper appears once, scored by its closest passage. Passages are teaching paraphrases; titles link to the original studies.

The first passage offers a measure of worker productivity: issues resolved per hour. The second also concerns AI and labor, but its outcome is hiring. Its score of 0.880 illustrates a limit of vector search: related subject matter is not enough to answer the question.

5 Screen new papers

Now reverse the search. Instead of looking up a question in papers you already have, take the title and abstract of a newly announced paper and ask whether it belongs in the collection. The paper tracker did this for a saved batch of 628 announcements from arXiv, CEPR and NBER. Its guiding question was “How does AI affect labor markets and employment?”

How the paper tracker ranks an incoming paper
50% Similarity to the library
How close is the title and abstract to the three nearest passages already in the collection?
10% Concepts from the graph
Does the abstract mention concepts discussed in papers relevant to the research question?
40% Fit to the question
A second model, called a reranker, reads the question and the incoming text together and scores their relevance.

The archived report shows why it helps to see the components. Better World Models Can Lead to Better Post-Training Performance ranked first (0.443). It scored highly with the reranker, but its outcome was the performance of an AI model. Equalizer or amplifier? ranked seventh (0.225). It asks why AI might narrow or widen differences in human performance. For this reading list, I would open the seventh paper first.

See an excerpt from the saved announcements
Three arXiv announcements in feed order: the Türkiye jobless growth study, Equalizer or amplifier?, and Flowchart2Mermaid.
Excerpt reconstructed from the saved records. These three entries carry the announcement date 4 December 2025. The export contains no separate search timestamp.

6 Review and expand

After reading Equalizer or amplifier?, suppose we decide to keep it. We record the reason, prepare its text and add its passages to the index. Now ask a question the first two studies could hardly answer: Which study discusses AI use in coursework and exams?

Before adding the paperGenerative AI at WorkCosine similarity: 0.898
After adding the paperEqualizer or amplifier?Cosine similarity: 0.933

The first result is about support agents, despite its high score. The new passage asks how schools should assess students when AI is allowed in coursework and exams. This is something we can check by opening the paper. Keeping a nearby passage is useful only when it supplies the evidence we were looking for.

To run the tracker weekly, a scheduled job can collect new announcements, skip versions seen before and prepare a shortlist. The researcher records which papers to keep. A subsequent run adds those versions and uses the expanded collection in the next search. The example replays a saved batch so readers can reproduce the result at any time.

Try the offline example

Open the paper tracker notebook in Jupyter or VS Code, select a Python 3 kernel and choose Run All. It builds a temporary library from notes on two public papers and calculates the search results shown above. The new-paper shortlist comes from a saved feed search. Change the decision on the third paper from keep to pass and rerun the notebook to see which evidence you can still retrieve.