In 1859, nine-year-old Ruby Ledger stands out. She is an extraordinarily brilliant child who loves STEM, history, and learning about the world. She even taught her monkey companion, Coco, to communicate using signs and sounds. Much to the disappointment of her parents, Ruby isn't like other girls. She's got a quick mind, and she isn't interested in a future of just being pretty.
Since the day Ruby was born, she has wanted to be a detective and inventor. She invents the closed candle (the earliest light bulb), the moovo (moving pictures), and many other objects. On her first official mission, she tries to help her family catch a culprit accused of stealing hay. During the mission, however, she is knocked out. When she wakes up, her parents don't even ask if she is okay! They are cross, and, in their anger, they deliver devastating news - she's being sent to Miss Holmes' Academy, a preparatory school for girls located in Washington, D.C.
When Ruby first arrives, she tries to escape but soon realizes she may actually have more freedom at school because her family, ever watchful and, worse, judgmental, is not there. She fills her days with dodging teachers' questions, skipping class, and - best of all - inventing. Her favorite teacher from home, Mr. Henry, has even accepted a position alongside the Miss Holmes' Academy staff, making her feel like she's got at least one adult on her side.
In Ruby's second semester, Miss Holmes takes Ruby's year to the White House. While there, Ruby notices a locked metal door and is intrigued. She sneaks away from the group to pick the lock. While in the room, she hides when she hears James Buchanan and an anonymous accomplice attempting to enter. Once inside and oblivious to Ruby's presence, they begin to discuss a plan written on a scroll to prevent Abraham Lincoln from being elected. Ruby is intrigued, so after they leave, she locates the scroll to investigate. When she finds the scroll, she discovers it contains only colors. She decides to take the scroll with her to break the code.
After breaking the code, she learns that Buchanan wants to assassinate Lincoln as revenge for Lincoln's uncovering of Buchanan's own nefarious acts. Ruby decides it's her mission to stop Lincoln, a man she admires for his ideas about equality, from being assassinated. Along the way, she must confront hard truths about her own history, talents, and intellectual abilities, namely that her mother and father are not her actual mother and father but her aunt and uncle who, upon her birth, made a promise to her biological parents to keep her safe and secluded from the group of worldwide secret operatives she can - if she chooses - count herself among.