Staff at the Library of Congress have converted approximately 20.3 million catalog records into vector embeddings, creating a searchable, visualizable representation of the entire catalog, the Library's Network Development and MARC Standards Office has reported.
The work was carried out through an AI Sandbox program hosted by the Library's Digital Strategy Directorate in the Office of the Chief Information Officer, which provided a space to use AI and machine learning tools with the Library's collections and metadata at scale.
Vector embeddings, in the simplest terms, are numbers that represent text. The team used Amazon Web Services' Titan Text V2 embedding model to generate a 1,024-dimension vector for each record, extracting only descriptive metadata such as subject headings, Library of Congress Classification, summaries, tables of contents and notes. The vectors were loaded into a vector database, allowing staff to query with new text and find the most similar records.
One application tested was a subject assistant. A record being cataloged but lacking subject headings is turned into a vector, and the database returns similar records whose subject headings could potentially be reused or modified. "This embedding-based approach only uses real records, so unlike generative AI, there is no risk in generating false or hallucinated subject headings," the Library said. The tool has been tested inside the Library's BIBFRAME cataloging editor.
A second experiment involved discovery. A research question was transformed into a "phantom record" invented by a large language model, complete with title, subject headings, classification and summary. That record was then converted into a vector and queried, returning real catalog records that best match the researcher's question.
The vectors also enabled data visualization. Because the 1,024 dimensions must be flattened into two, the Library cautioned that the result is a subjective view of the data. One interactive visualization plots all 20 million records, color-coded by classification, with a "Communities" mode that clusters records using an algorithm called HDBSCAN. A time-lapse feature shows the catalog's growth year by year, by date entered and by publication date; Class P (Language and Literature) is the largest addition every year.
The Library also overlaid vectors from 7 million English Wikipedia articles onto its own, revealing significant overlap and areas where one knowledge base holds more information than the other — for example, Wikipedia's many individual sports player biographies.
The experiment suggests vectorizing descriptive metadata can support various applications, and the Library expects results to improve as newer embedding models are released. The embedding files are available for download from id.loc.gov.