REELSIGNAL
The Archive

AI Sandbox Series: The Embedded Catalog

AI Sandbox Series: The Embedded Catalog
Leah Weinryb-Grohsgal
October 27, 2026 02:41 JST

This post was written by Matthew Miller, a Linked Data Applications Technical Specialist in Discovery and Preservation Services at the Library of Congress. We are excited to share this post in our ongoing series about the Library of Congress Artificial Intelligence (AI) Sandbox for staff. Posts in the series will feature details about experiments in text recognition and searchability, metadata and bibliographic record enhancement, and more. A previous post introduced the initiative’s goals and an overview of the types of experiments conducted so far. 

Recently the staff of the Network Development and MARC Standards Office at the Library of Congress participated in an AI Sandbox program hosted by the Library’s Digital Strategy Directorate in the Office of the Chief Information Officer. The Sandbox provided a space to use AI and machine learning tools and methodologies with the Library’s collections and metadata at scale.  

One area we were particularly interested in is vector embeddings and how they can be leveraged with the Library’s catalog records. In this blog post, we will review what embeddings are, go over some of the areas where we experimented with them, and explore some visualizations that allow us to see the approximately 20 million records in the Library’s catalog and how they have developed through time. 

Vector embeddings, in the simplest terms, are numbers that represent text. They are used in many machine learning and AI tools and provide a way to reduce natural language to numbers, which enables us to interact with language using algorithms. This blog post on the collaborative platform and community hub Hugging Face provides a detailed history of vector embeddings.  

In our case, we wanted to generate vector embeddings for each of the 20 million records in our catalog. To do this, we used an embedding model, a neural network–based model like a Large Language Model (LLM), but instead of generating text, it generates vector embeddings.  

Each of these vectors represents a location in the model, and they act as a sort of coordinate system, so two vectors that are in close proximity indicates that they are related. The idea of “closeness” is a bit different from what we would naturally think of in this case. Saying two things are close in physical space means they are in proximity in three-dimensional space. But these vectors represent what is called high-dimensional space (in our case 1,024 dimensions) with dimensions representing abstract variables or features of the text

One useful aspect of having this high-dimensional space is that language is just one feature of the text. This means the model is multi-lingual, and text about the same things in two different languages will still be in proximity to each other. The same concept applies to the terminology and vocabulary used. For example, the word “cars” and the word “automobiles” would be close together — even though they are different words, they are still about the same thing. 

To generate our vectors, we used Amazon Web Services’ embedding model called Titan Text V2. Each catalog record was prepared by extracting only the descriptive metadata — things like subject headings, Library of Congress Classification, summary and table of contents, notes, etc. — and run through the model to generate a vector for each record. These vectors were then loaded into a vector database, which allowed us to query using new text and find the records that are most similar. 

Having the catalog in this format allowed us to develop many different types of potentially useful applications. The first one we experimented with is a subject assistant. The idea is fairly straightforward: take a record that is being cataloged but does not yet have subject headings, turn it into a vector, and then see what is most similar in the database to this in-progress record.  

Once you have a few records that are similar to it, you can show what subject headings were used on the  related records and potentially reuse or modify existing subject headings already applied. In our testing, we found this can be a useful tool for cataloging, helping speed up the process of evaluating what subject headings are currently in use for a specific domain, or getting the lay of the land for subject usage.  

This embedding-based approach only uses real records, so unlike generative AI, there is no risk in generating false or hallucinated subject headings. We have been experimenting with this tool by integrating it into our BIBFRAME cataloging editor, testing its ability for catalogers to see potential recommendations for subject headings while they are working. 

Another interesting application is discovery. We experimented with a proof of concept where a research question was transformed into a “phantom record” — one totally invented by a large language model but perfectly encapsulating the researcher’s question. The LLM generates a title, subject headings, LCC (Library of Congress Classification) headings, summary, and more. It doesn’t matter that it invents this information because the goal is not to use it. The goal is to find where in the embedding model and our existing records it would be located.  

This phantom record is then turned into a vector and queried against the database, and the results are real records that best match the researcher’s question. This is an area that could potentially be very useful for discovery systems using BIBFRAME, and we hope to continue to explore it and see its possibilities. 

Another advantage of having the catalog in this vector form is that it lends itself to data visualization. Because the vectors represent, in a sense, the coordinates of where a concept is located within the embedding model, you can organize the records into discrete regions and represent that visually. However, visualizing vector embeddings is challenging because you are reducing, in our case, 1,024 dimensions into two dimensions (X and Y) so you can plot them visually. This flattening produces a subjective view of the data since we cannot visualize 1,024 dimensions.  

The Library’s rich catalog data also carries human-assigned classifications, such as LCC. This gives us not only an organizational system for where a concept sits in the model, but also for how the Library has cataloged the resource, whether it’s a book about biology, a folk audio recording, or a novel. These human-assigned classifications can be used in the visualization as well.  

Combining these two ideas — the model’s internal structure and the applied Library of Congress Classification — can build a visualization that reflects not only how the model represents these records, but how we view them as well. From there, we can see how our classification systems naturally align with the model’s internal organization.  

The visualization below shows all 20 million records, each placed at its location within the model and color-coded by its LCC class. The results are highly structured groupings of similar resources. The visualization is really an interpretation of the catalog through the lens of the embedding model, but it has the added benefit of the LCC classification, providing labels and color structure as well. 

LINK TO INTERACTIVE VIZ 

A visualization showing all 20 million records, each placed at its location within the model and color-coded by its LCC class.
A visualization showing all 20 million records, each placed at its location within the model and color-coded by its LCC class.

We can use the mouse to pan around and zoom in, all the way down to the individual record level. We can also click to see what types of records are situated in that area of the visualization. This is just one view of the catalog — a view through the particular embedding model we used — but it is powerful enough to be able to see the entire 20 million records at once, along with where they aggregate and form structures. 

The visualization also has a “Communities” toggle that provides a view of the catalog in line with the embedding model’s internal organization. This mode divides the resources into communities based on how they cluster together using an algorithm called Hierarchical Density-Based Spatial Clustering of Applications with Noise (HDBSCAN). A process then names each cluster and sub-region in the community based on sampling the titles and subject headings in that cluster.  

Instead of overlaying the LCC classification and trying to force the visualization into that system, this mode reflects the model. It looks more meticulous than the nebulous LCC version, but the reduction from 1,024 dimensions to two can produce groupings that are seemingly arbitrary. 

Visualization reduced from 1,024 dimensions into two.
Visualization reduced from 1,024 dimensions into two.

In addition to this overall view of the catalog, we can also introduce a temporal element to the visualization by limiting which records are shown based on when they were entered into the catalog or when the resources were originally published. We can generate a time series or animation of these additions, resulting in a timelapse view of the development of the catalog, both from the perspective of when the resources were created in the catalog and from when they were published.  

We can also use the web interface to step through year-by-year and see which areas of the catalog received the most contributions that year and which LCC classes were being added each year. Class P (Language and Literature) is the largest addition every year, but the time-lapse presentation emphasizes areas that received a high concentration of new records. The time lapse by date entered shows a sort of institutional view of what was processed each year, and perhaps certain priorities, while the time lapse by publication date is a more general indicator of the development and publication of materials throughout the history of the Library and its collections. 

LINK TO TIMELAPSE VISUALIZATIONS – Press the play button and use the buttons at the top right to switch between cataloged and publication date. 

Because we are mapping concepts and ideas into a two-dimensional space, we can also introduce other types of knowledge bases for comparison, not just catalog records. For example, we can show the overlap between a dataset like Wikipedia and the Library by vectorizing the 7 million English Wikipedia articles and overlaying how they fit with the Library’s vectors. This is possible if we use the same embedding model.  

Of course, it is not a one-to-one comparison. These are fundamentally different types of knowledge — a catalog record versus an encyclopedia article. But within the model’s latent space, you can get a sense of where there is overlap and where one system has more information than the other.  

In the visualization below, which projects the Library’s vectors together with English Wikipedia’s articles, we can see significant overlap and a lot of areas where one knowledge base has more information than the other. For example, Wikipedia has many individual articles about sports players, whereas the Library of Congress does not have thousands of individual player biographies.  

LINK TO WIKI X LC VISULAZATION 

Visualization projecting the Library's vectors together with English Wikipedia's articles.
Visualization projecting the Library’s vectors together with English Wikipedia’s articles.

We can also see certain artifacts of how a knowledge base is built, like the Wikipedia cluster of disambiguation pages that have no correlation to the Library’s knowledge base. This is just one example of how you can overlay disparate systems of knowledge and explore how they compare. The most obvious application, of course, would be to use this sort of analysis on other catalogs and see how they relate to each other. 

To conclude, this experiment suggests that the approach of vectorizing the descriptive metadata of catalog records can be used for various applications, and it works well due to the distinct nature of catalog records. Many other applications could be developed using the same methodology, which will likely improve as newer, more capable embedding models are released regularly by research groups and companies. 

Below you’ll find some technical information if you’re interested in the details of this experiment, as well as some download links if you’d like to try out the embeddings yourself. 

Technical Details 

  • Corpus: Approximately 20.3 million bibliographic records from the Library of Congress catalog through the end of 2025. Only descriptive metadata was embedded (title, subject headings, classification, summary/table-of-contents notes, etc.).
  • Embedding model: Amazon Titan Text Embeddings V2 (via AWS Bedrock), producing a 1,024-dimension vector per record.
  • Vector DB: We used AWS S3 Vector bucket for storage and querying our 20M vectors. 
  • Dimensionality reduction: PCA from 1,024 down to 50 dimensions, then Parametric UMAP down to 2D — a PyTorch multilayer perceptron (4 hidden layers × 512 units) trained for 20 epochs on Apple Silicon (MPS), with an added correlation-preservation loss term. Training used a stratified sample of approximately 5.4 million records (capped at 30,000 per LCC subclass so small classes get equal say in the layout). The trained network then transformed all 20.3 million records. 
  • Rendering: Datashader aggregates all 20.3 million points per zoom level with logarithmic alpha shading, rendered into a standard XYZ tile pyramid (zoom 0–10, 256 px PNG tiles — about 620,000 tiles) via 2,048 px supertiles processed in parallel. 
  • Viewer: Plain Leaflet with CRS.Simple. The entire visualization is comprised of static files (about 5.6 GB total). No server or database is required to host it. 
  • Click-to-inspect: An adaptive quadtree shards the 20.3 million records into approximately 11,000 static JSON files; a click fetches only the leaf under the cursor to show class percentages, sample records, and links into the Library catalog. 
  • Labels: Class labels are placed at density peaks of per-class 2D histograms (with connected-component centroids for sprawling regions) and revealed progressively by zoom. Language “watermark” labels are derived from the equivalent 008/041 fields. 
  • Time lapse: Per-year frames rendered with Datashader and assembled with ffmpeg into MP4s. The web explorer version uses one WebP peak-frame per year with a single JSON stats file. 
  • Stack: Python 3, NumPy / pandas / PyArrow, PyTorch, Datashader, Leaflet. The full pipeline runs on a single computer. The layout is trained in about 7.5 hours. 
  • Embedding Files: https://id.loc.gov/download/#embeddings.

This article was originally published by Library of Congress and is republished under a Creative Commons Public domain · Library of Congress licence. Links in the original text have been removed.

More on The Archive