Project Blog: Florence
A project blog by
Yohann Ian
AI/ML Engineer
I initially ran Florence on AWS. If you want to try it out, visit the link below. But bear in mind, I turned it off on AWS because it takes money to keep it running and to make API calls. Instead, I deployed the UI on Netlify for free… call it a mannequin. It ain’t the real thing, but I thought it would be nice to put it out there.
Netlify LINK: https://florence-ui-preview.netlify.app/
GitHub LINK: https://github.com/Yohann-Ian/florence-literature-rag
Florence: Retrieval Augmented Generation Agent
I built a RAG agent for literary analysis and deployed it on AWS. Yes, I like literature.
- RAG Pipelines
- LangGraph
- FastAPI
- Docker
- AWS ECS
- ChromaDB
- Orchestration
- Ragas Evaluation
- HITL Systems
How do I combine my love for creating things with my love for literature?
I develop a RAG.
Delightful for writers.
Demonstrative for AI Engineers.
I built this Literary Analysis RAG agent from scratch and ran it on AWS. It’s a highly technical end-to-end project, showcasing the highly-sought skills and tools for deploying AI-enhanced systems in the workplace.
Let me take you through.
Project Florence
An AI Agent that Runs Comparative Analysis on Literature Books
“Whatever talents a person may possess to amuse and instruct others, be they ever so inconsiderable, he is yet bound to exert them: if his attempt be ineffectual, let the punishment of an unaccomplished purpose have been sufficient; let none trouble themselves to heap the dust of oblivion upon his efforts.”
― Percy Bysshe Shelley, Prometheus Unbound
-
Why Build?
The great works of mankind—art, music, and literature—bear the chronicle and essence of humanity. Yes, science and technology matter. But, you’ll notice in every civilization, culture precedes technology, which in turn give rise to new culture and art.
This fascinates me on a personal level. Without culture, technology is aimless and, let’s face it, destructive. Literature majors and philosophers debate about the deeper questions of humanity, finding their answers in literature from across the ages, from the Odyssey to the Divine Comedy, to Age of Innocence, to War and Peace and beyond.
The irony of having a STEM education is that you are not taught to ask these questions in your formal education. Everything for me was about why “How to Program a Hex Display in Verilog” and “The Perks of Using a Bipolar Junction Transistor”. We were studying P-wells and N-wells…..instead of H.G Wells. (Geddit? That was a joke.) It was only through reading non-technical books, literature, and philosophy that I developed a mind for the broader questions of the world and humanity. It’s cool to build things. And it’s easier now more than ever. But in a time of mindless generation and AI slop, if you cannot ask yourself why you’re doing something….and instead settle for the mere how, you come awfully close to being obsolete. More embarrassingly, you’re just an LLM in effect. If all you’ve got—no, if all you are is a function, you’re a prime target for replication and replacement.
If you pick up the book, “1984” by George Orwell or “Brave New World” by Aldous Huxley, both cornerstones of dystopian science fiction, you’ll understand what I mean. I’m going to do the cliched thing and say “We live in an age of unimaginable technological progress and disruption.” I say it because it’s true. But what does that mean for the human beings of this time? In the books “1984” and “Brave New World”, the central theme is Control and how technology is used to achieve it, by means of pain or pleasure. Yes, there are political dimensions involved. But, you cannot help but think of our world differently after you’ve spent some time with these books. What will tomorrow’s technology be used for?
Why make an AI Agent? Because it’s cool? Because you want to lay off half your workforce? Because if you don’t do it, your competitors will outgun you? Because of the stock?
Why steal hundreds of thousands of art pieces from human beings across all of human existence and ingest them into a machine? Because you want a new image generation toy? Because you want to productize the feature and call it Adobe Firefly?
Perhaps you want to train Neural Networks to research a new ground-breaking drug or detect cancer non-invasively to save lives?
In reading through this project, I hope some of my taste for literature rubs off on you. I chose to build this agent because as I worked to hammer out the technical bits, I got to ask (many) meaningful questions of the source material. Hopefully it’s doubly entertaining looking at both the engineering and the literary insights it aims to serve. We’ll see.
-
This was written before 1900. It translates to:
“A person is bound to exert whatever talents a he has, however small, whether to amuse and instruct others. If it doesn’t happen, he takes his punishment in the form of not having accomplished his purpose. There isn’t even a need for anyone to screw him over or say he’s no good.”
-
How Is Using a RAG Different From Simply Asking ChatGPT a Question?
Honestly, on the surface, it isn't. The generation itself uses Anthropic's Claude through an API. If you uploaded 1984 to ChatGPT or Claude directly, you'd get a similar answer.
The difference is what's around the LLM, and who owns it.
The retrieval, the chunking, the ingestion, the vectorstore, the scoring, the human-in-the-loop mechanism, the confidence checks, the loop conditionals, the agent states, the deployment: all of that is mine. External LLMs are called only to shape language and to grade passages. The truth the answer is built from, epistemically speaking, comes from the source books that I chunked and ingested on my own back end.
I built it this way for four reasons.
One, to control the chunking. Uploading a book to a commercial LLM means trusting whatever it does behind the scenes: a fixed context window, an opaque attention span, no visibility into what got retrieved and why. Building it myself meant I could choose the strategy (hierarchical, small children for precision, large parents for context), evaluate it, and change it.
Two, to learn the mechanism. I wanted to understand how retrieval actually works from the inside, not just consume it as a feature. Building the whole thing forces you to confront the parts that black-box services hide.
Three, to demonstrate I could ship a real system. Not a notebook, not a demo script. A containerised, deployed, agentic system with evaluation, grounding, and a human-in-the-loop. The skills used here (LangGraph, FastAPI, Docker, ECS, Ragas, prompt engineering, LLM orchestration) are the working vocabulary of AI engineering in production, and this project is the evidence I can use them.
Four, to build something I own. Because the pipeline is mine, I get to define what "good enough" means: how long the agent waits, how many retries it makes, what confidence threshold triggers human review, how many rejections before it gives up. Those are all knobs on my side, not the LLM provider's. And because the LLM is called through an API, I could swap it tomorrow for a locally-hosted open model (say, something from Hugging Face). I haven't, but the door is open. That is what ownership of an AI system actually looks like.
And the last thing, which is really the whole point: this pipeline is not about literature. Literature is the corpus that made rigorous evaluation possible. The pattern is universal. Defining agent states, scoring criteria, conditional loops, retry logic, and human-in-the-loop judgement are the shape of any serious production agent, whatever the domain. Swap out the corpus, and you have a legal assistant that grades against case law, or a customer support agent that grades against a knowledge base, or an internal research tool that grades against company documents. The mental framework transfers directly. That is the thing worth hiring for, and this is the evidence.
This project touches many technical concepts and offers a first-hand experience of building an AI Agent using Langgraph.
Demo Videos. But seriously, read the rest of the page.
A full Florence run on localhost. I did not cut short or speed up the video. You’'ll see it exactly as it is.
Running it on Amazon AWS
I successfully served Florence on Amazon ECS, with CloudWatch Logs in the background.
Indexed:
1984, George Orwell
Brave New World, Aldous Huxley
Initially, I indexed these others in the Corpus. But the project became too big to handle. It was as they say… hubris. Great reads by the way. These are:
The Aeneid, Virgil
Paradise Lost, John Milton
Crime and Punishment, Fyodor Dostoevsky
Anna Karenina, Leo Tolstoy
The Master and Margarita, Mikhail Bulgakov
A Farewell to Arms, Ernest Hemingway
East of Eden, John Steinbeck
Beloved, Toni Morrison
The Machine
A quick look at the inner machinery. I’ll go into detail further below. It’s quite intricate. If you come from electrical engineering, you’d recognise this as a state machine. (My impression going into AI agents and Langgraph)
The RAG Agent
Just to be clear with you, I’m not building a town.
The RAG agent’s name, Florence, was inspired by the Renaissance period, that originated in Florence, Italy.
Before I get technical, I want you to know what it does and see how it looks like from a UI.
Answers are drawn from the Corpus, the collection of books that were vectorized, usable by the agent.
The Corpus