Repository: argilla-io/argilla-llama-index (language: python)

Issue:
[RELEASE] v1.0 of Argilla LlamaIndex Integration
- [x] Code rebase
- [x] Pinning LlamaIndex to v0.10
- [x] Adapt test suite
- [ ] Argilla tutorial using the integration


Discussion / hints:

Fix patch:
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
new file mode 100644
index 0000000..11aba23
--- /dev/null
+++ b/.github/workflows/release.yml
@@ -0,0 +1,39 @@
+name: 🎉 Release
+
+on:
+  release:
+    types:
+      - published
+
+jobs:
+  publish:
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v4
+
+      - name: Setup Python
+        uses: actions/setup-python@v4
+        with:
+          python-version: "3.11"
+          # Looks like it's not working very well for other people:
+          # https://github.com/actions/setup-python/issues/436
+          # cache: "pip"
+          # cache-dependency-path: pyproject.toml
+
+      - uses: actions/cache@v3
+        id: cache
+        with:
+          path: ${{ env.pythonLocation }}
+          key: ${{ runner.os }}-python-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}-release-v00
+
+      - name: Install dependencies
+        if: steps.cache.outputs.cache-hit != 'true'
+        run: pip install build
+
+      - name: Build distribution
+        run: python -m build
+
+      - name: Publish
+        uses: pypa/gh-action-pypi-publish@release/v1
+        with:
+          password: ${{ secrets.PYPI_API_TOKEN }}
\ No newline at end of file
diff --git a/.gitignore b/.gitignore
index 68bc17f..795a783 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,6 +3,8 @@ __pycache__/
 *.py[cod]
 *$py.class
 
+.DS_Store
+
 # C extensions
 *.so
 
diff --git a/README.md b/README.md
index 0fd5dff..ae85c07 100644
--- a/README.md
+++ b/README.md
@@ -39,7 +39,6 @@ openai_api_key = os.getenv("OPENAI_API_KEY", None) or getpass("Enter OpenAI API
 Let's now write all the necessary imports
 
 ```python
-from argilla_llama_index import ArgillaCallbackHandler
 from llama_index.core import VectorStoreIndex, ServiceContext, SimpleDirectoryReader, set_global_handler
 from llama_index.llms.openai import OpenAI
 ```
diff --git a/data/paul_graham_essay.txt b/data/paul_graham_essay.txt
new file mode 100644
index 0000000..7f0350d
--- /dev/null
+++ b/data/paul_graham_essay.txt
@@ -0,0 +1,353 @@
+
+
+What I Worked On
+
+February 2021
+
+Before college the two main things I worked on, outside of school, were writing and programming. I didn't write essays. I wrote what beginning writers were supposed to write then, and probably still are: short stories. My stories were awful. They had hardly any plot, just characters with strong feelings, which I imagined made them deep.
+
+The first programs I tried writing were on the IBM 1401 that our school district used for what was then called "data processing." This was in 9th grade, so I was 13 or 14. The school district's 1401 happened to be in the basement of our junior high school, and my friend Rich Draves and I got permission to use it. It was like a mini Bond villain's lair down there, with all these alien-looking machines — CPU, disk drives, printer, card reader — sitting up on a raised floor under bright fluorescent lights.
+
+The language we used was an early version of Fortran. You had to type programs on punch cards, then stack them in the card reader and press a button to load the program into memory and run it. The result would ordinarily be to print something on the spectacularly loud printer.
+
+I was puzzled by the 1401. I couldn't figure out what to do with it. And in retrospect there's not much I could have done with it. The only form of input to programs was data stored on punched cards, and I didn't have any data stored on punched cards. The only other option was to do things that didn't rely on any input, like calculate approximations of pi, but I didn't know enough math to do anything interesting of that type. So I'm not surprised I can't remember any programs I wrote, because they can't have done much. My clearest memory is of the moment I learned it was possible for programs not to terminate, when one of mine didn't. On a machine without time-sharing, this was a social as well as a technical error, as the data center manager's expression made clear.
+
+With microcomputers, everything changed. Now you could have a computer sitting right in front of you, on a desk, that could respond to your keystrokes as it was running instead of just churning through a stack of punch cards and then stopping. [1]
+
+The first of my friends to get a microcomputer built it himself. It was sold as a kit by Heathkit. I remember vividly how impressed and envious I felt watching him sitting in front of it, typing programs right into the computer.
+
+Computers were expensive in those days and it took me years of nagging before I convinced my father to buy one, a TRS-80, in about 1980. The gold standard then was the Apple II, but a TRS-80 was good enough. This was when I really started programming. I wrote simple games, a program to predict how high my model rockets would fly, and a word processor that my father used to write at least one book. There was only room in memory for about 2 pages of text, so he'd write 2 pages at a time and then print them out, but it was a lot better than a typewriter.
+
+Though I liked programming, I didn't plan to study it in college. In college I was going to study philosophy, which sounded much more powerful. It seemed, to my naive high school self, to be the study of the ultimate truths, compared to which the things studied in other fields would be mere domain knowledge. What I discovered when I got to college was that the other fields took up so much of the space of ideas that there wasn't much left for these supposed ultimate truths. All that seemed left for philosophy were edge cases that people in other fields felt could safely be ignored.
+
+I couldn't have put this into words when I was 18. All I knew at the time was that I kept taking philosophy courses and they kept being boring. So I decided to switch to AI.
+
+AI was in the air in the mid 1980s, but there were two things especially that made me want to work on it: a novel by Heinlein called The Moon is a Harsh Mistress, which featured an intelligent computer called Mike, and a PBS documentary that showed Terry Winograd using SHRDLU. I haven't tried rereading The Moon is a Harsh Mistress, so I don't know how well it has aged, but when I read it I was drawn entirely into its world. It seemed only a matter of time before we'd have Mike, and when I saw Winograd using SHRDLU, it seemed like that time would be a few years at most. All you had to do was teach SHRDLU more words.
+
+There weren't any classes in AI at Cornell then, not even graduate classes, so I started trying to teach myself. Which meant learning Lisp, since in those days Lisp was regarded as the language of AI. The commonly used programming languages then were pretty primitive, and programmers' ideas correspondingly so. The default language at Cornell was a Pascal-like language called PL/I, and the situation was similar elsewhere. Learning Lisp expanded my concept of a program so fast that it was years before I started to have a sense of where the new limits were. This was more like it; this was what I had expected college to do. It wasn't happening in a class, like it was supposed to, but that was ok. For the next couple years I was on a roll. I knew what I was going to do.
+
+For my undergraduate thesis, I reverse-engineered SHRDLU. My God did I love working on that program. It was a pleasing bit of code, but what made it even more exciting was my belief — hard to imagine now, but not unique in 1985 — that it was already climbing the lower slopes of intelligence.
+
+I had gotten into a program at Cornell that didn't make you choose a major. You could take whatever classes you liked, and choose whatever you liked to put on your degree. I of course chose "Artificial Intelligence." When I got the actual physical diploma, I was dismayed to find that the quotes had been included, which made them read as scare-quotes. At the time this bothered me, but now it seems amusingly accurate, for reasons I was about to discover.
+
+I applied to 3 grad schools: MIT and Yale, which were renowned for AI at the time, and Harvard, which I'd visited because Rich Draves went there, and was also home to Bill Woods, who'd invented the type of parser I used in my SHRDLU clone. Only Harvard accepted me, so that was where I went.
+
+I don't remember the moment it happened, or if there even was a specific moment, but during the first year of grad school I realized that AI, as practiced at the time, was a hoax. By which I mean the sort of AI in which a program that's told "the dog is sitting on the chair" translates this into some formal representation and adds it to the list of things it knows.
+
+What these programs really showed was that there's a subset of natural language that's a formal language. But a very proper subset. It was clear that there was an unbridgeable gap between what they could do and actually understanding natural language. It was not, in fact, simply a matter of teaching SHRDLU more words. That whole way of doing AI, with explicit data structures representing concepts, was not going to work. Its brokenness did, as so often happens, generate a lot of opportunities to write papers about various band-aids that could be applied to it, but it was never going to get us Mike.
+
+So I looked around to see what I could salvage from the wreckage of my plans, and there was Lisp. I knew from experience that Lisp was interesting for its own sake and not just for its association with AI, even though that was the main reason people cared about it at the time. So I decided to focus on Lisp. In fact, I decided to write a book about Lisp hacking. It's scary to think how little I knew about Lisp hacking when I started writing that book. But there's nothing like writing a book about something to help you learn it. The book, On Lisp, wasn't published till 1993, but I wrote much of it in grad school.
+
+Computer Science is an uneasy alliance between two halves, theory and systems. The theory people prove things, and the systems people build things. I wanted to build things. I had plenty of respect for theory — indeed, a sneaking suspicion that it was the more admirable of the two halves — but building things seemed so much more exciting.
+
+The problem with systems work, though, was that it didn't last. Any program you wrote today, no matter how good, would be obsolete in a couple decades at best. People might mention your software in footnotes, but no one would actually use it. And indeed, it would seem very feeble work. Only people with a sense of the history of the field would even realize that, in its time, it had been good.
+
+There were some surplus Xerox Dandelions floating around the computer lab at one point. Anyone who wanted one to play around with could have one. I was briefly tempted, but they were so slow by present standards; what was the point? No one else wanted one either, so off they went. That was what happened to systems work.
+
+I wanted not just to build things, but to build things that would last.
+
+In this dissatisfied state I went in 1988 to visit Rich Draves at CMU, where he was in grad school. One day I went to visit the Carnegie Institute, where I'd spent a lot of time as a kid. While looking at a painting there I realized something that might seem obvious, but was a big surprise to me. There, right on the wall, was something you could make that would last. Paintings didn't become obsolete. Some of the best ones were hundreds of years old.
+
+And moreover this was something you could make a living doing. Not as easily as you could by writing software, of course, but I thought if you were really industrious and lived really cheaply, it had to be possible to make enough to survive. And as an artist you could be truly independent. You wouldn't have a boss, or even need to get research funding.
+
+I had always liked looking at paintings. Could I make them? I had no idea. I'd never imagined it was even possible. I knew intellectually that people made art — that it didn't just appear spontaneously — but it was as if the people who made it were a different species. They either lived long ago or were mysterious geniuses doing strange things in profiles in Life magazine. The idea of actually being able to make art, to put that verb before that noun, seemed almost miraculous.
+
+That fall I started taking art classes at Harvard. Grad students could take classes in any department, and my advisor, Tom Cheatham, was very easy going. If he even knew about the strange classes I was taking, he never said anything.
+
+So now I was in a PhD program in computer science, yet planning to be an artist, yet also genuinely in love with Lisp hacking and working away at On Lisp. In other words, like many a grad student, I was working energetically on multiple projects that were not my thesis.
+
+I didn't see a way out of this situation. I didn't want to drop out of grad school, but how else was I going to get out? I remember when my friend Robert Morris got kicked out of Cornell for writing the internet worm of 1988, I was envious that he'd found such a spectacular way to get out of grad school.
+
+Then one day in April 1990 a crack appeared in the wall. I ran into professor Cheatham and he asked if I was far enough along to graduate that June. I didn't have a word of my dissertation written, but in what must have been the quickest bit of thinking in my life, I decided to take a shot at writing one in the 5 weeks or so that remained before the deadline, reusing parts of On Lisp where I could, and I was able to respond, with no perceptible delay "Yes, I think so. I'll give you something to read in a few days."
+
+I picked applications of continuations as the topic. In retrospect I should have written about macros and embedded languages. There's a whole world there that's barely been explored. But all I wanted was to get out of grad school, and my rapidly written dissertation sufficed, just barely.
+
+Meanwhile I was applying to art schools. I applied to two: RISD in the US, and the Accademia di Belli Arti in Florence, which, because it was the oldest art school, I imagined would be good. RISD accepted me, and I never heard back from the Accademia, so off to Providence I went.
+
+I'd applied for the BFA program at RISD, which meant in effect that I had to go to college again. This was not as strange as it sounds, because I was only 25, and art schools are full of people of different ages. RISD counted me as a transfer sophomore and said I had to do the foundation that summer. The foundation means the classes that everyone has to take in fundamental subjects like drawing, color, and design.
+
+Toward the end of the summer I got a big surprise: a letter from the Accademia, which had been delayed because they'd sent it to Cambridge England instead of Cambridge Massachusetts, inviting me to take the entrance exam in Florence that fall. This was now only weeks away. My nice landlady let me leave my stuff in her attic. I had some money saved from consulting work I'd done in grad school; there was probably enough to last a year if I lived cheaply. Now all I had to do was learn Italian.
+
+Only stranieri (foreigners) had to take this entrance exam. In retrospect it may well have been a way of excluding them, because there were so many stranieri attracted by the idea of studying art in Florence that the Italian students would otherwise have been outnumbered. I was in decent shape at painting and drawing from the RISD foundation that summer, but I still don't know how I managed to pass the written exam. I remember that I answered the essay question by writing about Cezanne, and that I cranked up the intellectual level as high as I could to make the most of my limited vocabulary. [2]
+
+I'm only up to age 25 and already there are such conspicuous patterns. Here I was, yet again about to attend some august institution in the hopes of learning about some prestigious subject, and yet again about to be disappointed. The students and faculty in the painting department at the Accademia were the nicest people you could imagine, but they had long since arrived at an arrangement whereby the students wouldn't require the faculty to teach anything, and in return the faculty wouldn't require the students to learn anything. And at the same time all involved would adhere outwardly to the conventions of a 19th century atelier. We actually had one of those little stoves, fed with kindling, that you see in 19th century studio paintings, and a nude model sitting as close to it as possible without getting burned. Except hardly anyone else painted her besides me. The rest of the students spent their time chatting or occasionally trying to imitate things they'd seen in American art magazines.
+
+Our model turned out to live just down the street from me. She made a living from a combination of modelling and making fakes for a local antique dealer. She'd copy an obscure old painting out of a book, and then he'd take the copy and maltreat it to make it look old. [3]
+
+While I was a student at the Accademia I started painting still lives in my bedroom at night. These paintings were tiny, because the room was, and because I painted them on leftover scraps of canvas, which was all I could afford at the time. Painting still lives is different from painting people, because the subject, as its name suggests, can't move. People can't sit for more than about 15 minutes at a time, and when they do they don't sit very still. So the traditional m.o. for painting people is to know how to paint a generic person, which you then modify to match the specific person you're painting. Whereas a still life you can, if you want, copy pixel by pixel from what you're seeing. You don't want to stop there, of course, or you get merely photographic accuracy, and what makes a still life interesting is that it's been through a head. You want to emphasize the visual cues that tell you, for example, that the reason the color changes suddenly at a certain point is that it's the edge of an object. By subtly emphasizing such things you can make paintings that are more realistic than photographs not just in some metaphorical sense, but in the strict information-theoretic sense. [4]
+
+I liked painting still lives because I was curious about what I was seeing. In everyday life, we aren't consciously aware of much we're seeing. Most visual perception is handled by low-level processes that merely tell your brain "that's a water droplet" without telling you details like where the lightest and darkest points are, or "that's a bush" without telling you the shape and position of every leaf. This is a feature of brains, not a bug. In everyday life it would be distracting to notice every leaf on every bush. But when you have to paint something, you have to look more closely, and when you do there's a lot to see. You can still be noticing new things after days of trying to paint something people usually take for granted, just as you can after days of trying to write an essay about something people usually take for granted.
+
+This is not the only way to paint. I'm not 100% sure it's even a good way to paint. But it seemed a good enough bet to be worth trying.
+
+Our teacher, professor Ulivi, was a nice guy. He could see I worked hard, and gave me a good grade, which he wrote down in a sort of passport each student had. But the Accademia wasn't teaching me anything except Italian, and my money was running out, so at the end of the first year I went back to the US.
+
+I wanted to go back to RISD, but I was now broke and RISD was very expensive, so I decided to get a job for a year and then return to RISD the next fall. I got one at a company called Interleaf, which made software for creating documents. You mean like Microsoft Word? Exactly. That was how I learned that low end software tends to eat high end software. But Interleaf still had a few years to live yet. [5]
+
+Interleaf had done something pretty bold. Inspired by Emacs, they'd added a scripting language, and even made the scripting language a dialect of Lisp. Now they wanted a Lisp hacker to write things in it. This was the closest thing I've had to a normal job, and I hereby apologize to my boss and coworkers, because I was a bad employee. Their Lisp was the thinnest icing on a giant C cake, and since I didn't know C and didn't want to learn it, I never understood most of the software. Plus I was terribly irresponsible. This was back when a programming job meant showing up every day during certain working hours. That seemed unnatural to me, and on this point the rest of the world is coming around to my way of thinking, but at the time it caused a lot of friction. Toward the end of the year I spent much of my time surreptitiously working on On Lisp, which I had by this time gotten a contract to publish.
+
+The good part was that I got paid huge amounts of money, especially by art student standards. In Florence, after paying my part of the rent, my budget for everything else had been $7 a day. Now I was getting paid more than 4 times that every hour, even when I was just sitting in a meeting. By living cheaply I not only managed to save enough to go back to RISD, but also paid off my college loans.
+
+I learned some useful things at Interleaf, though they were mostly about what not to do. I learned that it's better for technology companies to be run by product people than sales people (though sales is a real skill and people who are good at it are really good at it), that it leads to bugs when code is edited by too many people, that cheap office space is no bargain if it's depressing, that planned meetings are inferior to corridor conversations, that big, bureaucratic customers are a dangerous source of money, and that there's not much overlap between conventional office hours and the optimal time for hacking, or conventional offices and the optimal place for it.
+
+But the most important thing I learned, and which I used in both Viaweb and Y Combinator, is that the low end eats the high end: that it's good to be the "entry level" option, even though that will be less prestigious, because if you're not, someone else will be, and will squash you against the ceiling. Which in turn means that prestige is a danger sign.
+
+When I left to go back to RISD the next fall, I arranged to do freelance work for the group that did projects for customers, and this was how I survived for the next several years. When I came back to visit for a project later on, someone told me about a new thing called HTML, which was, as he described it, a derivative of SGML. Markup language enthusiasts were an occupational hazard at Interleaf and I ignored him, but this HTML thing later became a big part of my life.
+
+In the fall of 1992 I moved back to Providence to continue at RISD. The foundation had merely been intro stuff, and the Accademia had been a (very civilized) joke. Now I was going to see what real art school was like. But alas it was more like the Accademia than not. Better organized, certainly, and a lot more expensive, but it was now becoming clear that art school did not bear the same relationship to art that medical school bore to medicine. At least not the painting department. The textile department, which my next door neighbor belonged to, seemed to be pretty rigorous. No doubt illustration and architecture were too. But painting was post-rigorous. Painting students were supposed to express themselves, which to the more worldly ones meant to try to cook up some sort of distinctive signature style.
+
+A signature style is the visual equivalent of what in show business is known as a "schtick": something that immediately identifies the work as yours and no one else's. For example, when you see a painting that looks like a certain kind of cartoon, you know it's by Roy Lichtenstein. So if you see a big painting of this type hanging in the apartment of a hedge fund manager, you know he paid millions of dollars for it. That's not always why artists have a signature style, but it's usually why buyers pay a lot for such work. [6]
+
+There were plenty of earnest students too: kids who "could draw" in high school, and now had come to what was supposed to be the best art school in the country, to learn to draw even better. They tended to be confused and demoralized by what they found at RISD, but they kept going, because painting was what they did. I was not one of the kids who could draw in high school, but at RISD I was definitely closer to their tribe than the tribe of signature style seekers.
+
+I learned a lot in the color class I took at RISD, but otherwise I was basically teaching myself to paint, and I could do that for free. So in 1993 I dropped out. I hung around Providence for a bit, and then my college friend Nancy Parmet did me a big favor. A rent-controlled apartment in a building her mother owned in New York was becoming vacant. Did I want it? It wasn't much more than my current place, and New York was supposed to be where the artists were. So yes, I wanted it! [7]
+
+Asterix comics begin by zooming in on a tiny corner of Roman Gaul that turns out not to be controlled by the Romans. You can do something similar on a map of New York City: if you zoom in on the Upper East Side, there's a tiny corner that's not rich, or at least wasn't in 1993. It's called Yorkville, and that was my new home. Now I was a New York artist — in the strictly technical sense of making paintings and living in New York.
+
+I was nervous about money, because I could sense that Interleaf was on the way down. Freelance Lisp hacking work was very rare, and I didn't want to have to program in another language, which in those days would have meant C++ if I was lucky. So with my unerring nose for financial opportunity, I decided to write another book on Lisp. This would be a popular book, the sort of book that could be used as a textbook. I imagined myself living frugally off the royalties and spending all my time painting. (The painting on the cover of this book, ANSI Common Lisp, is one that I painted around this time.)
+
+The best thing about New York for me was the presence of Idelle and Julian Weber. Idelle Weber was a painter, one of the early photorealists, and I'd taken her painting class at Harvard. I've never known a teacher more beloved by her students. Large numbers of former students kept in touch with her, including me. After I moved to New York I became her de facto studio assistant.
+
+She liked to paint on big, square canvases, 4 to 5 feet on a side. One day in late 1994 as I was stretching one of these monsters there was something on the radio about a famous fund manager. He wasn't that much older than me, and was super rich. The thought suddenly occurred to me: why don't I become rich? Then I'll be able to work on whatever I want.
+
+Meanwhile I'd been hearing more and more about this new thing called the World Wide Web. Robert Morris showed it to me when I visited him in Cambridge, where he was now in grad school at Harvard. It seemed to me that the web would be a big deal. I'd seen what graphical user interfaces had done for the popularity of microcomputers. It seemed like the web would do the same for the internet.
+
+If I wanted to get rich, here was the next train leaving the station. I was right about that part. What I got wrong was the idea. I decided we should start a company to put art galleries online. I can't honestly say, after reading so many Y Combinator applications, that this was the worst startup idea ever, but it was up there. Art galleries didn't want to be online, and still don't, not the fancy ones. That's not how they sell. I wrote some software to generate web sites for galleries, and Robert wrote some to resize images and set up an http server to serve the pages. Then we tried to sign up galleries. To call this a difficult sale would be an understatement. It was difficult to give away. A few galleries let us make sites for them for free, but none paid us.
+
+Then some online stores started to appear, and I realized that except for the order buttons they were identical to the sites we'd been generating for galleries. This impressive-sounding thing called an "internet storefront" was something we already knew how to build.
+
+So in the summer of 1995, after I submitted the camera-ready copy of ANSI Common Lisp to the publishers, we started trying to write software to build online stores. At first this was going to be normal desktop software, which in those days meant Windows software. That was an alarming prospect, because neither of us knew how to write Windows software or wanted to learn. We lived in the Unix world. But we decided we'd at least try writing a prototype store builder on Unix. Robert wrote a shopping cart, and I wrote a new site generator for stores — in Lisp, of course.
+
+We were working out of Robert's apartment in Cambridge. His roommate was away for big chunks of time, during which I got to sleep in his room. For some reason there was no bed frame or sheets, just a mattress on the floor. One morning as I was lying on this mattress I had an idea that made me sit up like a capital L. What if we ran the software on the server, and let users control it by clicking on links? Then we'd never have to write anything to run on users' computers. We could generate the sites on the same server we'd serve them from. Users wouldn't need anything more than a browser.
+
+This kind of software, known as a web app, is common now, but at the time it wasn't clear that it was even possible. To find out, we decided to try making a version of our store builder that you could control through the browser. A couple days later, on August 12, we had one that worked. The UI was horrible, but it proved you could build a whole store through the browser, without any client software or typing anything into the command line on the server.
+
+Now we felt like we were really onto something. I had visions of a whole new generation of software working this way. You wouldn't need versions, or ports, or any of that crap. At Interleaf there had been a whole group called Release Engineering that seemed to be at least as big as the group that actually wrote the software. Now you could just update the software right on the server.
+
+We started a new company we called Viaweb, after the fact that our software worked via the web, and we got $10,000 in seed funding from Idelle's husband Julian. In return for that and doing the initial legal work and giving us business advice, we gave him 10% of the company. Ten years later this deal became the model for Y Combinator's. We knew founders needed something like this, because we'd needed it ourselves.
+
+At this stage I had a negative net worth, because the thousand dollars or so I had in the bank was more than counterbalanced by what I owed the government in taxes. (Had I diligently set aside the proper proportion of the money I'd made consulting for Interleaf? No, I had not.) So although Robert had his graduate student stipend, I needed that seed funding to live on.
+
+We originally hoped to launch in September, but we got more ambitious about the software as we worked on it. Eventually we managed to build a WYSIWYG site builder, in the sense that as you were creating pages, they looked exactly like the static ones that would be generated later, except that instead of leading to static pages, the links all referred to closures stored in a hash table on the server.
+
+It helped to have studied art, because the main goal of an online store builder is to make users look legit, and the key to looking legit is high production values. If you get page layouts and fonts and colors right, you can make a guy running a store out of his bedroom look more legit than a big company.
+
+(If you're curious why my site looks so old-fashioned, it's because it's still made with this software. It may look clunky today, but in 1996 it was the last word in slick.)
+
+In September, Robert rebelled. "We've been working on this for a month," he said, "and it's still not done." This is funny in retrospect, because he would still be working on it almost 3 years later. But I decided it might be prudent to recruit more programmers, and I asked Robert who else in grad school with him was really good. He recommended Trevor Blackwell, which surprised me at first, because at that point I knew Trevor mainly for his plan to reduce everything in his life to a stack of notecards, which he carried around with him. But Rtm was right, as usual. Trevor turned out to be a frighteningly effective hacker.
+
+It was a lot of fun working with Robert and Trevor. They're the two most independent-minded people I know, and in completely different ways. If you could see inside Rtm's brain it would look like a colonial New England church, and if you could see inside Trevor's it would look like the worst excesses of Austrian Rococo.
+
+We opened for business, with 6 stores, in January 1996. It was just as well we waited a few months, because although we worried we were late, we were actually almost fatally early. There was a lot of talk in the press then about ecommerce, but not many people actually wanted online stores. [8]
+
+There were three main parts to the software: the editor, which people used to build sites and which I wrote, the shopping cart, which Robert wrote, and the manager, which kept track of orders and statistics, and which Trevor wrote. In its time, the editor was one of the best general-purpose site builders. I kept the code tight and didn't have to integrate with any other software except Robert's and Trevor's, so it was quite fun to work on. If all I'd had to do was work on this software, the next 3 years would have been the easiest of my life. Unfortunately I had to do a lot more, all of it stuff I was worse at than programming, and the next 3 years were instead the most stressful.
+
+There were a lot of startups making ecommerce software in the second half of the 90s. We were determined to be the Microsoft Word, not the Interleaf. Which meant being easy to use and inexpensive. It was lucky for us that we were poor, because that caused us to make Viaweb even more inexpensive than we realized. We charged $100 a month for a small store and $300 a month for a big one. This low price was a big attraction, and a constant thorn in the sides of competitors, but it wasn't because of some clever insight that we set the price low. We had no idea what businesses paid for things. $300 a month seemed like a lot of money to us.
+
+We did a lot of things right by accident like that. For example, we did what's now called "doing things that don't scale," although at the time we would have described it as "being so lame that we're driven to the most desperate measures to get users." The most common of which was building stores for them. This seemed particularly humiliating, since the whole raison d'etre of our software was that people could use it to make their own stores. But anything to get users.
+
+We learned a lot more about retail than we wanted to know. For example, that if you could only have a small image of a man's shirt (and all images were small then by present standards), it was better to have a closeup of the collar than a picture of the whole shirt. The reason I remember learning this was that it meant I had to rescan about 30 images of men's shirts. My first set of scans were so beautiful too.
+
+Though this felt wrong, it was exactly the right thing to be doing. Building stores for users taught us about retail, and about how it felt to use our software. I was initially both mystified and repelled by "business" and thought we needed a "business person" to be in charge of it, but once we started to get users, I was converted, in much the same way I was converted to fatherhood once I had kids. Whatever users wanted, I was all theirs. Maybe one day we'd have so many users that I couldn't scan their images for them, but in the meantime there was nothing more important to do.
+
+Another thing I didn't get at the time is that growth rate is the ultimate test of a startup. Our growth rate was fine. We had about 70 stores at the end of 1996 and about 500 at the end of 1997. I mistakenly thought the thing that mattered was the absolute number of users. And that is the thing that matters in the sense that that's how much money you're making, and if you're not making enough, you might go out of business. But in the long term the growth rate takes care of the absolute number. If we'd been a startup I was advising at Y Combinator, I would have said: Stop being so stressed out, because you're doing fine. You're growing 7x a year. Just don't hire too many more people and you'll soon be profitable, and then you'll control your own destiny.
+
+Alas I hired lots more people, partly because our investors wanted me to, and partly because that's what startups did during the Internet Bubble. A company with just a handful of employees would have seemed amateurish. So we didn't reach breakeven until about when Yahoo bought us in the summer of 1998. Which in turn meant we were at the mercy of investors for the entire life of the company. And since both we and our investors were noobs at startups, the result was a mess even by startup standards.
+
+It was a huge relief when Yahoo bought us. In principle our Viaweb stock was valuable. It was a share in a business that was profitable and growing rapidly. But it didn't feel very valuable to me; I had no idea how to value a business, but I was all too keenly aware of the near-death experiences we seemed to have every few months. Nor had I changed my grad student lifestyle significantly since we started. So when Yahoo bought us it felt like going from rags to riches. Since we were going to California, I bought a car, a yellow 1998 VW GTI. I remember thinking that its leather seats alone were by far the most luxurious thing I owned.
+
+The next year, from the summer of 1998 to the summer of 1999, must have been the least productive of my life. I didn't realize it at the time, but I was worn out from the effort and stress of running Viaweb. For a while after I got to California I tried to continue my usual m.o. of programming till 3 in the morning, but fatigue combined with Yahoo's prematurely aged culture and grim cube farm in Santa Clara gradually dragged me down. After a few months it felt disconcertingly like working at Interleaf.
+
+Yahoo had given us a lot of options when they bought us. At the time I thought Yahoo was so overvalued that they'd never be worth anything, but to my astonishment the stock went up 5x in the next year. I hung on till the first chunk of options vested, then in the summer of 1999 I left. It had been so long since I'd painted anything that I'd half forgotten why I was doing this. My brain had been entirely full of software and men's shirts for 4 years. But I had done this to get rich so I could paint, I reminded myself, and now I was rich, so I should go paint.
+
+When I said I was leaving, my boss at Yahoo had a long conversation with me about my plans. I told him all about the kinds of pictures I wanted to paint. At the time I was touched that he took such an interest in me. Now I realize it was because he thought I was lying. My options at that point were worth about $2 million a month. If I was leaving that kind of money on the table, it could only be to go and start some new startup, and if I did, I might take people with me. This was the height of the Internet Bubble, and Yahoo was ground zero of it. My boss was at that moment a billionaire. Leaving then to start a new startup must have seemed to him an insanely, and yet also plausibly, ambitious plan.
+
+But I really was quitting to paint, and I started immediately. There was no time to lose. I'd already burned 4 years getting rich. Now when I talk to founders who are leaving after selling their companies, my advice is always the same: take a vacation. That's what I should have done, just gone off somewhere and done nothing for a month or two, but the idea never occurred to me.
+
+So I tried to paint, but I just didn't seem to have any energy or ambition. Part of the problem was that I didn't know many people in California. I'd compounded this problem by buying a house up in the Santa Cruz Mountains, with a beautiful view but miles from anywhere. I stuck it out for a few more months, then in desperation I went back to New York, where unless you understand about rent control you'll be surprised to hear I still had my apartment, sealed up like a tomb of my old life. Idelle was in New York at least, and there were other people trying to paint there, even though I didn't know any of them.
+
+When I got back to New York I resumed my old life, except now I was rich. It was as weird as it sounds. I resumed all my old patterns, except now there were doors where there hadn't been. Now when I was tired of walking, all I had to do was raise my hand, and (unless it was raining) a taxi would stop to pick me up. Now when I walked past charming little restaurants I could go in and order lunch. It was exciting for a while. Painting started to go better. I experimented with a new kind of still life where I'd paint one painting in the old way, then photograph it and print it, blown up, on canvas, and then use that as the underpainting for a second still life, painted from the same objects (which hopefully hadn't rotted yet).
+
+Meanwhile I looked for an apartment to buy. Now I could actually choose what neighborhood to live in. Where, I asked myself and various real estate agents, is the Cambridge of New York? Aided by occasional visits to actual Cambridge, I gradually realized there wasn't one. Huh.
+
+Around this time, in the spring of 2000, I had an idea. It was clear from our experience with Viaweb that web apps were the future. Why not build a web app for making web apps? Why not let people edit code on our server through the browser, and then host the resulting applications for them? [9] You could run all sorts of services on the servers that these applications could use just by making an API call: making and receiving phone calls, manipulating images, taking credit card payments, etc.
+
+I got so excited about this idea that I couldn't think about anything else. It seemed obvious that this was the future. I didn't particularly want to start another company, but it was clear that this idea would have to be embodied as one, so I decided to move to Cambridge and start it. I hoped to lure Robert into working on it with me, but there I ran into a hitch. Robert was now a postdoc at MIT, and though he'd made a lot of money the last time I'd lured him into working on one of my schemes, it had also been a huge time sink. So while he agreed that it sounded like a plausible idea, he firmly refused to work on it.
+
+Hmph. Well, I'd do it myself then. I recruited Dan Giffin, who had worked for Viaweb, and two undergrads who wanted summer jobs, and we got to work trying to build what it's now clear is about twenty companies and several open source projects worth of software. The language for defining applications would of course be a dialect of Lisp. But I wasn't so naive as to assume I could spring an overt Lisp on a general audience; we'd hide the parentheses, like Dylan did.
+
+By then there was a name for the kind of company Viaweb was, an "application service provider," or ASP. This name didn't last long before it was replaced by "software as a service," but it was current for long enough that I named this new company after it: it was going to be called Aspra.
+
+I started working on the application builder, Dan worked on network infrastructure, and the two undergrads worked on the first two services (images and phone calls). But about halfway through the summer I realized I really didn't want to run a company — especially not a big one, which it was looking like this would have to be. I'd only started Viaweb because I needed the money. Now that I didn't need money anymore, why was I doing this? If this vision had to be realized as a company, then screw the vision. I'd build a subset that could be done as an open source project.
+
+Much to my surprise, the time I spent working on this stuff was not wasted after all. After we started Y Combinator, I would often encounter startups working on parts of this new architecture, and it was very useful to have spent so much time thinking about it and even trying to write some of it.
+
+The subset I would build as an open source project was the new Lisp, whose parentheses I now wouldn't even have to hide. A lot of Lisp hackers dream of building a new Lisp, partly because one of the distinctive features of the language is that it has dialects, and partly, I think, because we have in our minds a Platonic form of Lisp that all existing dialects fall short of. I certainly did. So at the end of the summer Dan and I switched to working on this new dialect of Lisp, which I called Arc, in a house I bought in Cambridge.
+
+The following spring, lightning struck. I was invited to give a talk at a Lisp conference, so I gave one about how we'd used Lisp at Viaweb. Afterward I put a postscript file of this talk online, on paulgraham.com, which I'd created years before using Viaweb but had never used for anything. In one day it got 30,000 page views. What on earth had happened? The referring urls showed that someone had posted it on Slashdot. [10]
+
+Wow, I thought, there's an audience. If I write something and put it on the web, anyone can read it. That may seem obvious now, but it was surprising then. In the print era there was a narrow channel to readers, guarded by fierce monsters known as editors. The only way to get an audience for anything you wrote was to get it published as a book, or in a newspaper or magazine. Now anyone could publish anything.
+
+This had been possible in principle since 1993, but not many people had realized it yet. I had been intimately involved with building the infrastructure of the web for most of that time, and a writer as well, and it had taken me 8 years to realize it. Even then it took me several years to understand the implications. It meant there would be a whole new generation of essays. [11]
+
+In the print era, the channel for publishing essays had been vanishingly small. Except for a few officially anointed thinkers who went to the right parties in New York, the only people allowed to publish essays were specialists writing about their specialties. There were so many essays that had never been written, because there had been no way to publish them. Now they could be, and I was going to write them. [12]
+
+I've worked on several different things, but to the extent there was a turning point where I figured out what to work on, it was when I started publishing essays online. From then on I knew that whatever else I did, I'd always write essays too.
+
+I knew that online essays would be a marginal medium at first. Socially they'd seem more like rants posted by nutjobs on their GeoCities sites than the genteel and beautifully typeset compositions published in The New Yorker. But by this point I knew enough to find that encouraging instead of discouraging.
+
+One of the most conspicuous patterns I've noticed in my life is how well it has worked, for me at least, to work on things that weren't prestigious. Still life has always been the least prestigious form of painting. Viaweb and Y Combinator both seemed lame when we started them. I still get the glassy eye from strangers when they ask what I'm writing, and I explain that it's an essay I'm going to publish on my web site. Even Lisp, though prestigious intellectually in something like the way Latin is, also seems about as hip.
+
+It's not that unprestigious types of work are good per se. But when you find yourself drawn to some kind of work despite its current lack of prestige, it's a sign both that there's something real to be discovered there, and that you have the right kind of motives. Impure motives are a big danger for the ambitious. If anything is going to lead you astray, it will be the desire to impress people. So while working on things that aren't prestigious doesn't guarantee you're on the right track, it at least guarantees you're not on the most common type of wrong one.
+
+Over the next several years I wrote lots of essays about all kinds of different topics. O'Reilly reprinted a collection of them as a book, called Hackers & Painters after one of the essays in it. I also worked on spam filters, and did some more painting. I used to have dinners for a group of friends every thursday night, which taught me how to cook for groups. And I bought another building in Cambridge, a former candy factory (and later, twas said, porn studio), to use as an office.
+
+One night in October 2003 there was a big party at my house. It was a clever idea of my friend Maria Daniels, who was one of the thursday diners. Three separate hosts would all invite their friends to one party. So for every guest, two thirds of the other guests would be people they didn't know but would probably like. One of the guests was someone I didn't know but would turn out to like a lot: a woman called Jessica Livingston. A couple days later I asked her out.
+
+Jessica was in charge of marketing at a Boston investment bank. This bank thought it understood startups, but over the next year, as she met friends of mine from the startup world, she was surprised how different reality was. And how colorful their stories were. So she decided to compile a book of interviews with startup founders.
+
+When the bank had financial problems and she had to fire half her staff, she started looking for a new job. In early 2005 she interviewed for a marketing job at a Boston VC firm. It took them weeks to make up their minds, and during this time I started telling her about all the things that needed to be fixed about venture capital. They should make a larger number of smaller investments instead of a handful of giant ones, they should be funding younger, more technical founders instead of MBAs, they should let the founders remain as CEO, and so on.
+
+One of my tricks for writing essays had always been to give talks. The prospect of having to stand up in front of a group of people and tell them something that won't waste their time is a great spur to the imagination. When the Harvard Computer Society, the undergrad computer club, asked me to give a talk, I decided I would tell them how to start a startup. Maybe they'd be able to avoid the worst of the mistakes we'd made.
+
+So I gave this talk, in the course of which I told them that the best sources of seed funding were successful startup founders, because then they'd be sources of advice too. Whereupon it seemed they were all looking expectantly at me. Horrified at the prospect of having my inbox flooded by business plans (if I'd only known), I blurted out "But not me!" and went on with the talk. But afterward it occurred to me that I should really stop procrastinating about angel investing. I'd been meaning to since Yahoo bought us, and now it was 7 years later and I still hadn't done one angel investment.
+
+Meanwhile I had been scheming with Robert and Trevor about projects we could work on together. I missed working with them, and it seemed like there had to be something we could collaborate on.
+
+As Jessica and I were walking home from dinner on March 11, at the corner of Garden and Walker streets, these three threads converged. Screw the VCs who were taking so long to make up their minds. We'd start our own investment firm and actually implement the ideas we'd been talking about. I'd fund it, and Jessica could quit her job and work for it, and we'd get Robert and Trevor as partners too. [13]
+
+Once again, ignorance worked in our favor. We had no idea how to be angel investors, and in Boston in 2005 there were no Ron Conways to learn from. So we just made what seemed like the obvious choices, and some of the things we did turned out to be novel.
+
+There are multiple components to Y Combinator, and we didn't figure them all out at once. The part we got first was to be an angel firm. In those days, those two words didn't go together. There were VC firms, which were organized companies with people whose job it was to make investments, but they only did big, million dollar investments. And there were angels, who did smaller investments, but these were individuals who were usually focused on other things and made investments on the side. And neither of them helped founders enough in the beginning. We knew how helpless founders were in some respects, because we remembered how helpless we'd been. For example, one thing Julian had done for us that seemed to us like magic was to get us set up as a company. We were fine writing fairly difficult software, but actually getting incorporated, with bylaws and stock and all that stuff, how on earth did you do that? Our plan was not only to make seed investments, but to do for startups everything Julian had done for us.
+
+YC was not organized as a fund. It was cheap enough to run that we funded it with our own money. That went right by 99% of readers, but professional investors are thinking "Wow, that means they got all the returns." But once again, this was not due to any particular insight on our part. We didn't know how VC firms were organized. It never occurred to us to try to raise a fund, and if it had, we wouldn't have known where to start. [14]
+
+The most distinctive thing about YC is the batch model: to fund a bunch of startups all at once, twice a year, and then to spend three months focusing intensively on trying to help them. That part we discovered by accident, not merely implicitly but explicitly due to our ignorance about investing. We needed to get experience as investors. What better way, we thought, than to fund a whole bunch of startups at once? We knew undergrads got temporary jobs at tech companies during the summer. Why not organize a summer program where they'd start startups instead? We wouldn't feel guilty for being in a sense fake investors, because they would in a similar sense be fake founders. So while we probably wouldn't make much money out of it, we'd at least get to practice being investors on them, and they for their part would probably have a more interesting summer than they would working at Microsoft.
+
+We'd use the building I owned in Cambridge as our headquarters. We'd all have dinner there once a week — on tuesdays, since I was already cooking for the thursday diners on thursdays — and after dinner we'd bring in experts on startups to give talks.
+
+We knew undergrads were deciding then about summer jobs, so in a matter of days we cooked up something we called the Summer Founders Program, and I posted an announcement on my site, inviting undergrads to apply. I had never imagined that writing essays would be a way to get "deal flow," as investors call it, but it turned out to be the perfect source. [15] We got 225 applications for the Summer Founders Program, and we were surprised to find that a lot of them were from people who'd already graduated, or were about to that spring. Already this SFP thing was starting to feel more serious than we'd intended.
+
+We invited about 20 of the 225 groups to interview in person, and from those we picked 8 to fund. They were an impressive group. That first batch included reddit, Justin Kan and Emmett Shear, who went on to found Twitch, Aaron Swartz, who had already helped write the RSS spec and would a few years later become a martyr for open access, and Sam Altman, who would later become the second president of YC. I don't think it was entirely luck that the first batch was so good. You had to be pretty bold to sign up for a weird thing like the Summer Founders Program instead of a summer job at a legit place like Microsoft or Goldman Sachs.
+
+The deal for startups was based on a combination of the deal we did with Julian ($10k for 10%) and what Robert said MIT grad students got for the summer ($6k). We invested $6k per founder, which in the typical two-founder case was $12k, in return for 6%. That had to be fair, because it was twice as good as the deal we ourselves had taken. Plus that first summer, which was really hot, Jessica brought the founders free air conditioners. [16]
+
+Fairly quickly I realized that we had stumbled upon the way to scale startup funding. Funding startups in batches was more convenient for us, because it meant we could do things for a lot of startups at once, but being part of a batch was better for the startups too. It solved one of the biggest problems faced by founders: the isolation. Now you not only had colleagues, but colleagues who understood the problems you were facing and could tell you how they were solving them.
+
+As YC grew, we started to notice other advantages of scale. The alumni became a tight community, dedicated to helping one another, and especially the current batch, whose shoes they remembered being in. We also noticed that the startups were becoming one another's customers. We used to refer jokingly to the "YC GDP," but as YC grows this becomes less and less of a joke. Now lots of startups get their initial set of customers almost entirely from among their batchmates.
+
+I had not originally intended YC to be a full-time job. I was going to do three things: hack, write essays, and work on YC. As YC grew, and I grew more excited about it, it started to take up a lot more than a third of my attention. But for the first few years I was still able to work on other things.
+
+In the summer of 2006, Robert and I started working on a new version of Arc. This one was reasonably fast, because it was compiled into Scheme. To test this new Arc, I wrote Hacker News in it. It was originally meant to be a news aggregator for startup founders and was called Startup News, but after a few months I got tired of reading about nothing but startups. Plus it wasn't startup founders we wanted to reach. It was future startup founders. So I changed the name to Hacker News and the topic to whatever engaged one's intellectual curiosity.
+
+HN was no doubt good for YC, but it was also by far the biggest source of stress for me. If all I'd had to do was select and help founders, life would have been so easy. And that implies that HN was a mistake. Surely the biggest source of stress in one's work should at least be something close to the core of the work. Whereas I was like someone who was in pain while running a marathon not from the exertion of running, but because I had a blister from an ill-fitting shoe. When I was dealing with some urgent problem during YC, there was about a 60% chance it had to do with HN, and a 40% chance it had do with everything else combined. [17]
+
+As well as HN, I wrote all of YC's internal software in Arc. But while I continued to work a good deal in Arc, I gradually stopped working on Arc, partly because I didn't have time to, and partly because it was a lot less attractive to mess around with the language now that we had all this infrastructure depending on it. So now my three projects were reduced to two: writing essays and working on YC.
+
+YC was different from other kinds of work I've done. Instead of deciding for myself what to work on, the problems came to me. Every 6 months there was a new batch of startups, and their problems, whatever they were, became our problems. It was very engaging work, because their problems were quite varied, and the good founders were very effective. If you were trying to learn the most you could about startups in the shortest possible time, you couldn't have picked a better way to do it.
+
+There were parts of the job I didn't like. Disputes between cofounders, figuring out when people were lying to us, fighting with people who maltreated the startups, and so on. But I worked hard even at the parts I didn't like. I was haunted by something Kevin Hale once said about companies: "No one works harder than the boss." He meant it both descriptively and prescriptively, and it was the second part that scared me. I wanted YC to be good, so if how hard I worked set the upper bound on how hard everyone else worked, I'd better work very hard.
+
+One day in 2010, when he was visiting California for interviews, Robert Morris did something astonishing: he offered me unsolicited advice. I can only remember him doing that once before. One day at Viaweb, when I was bent over double from a kidney stone, he suggested that it would be a good idea for him to take me to the hospital. That was what it took for Rtm to offer unsolicited advice. So I remember his exact words very clearly. "You know," he said, "you should make sure Y Combinator isn't the last cool thing you do."
+
+At the time I didn't understand what he meant, but gradually it dawned on me that he was saying I should quit. This seemed strange advice, because YC was doing great. But if there was one thing rarer than Rtm offering advice, it was Rtm being wrong. So this set me thinking. It was true that on my current trajectory, YC would be the last thing I did, because it was only taking up more of my attention. It had already eaten Arc, and was in the process of eating essays too. Either YC was my life's work or I'd have to leave eventually. And it wasn't, so I would.
+
+In the summer of 2012 my mother had a stroke, and the cause turned out to be a blood clot caused by colon cancer. The stroke destroyed her balance, and she was put in a nursing home, but she really wanted to get out of it and back to her house, and my sister and I were determined to help her do it. I used to fly up to Oregon to visit her regularly, and I had a lot of time to think on those flights. On one of them I realized I was ready to hand YC over to someone else.
+
+I asked Jessica if she wanted to be president, but she didn't, so we decided we'd try to recruit Sam Altman. We talked to Robert and Trevor and we agreed to make it a complete changing of the guard. Up till that point YC had been controlled by the original LLC we four had started. But we wanted YC to last for a long time, and to do that it couldn't be controlled by the founders. So if Sam said yes, we'd let him reorganize YC. Robert and I would retire, and Jessica and Trevor would become ordinary partners.
+
+When we asked Sam if he wanted to be president of YC, initially he said no. He wanted to start a startup to make nuclear reactors. But I kept at it, and in October 2013 he finally agreed. We decided he'd take over starting with the winter 2014 batch. For the rest of 2013 I left running YC more and more to Sam, partly so he could learn the job, and partly because I was focused on my mother, whose cancer had returned.
+
+She died on January 15, 2014. We knew this was coming, but it was still hard when it did.
+
+I kept working on YC till March, to help get that batch of startups through Demo Day, then I checked out pretty completely. (I still talk to alumni and to new startups working on things I'm interested in, but that only takes a few hours a week.)
+
+What should I do next? Rtm's advice hadn't included anything about that. I wanted to do something completely different, so I decided I'd paint. I wanted to see how good I could get if I really focused on it. So the day after I stopped working on YC, I started painting. I was rusty and it took a while to get back into shape, but it was at least completely engaging. [18]
+
+I spent most of the rest of 2014 painting. I'd never been able to work so uninterruptedly before, and I got to be better than I had been. Not good enough, but better. Then in November, right in the middle of a painting, I ran out of steam. Up till that point I'd always been curious to see how the painting I was working on would turn out, but suddenly finishing this one seemed like a chore. So I stopped working on it and cleaned my brushes and haven't painted since. So far anyway.
+
+I realize that sounds rather wimpy. But attention is a zero sum game. If you can choose what to work on, and you choose a project that's not the best one (or at least a good one) for you, then it's getting in the way of another project that is. And at 50 there was some opportunity cost to screwing around.
+
+I started writing essays again, and wrote a bunch of new ones over the next few months. I even wrote a couple that weren't about startups. Then in March 2015 I started working on Lisp again.
+
+The distinctive thing about Lisp is that its core is a language defined by writing an interpreter in itself. It wasn't originally intended as a programming language in the ordinary sense. It was meant to be a formal model of computation, an alternative to the Turing machine. If you want to write an interpreter for a language in itself, what's the minimum set of predefined operators you need? The Lisp that John McCarthy invented, or more accurately discovered, is an answer to that question. [19]
+
+McCarthy didn't realize this Lisp could even be used to program computers till his grad student Steve Russell suggested it. Russell translated McCarthy's interpreter into IBM 704 machine language, and from that point Lisp started also to be a programming language in the ordinary sense. But its origins as a model of computation gave it a power and elegance that other languages couldn't match. It was this that attracted me in college, though I didn't understand why at the time.
+
+McCarthy's 1960 Lisp did nothing more than interpret Lisp expressions. It was missing a lot of things you'd want in a programming language. So these had to be added, and when they were, they weren't defined using McCarthy's original axiomatic approach. That wouldn't have been feasible at the time. McCarthy tested his interpreter by hand-simulating the execution of programs. But it was already getting close to the limit of interpreters you could test that way — indeed, there was a bug in it that McCarthy had overlooked. To test a more complicated interpreter, you'd have had to run it, and computers then weren't powerful enough.
+
+Now they are, though. Now you could continue using McCarthy's axiomatic approach till you'd defined a complete programming language. And as long as every change you made to McCarthy's Lisp was a discoveredness-preserving transformation, you could, in principle, end up with a complete language that had this quality. Harder to do than to talk about, of course, but if it was possible in principle, why not try? So I decided to take a shot at it. It took 4 years, from March 26, 2015 to October 12, 2019. It was fortunate that I had a precisely defined goal, or it would have been hard to keep at it for so long.
+
+I wrote this new Lisp, called Bel, in itself in Arc. That may sound like a contradiction, but it's an indication of the sort of trickery I had to engage in to make this work. By means of an egregious collection of hacks I managed to make something close enough to an interpreter written in itself that could actually run. Not fast, but fast enough to test.
+
+I had to ban myself from writing essays during most of this time, or I'd never have finished. In late 2015 I spent 3 months writing essays, and when I went back to working on Bel I could barely understand the code. Not so much because it was badly written as because the problem is so convoluted. When you're working on an interpreter written in itself, it's hard to keep track of what's happening at what level, and errors can be practically encrypted by the time you get them.
+
+So I said no more essays till Bel was done. But I told few people about Bel while I was working on it. So for years it must have seemed that I was doing nothing, when in fact I was working harder than I'd ever worked on anything. Occasionally after wrestling for hours with some gruesome bug I'd check Twitter or HN and see someone asking "Does Paul Graham still code?"
+
+Working on Bel was hard but satisfying. I worked on it so intensively that at any given time I had a decent chunk of the code in my head and could write more there. I remember taking the boys to the coast on a sunny day in 2015 and figuring out how to deal with some problem involving continuations while I watched them play in the tide pools. It felt like I was doing life right. I remember that because I was slightly dismayed at how novel it felt. The good news is that I had more moments like this over the next few years.
+
+In the summer of 2016 we moved to England. We wanted our kids to see what it was like living in another country, and since I was a British citizen by birth, that seemed the obvious choice. We only meant to stay for a year, but we liked it so much that we still live there. So most of Bel was written in England.
+
+In the fall of 2019, Bel was finally finished. Like McCarthy's original Lisp, it's a spec rather than an implementation, although like McCarthy's Lisp it's a spec expressed as code.
+
+Now that I could write essays again, I wrote a bunch about topics I'd had stacked up. I kept writing essays through 2020, but I also started to think about other things I could work on. How should I choose what to do? Well, how had I chosen what to work on in the past? I wrote an essay for myself to answer that question, and I was surprised how long and messy the answer turned out to be. If this surprised me, who'd lived it, then I thought perhaps it would be interesting to other people, and encouraging to those with similarly messy lives. So I wrote a more detailed version for others to read, and this is the last sentence of it.
+
+
+
+
+
+
+
+
+
+Notes
+
+[1] My experience skipped a step in the evolution of computers: time-sharing machines with interactive OSes. I went straight from batch processing to microcomputers, which made microcomputers seem all the more exciting.
+
+[2] Italian words for abstract concepts can nearly always be predicted from their English cognates (except for occasional traps like polluzione). It's the everyday words that differ. So if you string together a lot of abstract concepts with a few simple verbs, you can make a little Italian go a long way.
+
+[3] I lived at Piazza San Felice 4, so my walk to the Accademia went straight down the spine of old Florence: past the Pitti, across the bridge, past Orsanmichele, between the Duomo and the Baptistery, and then up Via Ricasoli to Piazza San Marco. I saw Florence at street level in every possible condition, from empty dark winter evenings to sweltering summer days when the streets were packed with tourists.
+
+[4] You can of course paint people like still lives if you want to, and they're willing. That sort of portrait is arguably the apex of still life painting, though the long sitting does tend to produce pained expressions in the sitters.
+
+[5] Interleaf was one of many companies that had smart people and built impressive technology, and yet got crushed by Moore's Law. In the 1990s the exponential growth in the power of commodity (i.e. Intel) processors rolled up high-end, special-purpose hardware and software companies like a bulldozer.
+
+[6] The signature style seekers at RISD weren't specifically mercenary. In the art world, money and coolness are tightly coupled. Anything expensive comes to be seen as cool, and anything seen as cool will soon become equally expensive.
+
+[7] Technically the apartment wasn't rent-controlled but rent-stabilized, but this is a refinement only New Yorkers would know or care about. The point is that it was really cheap, less than half market price.
+
+[8] Most software you can launch as soon as it's done. But when the software is an online store builder and you're hosting the stores, if you don't have any users yet, that fact will be painfully obvious. So before we could launch publicly we had to launch privately, in the sense of recruiting an initial set of users and making sure they had decent-looking stores.
+
+[9] We'd had a code editor in Viaweb for users to define their own page styles. They didn't know it, but they were editing Lisp expressions underneath. But this wasn't an app editor, because the code ran when the merchants' sites were generated, not when shoppers visited them.
+
+[10] This was the first instance of what is now a familiar experience, and so was what happened next, when I read the comments and found they were full of angry people. How could I claim that Lisp was better than other languages? Weren't they all Turing complete? People who see the responses to essays I write sometimes tell me how sorry they feel for me, but I'm not exaggerating when I reply that it has always been like this, since the very beginning. It comes with the territory. An essay must tell readers things they don't already know, and some people dislike being told such things.
+
+[11] People put plenty of stuff on the internet in the 90s of course, but putting something online is not the same as publishing it online. Publishing online means you treat the online version as the (or at least a) primary version.
+
+[12] There is a general lesson here that our experience with Y Combinator also teaches: Customs continue to constrain you long after the restrictions that caused them have disappeared. Customary VC practice had once, like the customs about publishing essays, been based on real constraints. Startups had once been much more expensive to start, and proportionally rare. Now they could be cheap and common, but the VCs' customs still reflected the old world, just as customs about writing essays still reflected the constraints of the print era.
+
+Which in turn implies that people who are independent-minded (i.e. less influenced by custom) will have an advantage in fields affected by rapid change (where customs are more likely to be obsolete).
+
+Here's an interesting point, though: you can't always predict which fields will be affected by rapid change. Obviously software and venture capital will be, but who would have predicted that essay writing would be?
+
+[13] Y Combinator was not the original name. At first we were called Cambridge Seed. But we didn't want a regional name, in case someone copied us in Silicon Valley, so we renamed ourselves after one of the coolest tricks in the lambda calculus, the Y combinator.
+
+I picked orange as our color partly because it's the warmest, and partly because no VC used it. In 2005 all the VCs used staid colors like maroon, navy blue, and forest green, because they were trying to appeal to LPs, not founders. The YC logo itself is an inside joke: the Viaweb logo had been a white V on a red circle, so I made the YC logo a white Y on an orange square.
+
+[14] YC did become a fund for a couple years starting in 2009, because it was getting so big I could no longer afford to fund it personally. But after Heroku got bought we had enough money to go back to being self-funded.
+
+[15] I've never liked the term "deal flow," because it implies that the number of new startups at any given time is fixed. This is not only false, but it's the purpose of YC to falsify it, by causing startups to be founded that would not otherwise have existed.
+
+[16] She reports that they were all different shapes and sizes, because there was a run on air conditioners and she had to get whatever she could, but that they were all heavier than she could carry now.
+
+[17] Another problem with HN was a bizarre edge case that occurs when you both write essays and run a forum. When you run a forum, you're assumed to see if not every conversation, at least every conversation involving you. And when you write essays, people post highly imaginative misinterpretations of them on forums. Individually these two phenomena are tedious but bearable, but the combination is disastrous. You actually have to respond to the misinterpretations, because the assumption that you're present in the conversation means that not responding to any sufficiently upvoted misinterpretation reads as a tacit admission that it's correct. But that in turn encourages more; anyone who wants to pick a fight with you senses that now is their chance.
+
+[18] The worst thing about leaving YC was not working with Jessica anymore. We'd been working on YC almost the whole time we'd known each other, and we'd neither tried nor wanted to separate it from our personal lives, so leaving was like pulling up a deeply rooted tree.
+
+[19] One way to get more precise about the concept of invented vs discovered is to talk about space aliens. Any sufficiently advanced alien civilization would certainly know about the Pythagorean theorem, for example. I believe, though with less certainty, that they would also know about the Lisp in McCarthy's 1960 paper.
+
+But if so there's no reason to suppose that this is the limit of the language that might be known to them. Presumably aliens need numbers and errors and I/O too. So it seems likely there exists at least one path out of McCarthy's Lisp along which discoveredness is preserved.
+
+
+
+Thanks to Trevor Blackwell, John Collison, Patrick Collison, Daniel Gackle, Ralph Hazell, Jessica Livingston, Robert Morris, and Harj Taggar for reading drafts of this.
\ No newline at end of file
diff --git a/docs/assets/argilla-ui-dataset.png b/docs/assets/argilla-ui-dataset.png
index 1f0897d..2d4b25b 100644
Binary files a/docs/assets/argilla-ui-dataset.png and b/docs/assets/argilla-ui-dataset.png differ
diff --git a/docs/examples/usage_example.ipynb b/docs/examples/usage_example.ipynb
new file mode 100644
index 0000000..1eb2f5d
--- /dev/null
+++ b/docs/examples/usage_example.ipynb
@@ -0,0 +1,342 @@
+{
+ "cells": [
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "# ✨🦙 Getting started with Argilla's LlamaIndex Integration\n",
+    "\n",
+    "This integration allows the user to include the feedback loop that Argilla offers into the LlamaIndex ecosystem. It's based on a callback handler to be run within the LlamaIndex workflow. \n",
+    "\n",
+    "Don't hesitate to check out both [LlamaIndex](https://github.com/run-llama/llama_index) and [Argilla](https://github.com/argilla-io/argilla)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "## Getting started\n",
+    "\n",
+    "You first need to install argilla and argilla-llama-index as follows:"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "%pip install argilla-llama-index"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "You will need to an Argilla Server running to monitor the LLM. You can either install the server locally or have it on HuggingFace Spaces. For a complete guide on how to install and initialize the server, you can refer to the [Quickstart Guide](https://docs.argilla.io/en/latest/getting_started/quickstart_installation.html)."
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "## Usage\n",
+    "\n",
+    "It requires just a simple step to log your data into Argilla within your LlamaIndex workflow. We just need to call the handler before starting production with your LLM.\n",
+    "\n",
+    "We will use GPT3.5 from OpenAI as our LLM. For this, you will need a valid API key from OpenAI. You can have more info and get one via [this link](https://openai.com/blog/openai-api).\n",
+    "\n",
+    "After you get your API key, the easiest way to import it is through an environment variable, or via *getpass()*."
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 1,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "import os\n",
+    "\n",
+    "openai_api_key = os.getenv(\"OPENAI_API_KEY\")"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "Let's now write all the necessary imports and initialize the Argilla client"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 2,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "from llama_index.core import VectorStoreIndex, ServiceContext, SimpleDirectoryReader, set_global_handler\n",
+    "from llama_index.llms.openai import OpenAI\n",
+    "\n",
+    "import argilla as rg\n",
+    "\n",
+    "rg.init(\n",
+    "    api_url=\"http://localhost:6900\",\n",
+    "    api_key=\"owner.apikey\",\n",
+    "    workspace=\"admin\"\n",
+    ")"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "Now, we will set up an Argilla global handler for Llama Index. By doing so, we ensure that the predictions that we obtain using Llama Index is automatically uploaded to the Argilla client we initialized before Within the handler, we need to provide the dataset name that we will use. If the dataset does not exist, it will be created with the given name. You can also set the API KEY, API URL, and the Workspace name. You can learn more about the variables that controls Argilla initialization [here](https://docs.argilla.io/en/latest/getting_started/installation/configurations/workspace_management.html)."
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 4,
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/html": [
+       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #7fbfbf; text-decoration-color: #7fbfbf\">[04/09/24 16:26:24] </span><span style=\"color: #000080; text-decoration-color: #000080\">INFO    </span> INFO:argilla.client.feedback.dataset.local.mixins:✓ Dataset succesfully  <a href=\"file:///Users/ignacio/Documents/recognai/argilla-llama-index/.venv/lib/python3.10/site-packages/argilla/client/feedback/dataset/local/mixins.py\" target=\"_blank\"><span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">mixins.py</span></a><span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">:</span><a href=\"file:///Users/ignacio/Documents/recognai/argilla-llama-index/.venv/lib/python3.10/site-packages/argilla/client/feedback/dataset/local/mixins.py#271\" target=\"_blank\"><span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">271</span></a>\n",
+       "<span style=\"color: #7fbfbf; text-decoration-color: #7fbfbf\">                    </span>         pushed to Argilla                                                        <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">             </span>\n",
+       "</pre>\n"
+      ],
+      "text/plain": [
+       "\u001b[2;36m[04/09/24 16:26:24]\u001b[0m\u001b[2;36m \u001b[0m\u001b[34mINFO    \u001b[0m INFO:argilla.client.feedback.dataset.local.mixins:✓ Dataset succesfully  \u001b]8;id=154751;file:///Users/ignacio/Documents/recognai/argilla-llama-index/.venv/lib/python3.10/site-packages/argilla/client/feedback/dataset/local/mixins.py\u001b\\\u001b[2mmixins.py\u001b[0m\u001b]8;;\u001b\\\u001b[2m:\u001b[0m\u001b]8;id=190584;file:///Users/ignacio/Documents/recognai/argilla-llama-index/.venv/lib/python3.10/site-packages/argilla/client/feedback/dataset/local/mixins.py#271\u001b\\\u001b[2m271\u001b[0m\u001b]8;;\u001b\\\n",
+       "\u001b[2;36m                    \u001b[0m         pushed to Argilla                                                        \u001b[2m             \u001b[0m\n"
+      ]
+     },
+     "metadata": {},
+     "output_type": "display_data"
+    },
+    {
+     "data": {
+      "text/html": [
+       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #7fbfbf; text-decoration-color: #7fbfbf\">                    </span><span style=\"color: #000080; text-decoration-color: #000080\">INFO    </span> INFO:argilla.client.feedback.dataset.local.mixins:<span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\">RemoteFeedbackDataset</span><span style=\"font-weight: bold\">(</span> <a href=\"file:///Users/ignacio/Documents/recognai/argilla-llama-index/.venv/lib/python3.10/site-packages/argilla/client/feedback/dataset/local/mixins.py\" target=\"_blank\"><span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">mixins.py</span></a><span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">:</span><a href=\"file:///Users/ignacio/Documents/recognai/argilla-llama-index/.venv/lib/python3.10/site-packages/argilla/client/feedback/dataset/local/mixins.py#272\" target=\"_blank\"><span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">272</span></a>\n",
+       "<span style=\"color: #7fbfbf; text-decoration-color: #7fbfbf\">                    </span>            <span style=\"color: #808000; text-decoration-color: #808000\">id</span>=<span style=\"color: #ffff00; text-decoration-color: #ffff00\">f3ca83bf</span><span style=\"color: #ffff00; text-decoration-color: #ffff00\">-14c0-49a8-9d30-7bdd7fe88cf0</span>                               <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">             </span>\n",
+       "<span style=\"color: #7fbfbf; text-decoration-color: #7fbfbf\">                    </span>            <span style=\"color: #808000; text-decoration-color: #808000\">name</span>=<span style=\"color: #800080; text-decoration-color: #800080\">query_model</span>                                                      <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">             </span>\n",
+       "<span style=\"color: #7fbfbf; text-decoration-color: #7fbfbf\">                    </span>            <span style=\"color: #808000; text-decoration-color: #808000\">workspace</span>=<span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\">Workspace</span><span style=\"font-weight: bold\">(</span><span style=\"color: #808000; text-decoration-color: #808000\">id</span>=<span style=\"color: #ffff00; text-decoration-color: #ffff00\">5b42d217</span><span style=\"color: #ffff00; text-decoration-color: #ffff00\">-c190-4916-835b-924c9eb766ef</span>,          <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">             </span>\n",
+       "<span style=\"color: #7fbfbf; text-decoration-color: #7fbfbf\">                    </span>         <span style=\"color: #808000; text-decoration-color: #808000\">name</span>=<span style=\"color: #800080; text-decoration-color: #800080\">admin</span>, <span style=\"color: #808000; text-decoration-color: #808000\">inserted_at</span>=<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">2024</span>-<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">04</span>-<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">09</span> <span style=\"color: #00ff00; text-decoration-color: #00ff00; font-weight: bold\">08:59:41</span>.<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">374316</span>,                      <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">             </span>\n",
+       "<span style=\"color: #7fbfbf; text-decoration-color: #7fbfbf\">                    </span>         <span style=\"color: #808000; text-decoration-color: #808000\">updated_at</span>=<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">2024</span>-<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">04</span>-<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">09</span> <span style=\"color: #00ff00; text-decoration-color: #00ff00; font-weight: bold\">08:59:41</span>.<span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">374316</span><span style=\"font-weight: bold\">)</span>                                   <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">             </span>\n",
+       "<span style=\"color: #7fbfbf; text-decoration-color: #7fbfbf\">                    </span>            <span style=\"color: #808000; text-decoration-color: #808000\">url</span>=<span style=\"color: #0000ff; text-decoration-color: #0000ff; text-decoration: underline\">http://localhost:6900/dataset/f3ca83bf-14c0-49a8-9d30-7bdd7fe88cf</span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">             </span>\n",
+       "<span style=\"color: #7fbfbf; text-decoration-color: #7fbfbf\">                    </span>         <span style=\"color: #0000ff; text-decoration-color: #0000ff; text-decoration: underline\">0/annotation-mode</span>                                                        <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">             </span>\n",
+       "<span style=\"color: #7fbfbf; text-decoration-color: #7fbfbf\">                    </span>            <span style=\"color: #808000; text-decoration-color: #808000\">fields</span>=<span style=\"font-weight: bold\">[</span><span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\">RemoteTextField</span><span style=\"font-weight: bold\">(</span><span style=\"color: #808000; text-decoration-color: #808000\">id</span>=<span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\">UUID</span><span style=\"font-weight: bold\">(</span><span style=\"color: #008000; text-decoration-color: #008000\">'e199de61-ec75-43b3-85b8-75ca82f95d5d</span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">             </span>\n",
+       "<span style=\"color: #7fbfbf; text-decoration-color: #7fbfbf\">                    </span>         <span style=\"color: #008000; text-decoration-color: #008000\">'</span><span style=\"font-weight: bold\">)</span>, <span style=\"color: #808000; text-decoration-color: #808000\">client</span>=<span style=\"color: #800080; text-decoration-color: #800080; font-style: italic\">None</span>, <span style=\"color: #808000; text-decoration-color: #808000\">name</span>=<span style=\"color: #008000; text-decoration-color: #008000\">'prompt'</span>, <span style=\"color: #808000; text-decoration-color: #808000\">title</span>=<span style=\"color: #008000; text-decoration-color: #008000\">'Prompt'</span>, <span style=\"color: #808000; text-decoration-color: #808000\">required</span>=<span style=\"color: #00ff00; text-decoration-color: #00ff00; font-style: italic\">True</span>,           <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">             </span>\n",
+       "<span style=\"color: #7fbfbf; text-decoration-color: #7fbfbf\">                    </span>         <span style=\"color: #808000; text-decoration-color: #808000\">type</span>=<span style=\"color: #008000; text-decoration-color: #008000\">'text'</span>, <span style=\"color: #808000; text-decoration-color: #808000\">use_markdown</span>=<span style=\"color: #ff0000; text-decoration-color: #ff0000; font-style: italic\">False</span><span style=\"font-weight: bold\">)</span>,                                        <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">             </span>\n",
+       "<span style=\"color: #7fbfbf; text-decoration-color: #7fbfbf\">                    </span>         <span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\">RemoteTextField</span><span style=\"font-weight: bold\">(</span><span style=\"color: #808000; text-decoration-color: #808000\">id</span>=<span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\">UUID</span><span style=\"font-weight: bold\">(</span><span style=\"color: #008000; text-decoration-color: #008000\">'fc7e8a06-7778-47b0-bbd3-69347586e951'</span><span style=\"font-weight: bold\">)</span>,         <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">             </span>\n",
+       "<span style=\"color: #7fbfbf; text-decoration-color: #7fbfbf\">                    </span>         <span style=\"color: #808000; text-decoration-color: #808000\">client</span>=<span style=\"color: #800080; text-decoration-color: #800080; font-style: italic\">None</span>, <span style=\"color: #808000; text-decoration-color: #808000\">name</span>=<span style=\"color: #008000; text-decoration-color: #008000\">'response'</span>, <span style=\"color: #808000; text-decoration-color: #808000\">title</span>=<span style=\"color: #008000; text-decoration-color: #008000\">'Response'</span>, <span style=\"color: #808000; text-decoration-color: #808000\">required</span>=<span style=\"color: #ff0000; text-decoration-color: #ff0000; font-style: italic\">False</span>,          <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">             </span>\n",
+       "<span style=\"color: #7fbfbf; text-decoration-color: #7fbfbf\">                    </span>         <span style=\"color: #808000; text-decoration-color: #808000\">type</span>=<span style=\"color: #008000; text-decoration-color: #008000\">'text'</span>, <span style=\"color: #808000; text-decoration-color: #808000\">use_markdown</span>=<span style=\"color: #ff0000; text-decoration-color: #ff0000; font-style: italic\">False</span><span style=\"font-weight: bold\">)</span>,                                        <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">             </span>\n",
+       "<span style=\"color: #7fbfbf; text-decoration-color: #7fbfbf\">                    </span>         <span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\">RemoteTextField</span><span style=\"font-weight: bold\">(</span><span style=\"color: #808000; text-decoration-color: #808000\">id</span>=<span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\">UUID</span><span style=\"font-weight: bold\">(</span><span style=\"color: #008000; text-decoration-color: #008000\">'c65d166a-f9e4-4270-853e-68d935deee64'</span><span style=\"font-weight: bold\">)</span>,         <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">             </span>\n",
+       "<span style=\"color: #7fbfbf; text-decoration-color: #7fbfbf\">                    </span>         <span style=\"color: #808000; text-decoration-color: #808000\">client</span>=<span style=\"color: #800080; text-decoration-color: #800080; font-style: italic\">None</span>, <span style=\"color: #808000; text-decoration-color: #808000\">name</span>=<span style=\"color: #008000; text-decoration-color: #008000\">'time-details'</span>, <span style=\"color: #808000; text-decoration-color: #808000\">title</span>=<span style=\"color: #008000; text-decoration-color: #008000\">'Time Details'</span>, <span style=\"color: #808000; text-decoration-color: #808000\">required</span>=<span style=\"color: #00ff00; text-decoration-color: #00ff00; font-style: italic\">True</span>,   <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">             </span>\n",
+       "<span style=\"color: #7fbfbf; text-decoration-color: #7fbfbf\">                    </span>         <span style=\"color: #808000; text-decoration-color: #808000\">type</span>=<span style=\"color: #008000; text-decoration-color: #008000\">'text'</span>, <span style=\"color: #808000; text-decoration-color: #808000\">use_markdown</span>=<span style=\"color: #00ff00; text-decoration-color: #00ff00; font-style: italic\">True</span><span style=\"font-weight: bold\">)]</span>                                         <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">             </span>\n",
+       "<span style=\"color: #7fbfbf; text-decoration-color: #7fbfbf\">                    </span>            <span style=\"color: #808000; text-decoration-color: #808000\">questions</span>=<span style=\"font-weight: bold\">[</span><span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\">RemoteRatingQuestion</span><span style=\"font-weight: bold\">(</span><span style=\"color: #808000; text-decoration-color: #808000\">id</span>=<span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\">UUID</span><span style=\"font-weight: bold\">(</span><span style=\"color: #008000; text-decoration-color: #008000\">'199e8908-2c37-4e86-bf6e-a9dd</span> <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">             </span>\n",
+       "<span style=\"color: #7fbfbf; text-decoration-color: #7fbfbf\">                    </span>         <span style=\"color: #008000; text-decoration-color: #008000\">c8813f6a'</span><span style=\"font-weight: bold\">)</span>, <span style=\"color: #808000; text-decoration-color: #808000\">client</span>=<span style=\"color: #800080; text-decoration-color: #800080; font-style: italic\">None</span>, <span style=\"color: #808000; text-decoration-color: #808000\">name</span>=<span style=\"color: #008000; text-decoration-color: #008000\">'response-rating'</span>, <span style=\"color: #808000; text-decoration-color: #808000\">title</span>=<span style=\"color: #008000; text-decoration-color: #008000\">'Rating for the </span>  <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">             </span>\n",
+       "<span style=\"color: #7fbfbf; text-decoration-color: #7fbfbf\">                    </span>         <span style=\"color: #008000; text-decoration-color: #008000\">response'</span>, <span style=\"color: #808000; text-decoration-color: #808000\">description</span>=<span style=\"color: #008000; text-decoration-color: #008000\">'How would you rate the quality of the </span>           <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">             </span>\n",
+       "<span style=\"color: #7fbfbf; text-decoration-color: #7fbfbf\">                    </span>         <span style=\"color: #008000; text-decoration-color: #008000\">response?'</span>, <span style=\"color: #808000; text-decoration-color: #808000\">required</span>=<span style=\"color: #00ff00; text-decoration-color: #00ff00; font-style: italic\">True</span>, <span style=\"color: #808000; text-decoration-color: #808000\">type</span>=<span style=\"color: #008000; text-decoration-color: #008000\">'rating'</span>, <span style=\"color: #808000; text-decoration-color: #808000\">values</span>=<span style=\"font-weight: bold\">[</span><span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">1</span>, <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">2</span>, <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">3</span>, <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">4</span>, <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">5</span>, <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">6</span>, <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">7</span><span style=\"font-weight: bold\">])</span>, <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">             </span>\n",
+       "<span style=\"color: #7fbfbf; text-decoration-color: #7fbfbf\">                    </span>         <span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\">RemoteTextQuestion</span><span style=\"font-weight: bold\">(</span><span style=\"color: #808000; text-decoration-color: #808000\">id</span>=<span style=\"color: #800080; text-decoration-color: #800080; font-weight: bold\">UUID</span><span style=\"font-weight: bold\">(</span><span style=\"color: #008000; text-decoration-color: #008000\">'82111561-fe34-44ad-952e-77d532152ebc'</span><span style=\"font-weight: bold\">)</span>,      <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">             </span>\n",
+       "<span style=\"color: #7fbfbf; text-decoration-color: #7fbfbf\">                    </span>         <span style=\"color: #808000; text-decoration-color: #808000\">client</span>=<span style=\"color: #800080; text-decoration-color: #800080; font-style: italic\">None</span>, <span style=\"color: #808000; text-decoration-color: #808000\">name</span>=<span style=\"color: #008000; text-decoration-color: #008000\">'response-feedback'</span>, <span style=\"color: #808000; text-decoration-color: #808000\">title</span>=<span style=\"color: #008000; text-decoration-color: #008000\">'Feedback for the </span>          <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">             </span>\n",
+       "<span style=\"color: #7fbfbf; text-decoration-color: #7fbfbf\">                    </span>         <span style=\"color: #008000; text-decoration-color: #008000\">response'</span>, <span style=\"color: #808000; text-decoration-color: #808000\">description</span>=<span style=\"color: #008000; text-decoration-color: #008000\">'What feedback do you have for the response?'</span>,    <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">             </span>\n",
+       "<span style=\"color: #7fbfbf; text-decoration-color: #7fbfbf\">                    </span>         <span style=\"color: #808000; text-decoration-color: #808000\">required</span>=<span style=\"color: #ff0000; text-decoration-color: #ff0000; font-style: italic\">False</span>, <span style=\"color: #808000; text-decoration-color: #808000\">type</span>=<span style=\"color: #008000; text-decoration-color: #008000\">'text'</span>, <span style=\"color: #808000; text-decoration-color: #808000\">use_markdown</span>=<span style=\"color: #ff0000; text-decoration-color: #ff0000; font-style: italic\">False</span><span style=\"font-weight: bold\">)]</span>                        <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">             </span>\n",
+       "<span style=\"color: #7fbfbf; text-decoration-color: #7fbfbf\">                    </span>            <span style=\"color: #808000; text-decoration-color: #808000\">guidelines</span>=<span style=\"color: #800080; text-decoration-color: #800080\">You</span>'re asked to rate the quality of the response and       <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">             </span>\n",
+       "<span style=\"color: #7fbfbf; text-decoration-color: #7fbfbf\">                    </span>         provide feedback.                                                        <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">             </span>\n",
+       "<span style=\"color: #7fbfbf; text-decoration-color: #7fbfbf\">                    </span>            <span style=\"color: #808000; text-decoration-color: #808000\">metadata_properties</span>=<span style=\"font-weight: bold\">[]</span>                                                <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">             </span>\n",
+       "<span style=\"color: #7fbfbf; text-decoration-color: #7fbfbf\">                    </span>            <span style=\"color: #808000; text-decoration-color: #808000\">vectors_settings</span>=<span style=\"font-weight: bold\">[]</span>                                                   <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">             </span>\n",
+       "<span style=\"color: #7fbfbf; text-decoration-color: #7fbfbf\">                    </span>         <span style=\"font-weight: bold\">)</span>                                                                        <span style=\"color: #7f7f7f; text-decoration-color: #7f7f7f\">             </span>\n",
+       "</pre>\n"
+      ],
+      "text/plain": [
+       "\u001b[2;36m                   \u001b[0m\u001b[2;36m \u001b[0m\u001b[34mINFO    \u001b[0m INFO:argilla.client.feedback.dataset.local.mixins:\u001b[1;35mRemoteFeedbackDataset\u001b[0m\u001b[1m(\u001b[0m \u001b]8;id=994278;file:///Users/ignacio/Documents/recognai/argilla-llama-index/.venv/lib/python3.10/site-packages/argilla/client/feedback/dataset/local/mixins.py\u001b\\\u001b[2mmixins.py\u001b[0m\u001b]8;;\u001b\\\u001b[2m:\u001b[0m\u001b]8;id=162794;file:///Users/ignacio/Documents/recognai/argilla-llama-index/.venv/lib/python3.10/site-packages/argilla/client/feedback/dataset/local/mixins.py#272\u001b\\\u001b[2m272\u001b[0m\u001b]8;;\u001b\\\n",
+       "\u001b[2;36m                    \u001b[0m            \u001b[33mid\u001b[0m=\u001b[93mf3ca83bf\u001b[0m\u001b[93m-14c0-49a8-9d30-7bdd7fe88cf0\u001b[0m                               \u001b[2m             \u001b[0m\n",
+       "\u001b[2;36m                    \u001b[0m            \u001b[33mname\u001b[0m=\u001b[35mquery_model\u001b[0m                                                      \u001b[2m             \u001b[0m\n",
+       "\u001b[2;36m                    \u001b[0m            \u001b[33mworkspace\u001b[0m=\u001b[1;35mWorkspace\u001b[0m\u001b[1m(\u001b[0m\u001b[33mid\u001b[0m=\u001b[93m5b42d217\u001b[0m\u001b[93m-c190-4916-835b-924c9eb766ef\u001b[0m,          \u001b[2m             \u001b[0m\n",
+       "\u001b[2;36m                    \u001b[0m         \u001b[33mname\u001b[0m=\u001b[35madmin\u001b[0m, \u001b[33minserted_at\u001b[0m=\u001b[1;36m2024\u001b[0m-\u001b[1;36m04\u001b[0m-\u001b[1;36m09\u001b[0m \u001b[1;92m08:59:41\u001b[0m.\u001b[1;36m374316\u001b[0m,                      \u001b[2m             \u001b[0m\n",
+       "\u001b[2;36m                    \u001b[0m         \u001b[33mupdated_at\u001b[0m=\u001b[1;36m2024\u001b[0m-\u001b[1;36m04\u001b[0m-\u001b[1;36m09\u001b[0m \u001b[1;92m08:59:41\u001b[0m.\u001b[1;36m374316\u001b[0m\u001b[1m)\u001b[0m                                   \u001b[2m             \u001b[0m\n",
+       "\u001b[2;36m                    \u001b[0m            \u001b[33murl\u001b[0m=\u001b[4;94mhttp\u001b[0m\u001b[4;94m://localhost:6900/dataset/f3ca83bf-14c0-49a8-9d30-7bdd7fe88cf\u001b[0m \u001b[2m             \u001b[0m\n",
+       "\u001b[2;36m                    \u001b[0m         \u001b[4;94m0/annotation-mode\u001b[0m                                                        \u001b[2m             \u001b[0m\n",
+       "\u001b[2;36m                    \u001b[0m            \u001b[33mfields\u001b[0m=\u001b[1m[\u001b[0m\u001b[1;35mRemoteTextField\u001b[0m\u001b[1m(\u001b[0m\u001b[33mid\u001b[0m=\u001b[1;35mUUID\u001b[0m\u001b[1m(\u001b[0m\u001b[32m'e199de61-ec75-43b3-85b8-75ca82f95d5d\u001b[0m \u001b[2m             \u001b[0m\n",
+       "\u001b[2;36m                    \u001b[0m         \u001b[32m'\u001b[0m\u001b[1m)\u001b[0m, \u001b[33mclient\u001b[0m=\u001b[3;35mNone\u001b[0m, \u001b[33mname\u001b[0m=\u001b[32m'prompt'\u001b[0m, \u001b[33mtitle\u001b[0m=\u001b[32m'Prompt'\u001b[0m, \u001b[33mrequired\u001b[0m=\u001b[3;92mTrue\u001b[0m,           \u001b[2m             \u001b[0m\n",
+       "\u001b[2;36m                    \u001b[0m         \u001b[33mtype\u001b[0m=\u001b[32m'text'\u001b[0m, \u001b[33muse_markdown\u001b[0m=\u001b[3;91mFalse\u001b[0m\u001b[1m)\u001b[0m,                                        \u001b[2m             \u001b[0m\n",
+       "\u001b[2;36m                    \u001b[0m         \u001b[1;35mRemoteTextField\u001b[0m\u001b[1m(\u001b[0m\u001b[33mid\u001b[0m=\u001b[1;35mUUID\u001b[0m\u001b[1m(\u001b[0m\u001b[32m'fc7e8a06-7778-47b0-bbd3-69347586e951'\u001b[0m\u001b[1m)\u001b[0m,         \u001b[2m             \u001b[0m\n",
+       "\u001b[2;36m                    \u001b[0m         \u001b[33mclient\u001b[0m=\u001b[3;35mNone\u001b[0m, \u001b[33mname\u001b[0m=\u001b[32m'response'\u001b[0m, \u001b[33mtitle\u001b[0m=\u001b[32m'Response'\u001b[0m, \u001b[33mrequired\u001b[0m=\u001b[3;91mFalse\u001b[0m,          \u001b[2m             \u001b[0m\n",
+       "\u001b[2;36m                    \u001b[0m         \u001b[33mtype\u001b[0m=\u001b[32m'text'\u001b[0m, \u001b[33muse_markdown\u001b[0m=\u001b[3;91mFalse\u001b[0m\u001b[1m)\u001b[0m,                                        \u001b[2m             \u001b[0m\n",
+       "\u001b[2;36m                    \u001b[0m         \u001b[1;35mRemoteTextField\u001b[0m\u001b[1m(\u001b[0m\u001b[33mid\u001b[0m=\u001b[1;35mUUID\u001b[0m\u001b[1m(\u001b[0m\u001b[32m'c65d166a-f9e4-4270-853e-68d935deee64'\u001b[0m\u001b[1m)\u001b[0m,         \u001b[2m             \u001b[0m\n",
+       "\u001b[2;36m                    \u001b[0m         \u001b[33mclient\u001b[0m=\u001b[3;35mNone\u001b[0m, \u001b[33mname\u001b[0m=\u001b[32m'time-details'\u001b[0m, \u001b[33mtitle\u001b[0m=\u001b[32m'Time Details'\u001b[0m, \u001b[33mrequired\u001b[0m=\u001b[3;92mTrue\u001b[0m,   \u001b[2m             \u001b[0m\n",
+       "\u001b[2;36m                    \u001b[0m         \u001b[33mtype\u001b[0m=\u001b[32m'text'\u001b[0m, \u001b[33muse_markdown\u001b[0m=\u001b[3;92mTrue\u001b[0m\u001b[1m)\u001b[0m\u001b[1m]\u001b[0m                                         \u001b[2m             \u001b[0m\n",
+       "\u001b[2;36m                    \u001b[0m            \u001b[33mquestions\u001b[0m=\u001b[1m[\u001b[0m\u001b[1;35mRemoteRatingQuestion\u001b[0m\u001b[1m(\u001b[0m\u001b[33mid\u001b[0m=\u001b[1;35mUUID\u001b[0m\u001b[1m(\u001b[0m\u001b[32m'199e8908-2c37-4e86-bf6e-a9dd\u001b[0m \u001b[2m             \u001b[0m\n",
+       "\u001b[2;36m                    \u001b[0m         \u001b[32mc8813f6a'\u001b[0m\u001b[1m)\u001b[0m, \u001b[33mclient\u001b[0m=\u001b[3;35mNone\u001b[0m, \u001b[33mname\u001b[0m=\u001b[32m'response-rating'\u001b[0m, \u001b[33mtitle\u001b[0m=\u001b[32m'Rating for the \u001b[0m  \u001b[2m             \u001b[0m\n",
+       "\u001b[2;36m                    \u001b[0m         \u001b[32mresponse'\u001b[0m, \u001b[33mdescription\u001b[0m=\u001b[32m'How would you rate the quality of the \u001b[0m           \u001b[2m             \u001b[0m\n",
+       "\u001b[2;36m                    \u001b[0m         \u001b[32mresponse?'\u001b[0m, \u001b[33mrequired\u001b[0m=\u001b[3;92mTrue\u001b[0m, \u001b[33mtype\u001b[0m=\u001b[32m'rating'\u001b[0m, \u001b[33mvalues\u001b[0m=\u001b[1m[\u001b[0m\u001b[1;36m1\u001b[0m, \u001b[1;36m2\u001b[0m, \u001b[1;36m3\u001b[0m, \u001b[1;36m4\u001b[0m, \u001b[1;36m5\u001b[0m, \u001b[1;36m6\u001b[0m, \u001b[1;36m7\u001b[0m\u001b[1m]\u001b[0m\u001b[1m)\u001b[0m, \u001b[2m             \u001b[0m\n",
+       "\u001b[2;36m                    \u001b[0m         \u001b[1;35mRemoteTextQuestion\u001b[0m\u001b[1m(\u001b[0m\u001b[33mid\u001b[0m=\u001b[1;35mUUID\u001b[0m\u001b[1m(\u001b[0m\u001b[32m'82111561-fe34-44ad-952e-77d532152ebc'\u001b[0m\u001b[1m)\u001b[0m,      \u001b[2m             \u001b[0m\n",
+       "\u001b[2;36m                    \u001b[0m         \u001b[33mclient\u001b[0m=\u001b[3;35mNone\u001b[0m, \u001b[33mname\u001b[0m=\u001b[32m'response-feedback'\u001b[0m, \u001b[33mtitle\u001b[0m=\u001b[32m'Feedback for the \u001b[0m          \u001b[2m             \u001b[0m\n",
+       "\u001b[2;36m                    \u001b[0m         \u001b[32mresponse'\u001b[0m, \u001b[33mdescription\u001b[0m=\u001b[32m'What feedback do you have for the response?'\u001b[0m,    \u001b[2m             \u001b[0m\n",
+       "\u001b[2;36m                    \u001b[0m         \u001b[33mrequired\u001b[0m=\u001b[3;91mFalse\u001b[0m, \u001b[33mtype\u001b[0m=\u001b[32m'text'\u001b[0m, \u001b[33muse_markdown\u001b[0m=\u001b[3;91mFalse\u001b[0m\u001b[1m)\u001b[0m\u001b[1m]\u001b[0m                        \u001b[2m             \u001b[0m\n",
+       "\u001b[2;36m                    \u001b[0m            \u001b[33mguidelines\u001b[0m=\u001b[35mYou\u001b[0m're asked to rate the quality of the response and       \u001b[2m             \u001b[0m\n",
+       "\u001b[2;36m                    \u001b[0m         provide feedback.                                                        \u001b[2m             \u001b[0m\n",
+       "\u001b[2;36m                    \u001b[0m            \u001b[33mmetadata_properties\u001b[0m=\u001b[1m[\u001b[0m\u001b[1m]\u001b[0m                                                \u001b[2m             \u001b[0m\n",
+       "\u001b[2;36m                    \u001b[0m            \u001b[33mvectors_settings\u001b[0m=\u001b[1m[\u001b[0m\u001b[1m]\u001b[0m                                                   \u001b[2m             \u001b[0m\n",
+       "\u001b[2;36m                    \u001b[0m         \u001b[1m)\u001b[0m                                                                        \u001b[2m             \u001b[0m\n"
+      ]
+     },
+     "metadata": {},
+     "output_type": "display_data"
+    },
+    {
+     "name": "stderr",
+     "output_type": "stream",
+     "text": [
+      "/Users/ignacio/Documents/recognai/argilla-llama-index/src/argilla_llama_index/llama_index_handler.py:135: UserWarning: No dataset with the name query_model was found in workspace admin. A new dataset with the name query_model has been created with the question fields `prompt` and `response`and the rating question `response-rating` with values 1-7 and text question named `response-feedback`.\n",
+      "  warnings.warn(\n"
+     ]
+    }
+   ],
+   "source": [
+    "set_global_handler(\"argilla\", dataset_name=\"query_model\")"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "Let's now create the llm instance, using GPT-3.5 from OpenAI."
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 5,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "llm = OpenAI(model=\"gpt-3.5-turbo\", temperature=0.8, openai_api_key=openai_api_key)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "With the code snippet below, you can create a basic workflow with LlamaIndex. You will also need a txt file as the data source within a folder named \"data\". We have an example `.txt` file ready for you inside that folder, obtained from the [Llama Index documentation](https://docs.llamaindex.ai/en/stable/getting_started/starter_example.html)."
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 6,
+   "metadata": {},
+   "outputs": [
+    {
+     "name": "stderr",
+     "output_type": "stream",
+     "text": [
+      "/var/folders/s0/4h4_2s7n3wxbm06wx8y43mm80000gn/T/ipykernel_24151/2413633764.py:1: DeprecationWarning: Call to deprecated class method from_defaults. (ServiceContext is deprecated, please use `llama_index.settings.Settings` instead.) -- Deprecated since version 0.10.0.\n",
+      "  service_context = ServiceContext.from_defaults(llm=llm)\n"
+     ]
+    }
+   ],
+   "source": [
+    "service_context = ServiceContext.from_defaults(llm=llm)\n",
+    "docs = SimpleDirectoryReader(\"../../data\").load_data()\n",
+    "index = VectorStoreIndex.from_documents(docs, service_context=service_context)\n",
+    "query_engine = index.as_query_engine()"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "Now, let's run the `query_engine` to have a response from the model."
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 7,
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/html": [
+       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">/Users/ignacio/Documents/recognai/argilla-llama-index/.venv/lib/python3.10/site-packages/rich/live.py:231: \n",
+       "UserWarning: install \"ipywidgets\" for Jupyter support\n",
+       "  warnings.warn('install \"ipywidgets\" for Jupyter support')\n",
+       "</pre>\n"
+      ],
+      "text/plain": [
+       "/Users/ignacio/Documents/recognai/argilla-llama-index/.venv/lib/python3.10/site-packages/rich/live.py:231: \n",
+       "UserWarning: install \"ipywidgets\" for Jupyter support\n",
+       "  warnings.warn('install \"ipywidgets\" for Jupyter support')\n"
+      ]
+     },
+     "metadata": {},
+     "output_type": "display_data"
+    },
+    {
+     "data": {
+      "text/html": [
+       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"></pre>\n"
+      ],
+      "text/plain": []
+     },
+     "metadata": {},
+     "output_type": "display_data"
+    },
+    {
+     "data": {
+      "text/html": [
+       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">\n",
+       "</pre>\n"
+      ],
+      "text/plain": [
+       "\n"
+      ]
+     },
+     "metadata": {},
+     "output_type": "display_data"
+    },
+    {
+     "data": {
+      "text/plain": [
+       "Response(response='The author, growing up, worked on writing short stories and programming. Initially, he wrote short stories with minimal plots but strong character emotions. He then delved into programming on an IBM 1401 using an early version of Fortran, creating programs that had limited functionality due to the constraints of the system. Later, with the introduction of microcomputers, he transitioned to programming on more user-friendly platforms like the TRS-80, where he developed simple games and a word processor.', source_nodes=[NodeWithScore(node=TextNode(id_='9e4d418c-649e-4317-9cc5-777fc659528a', embedding=None, metadata={'file_path': '/Users/ignacio/Documents/recognai/argilla-llama-index/docs/examples/../data/paul_graham_essay.txt', 'file_name': 'paul_graham_essay.txt', 'file_type': 'text/plain', 'file_size': 75041, 'creation_date': '2024-03-25', 'last_modified_date': '2024-02-21'}, excluded_embed_metadata_keys=['file_name', 'file_type', 'file_size', 'creation_date', 'last_modified_date', 'last_accessed_date'], excluded_llm_metadata_keys=['file_name', 'file_type', 'file_size', 'creation_date', 'last_modified_date', 'last_accessed_date'], relationships={<NodeRelationship.SOURCE: '1'>: RelatedNodeInfo(node_id='ab9ee02b-4635-4b53-acb7-c1f6714966a9', node_type=<ObjectType.DOCUMENT: '4'>, metadata={'file_path': '/Users/ignacio/Documents/recognai/argilla-llama-index/docs/examples/../data/paul_graham_essay.txt', 'file_name': 'paul_graham_essay.txt', 'file_type': 'text/plain', 'file_size': 75041, 'creation_date': '2024-03-25', 'last_modified_date': '2024-02-21'}, hash='c34bd0969e513ba2da03a97709eddd65d16fe620402e90d98503e25c0a29fbc9'), <NodeRelationship.NEXT: '3'>: RelatedNodeInfo(node_id='7d532b80-c8bf-48c0-bfc1-5b25df1237b5', node_type=<ObjectType.TEXT: '1'>, metadata={}, hash='385569b09072ef6417168a265570a74d83f193a1e01c168e2038ad68f0ba5275')}, text='What I Worked On\\n\\nFebruary 2021\\n\\nBefore college the two main things I worked on, outside of school, were writing and programming. I didn\\'t write essays. I wrote what beginning writers were supposed to write then, and probably still are: short stories. My stories were awful. They had hardly any plot, just characters with strong feelings, which I imagined made them deep.\\n\\nThe first programs I tried writing were on the IBM 1401 that our school district used for what was then called \"data processing.\" This was in 9th grade, so I was 13 or 14. The school district\\'s 1401 happened to be in the basement of our junior high school, and my friend Rich Draves and I got permission to use it. It was like a mini Bond villain\\'s lair down there, with all these alien-looking machines — CPU, disk drives, printer, card reader — sitting up on a raised floor under bright fluorescent lights.\\n\\nThe language we used was an early version of Fortran. You had to type programs on punch cards, then stack them in the card reader and press a button to load the program into memory and run it. The result would ordinarily be to print something on the spectacularly loud printer.\\n\\nI was puzzled by the 1401. I couldn\\'t figure out what to do with it. And in retrospect there\\'s not much I could have done with it. The only form of input to programs was data stored on punched cards, and I didn\\'t have any data stored on punched cards. The only other option was to do things that didn\\'t rely on any input, like calculate approximations of pi, but I didn\\'t know enough math to do anything interesting of that type. So I\\'m not surprised I can\\'t remember any programs I wrote, because they can\\'t have done much. My clearest memory is of the moment I learned it was possible for programs not to terminate, when one of mine didn\\'t. On a machine without time-sharing, this was a social as well as a technical error, as the data center manager\\'s expression made clear.\\n\\nWith microcomputers, everything changed. Now you could have a computer sitting right in front of you, on a desk, that could respond to your keystrokes as it was running instead of just churning through a stack of punch cards and then stopping. [1]\\n\\nThe first of my friends to get a microcomputer built it himself. It was sold as a kit by Heathkit. I remember vividly how impressed and envious I felt watching him sitting in front of it, typing programs right into the computer.\\n\\nComputers were expensive in those days and it took me years of nagging before I convinced my father to buy one, a TRS-80, in about 1980. The gold standard then was the Apple II, but a TRS-80 was good enough. This was when I really started programming. I wrote simple games, a program to predict how high my model rockets would fly, and a word processor that my father used to write at least one book. There was only room in memory for about 2 pages of text, so he\\'d write 2 pages at a time and then print them out, but it was a lot better than a typewriter.\\n\\nThough I liked programming, I didn\\'t plan to study it in college. In college I was going to study philosophy, which sounded much more powerful. It seemed, to my naive high school self, to be the study of the ultimate truths, compared to which the things studied in other fields would be mere domain knowledge. What I discovered when I got to college was that the other fields took up so much of the space of ideas that there wasn\\'t much left for these supposed ultimate truths. All that seemed left for philosophy were edge cases that people in other fields felt could safely be ignored.\\n\\nI couldn\\'t have put this into words when I was 18. All I knew at the time was that I kept taking philosophy courses and they kept being boring. So I decided to switch to AI.\\n\\nAI was in the air in the mid 1980s, but there were two things especially that made me want to work on it: a novel by Heinlein called The Moon is a Harsh Mistress, which featured an intelligent computer called Mike, and a PBS documentary that showed Terry Winograd using SHRDLU. I haven\\'t tried rereading The Moon is a Harsh Mistress, so I don\\'t know how well it has aged, but when I read it I was drawn entirely into its world.', start_char_idx=2, end_char_idx=4172, text_template='{metadata_str}\\n\\n{content}', metadata_template='{key}: {value}', metadata_seperator='\\n'), score=0.8214175012009751), NodeWithScore(node=TextNode(id_='2118264c-1adb-4bfa-9d98-68ab01e1120e', embedding=None, metadata={'file_path': '/Users/ignacio/Documents/recognai/argilla-llama-index/docs/examples/../data/paul_graham_essay.txt', 'file_name': 'paul_graham_essay.txt', 'file_type': 'text/plain', 'file_size': 75041, 'creation_date': '2024-03-25', 'last_modified_date': '2024-02-21'}, excluded_embed_metadata_keys=['file_name', 'file_type', 'file_size', 'creation_date', 'last_modified_date', 'last_accessed_date'], excluded_llm_metadata_keys=['file_name', 'file_type', 'file_size', 'creation_date', 'last_modified_date', 'last_accessed_date'], relationships={<NodeRelationship.SOURCE: '1'>: RelatedNodeInfo(node_id='ab9ee02b-4635-4b53-acb7-c1f6714966a9', node_type=<ObjectType.DOCUMENT: '4'>, metadata={'file_path': '/Users/ignacio/Documents/recognai/argilla-llama-index/docs/examples/../data/paul_graham_essay.txt', 'file_name': 'paul_graham_essay.txt', 'file_type': 'text/plain', 'file_size': 75041, 'creation_date': '2024-03-25', 'last_modified_date': '2024-02-21'}, hash='c34bd0969e513ba2da03a97709eddd65d16fe620402e90d98503e25c0a29fbc9'), <NodeRelationship.PREVIOUS: '2'>: RelatedNodeInfo(node_id='dd85c016-46ac-4140-a09e-e534d9f4d81a', node_type=<ObjectType.TEXT: '1'>, metadata={'file_path': '/Users/ignacio/Documents/recognai/argilla-llama-index/docs/examples/../data/paul_graham_essay.txt', 'file_name': 'paul_graham_essay.txt', 'file_type': 'text/plain', 'file_size': 75041, 'creation_date': '2024-03-25', 'last_modified_date': '2024-02-21'}, hash='901f63f38cf3ad32a9a9b44650ec4bc23c3f06f9ebd99d9427d0ba2882d0d726'), <NodeRelationship.NEXT: '3'>: RelatedNodeInfo(node_id='1c49ca65-3b92-4202-a69a-ccb4bc9e6b8f', node_type=<ObjectType.TEXT: '1'>, metadata={}, hash='53bc5d0c0d3a671ffa8ade96a7e64d63c3315d9b55582ee33e3063ff908f3467')}, text='If he even knew about the strange classes I was taking, he never said anything.\\n\\nSo now I was in a PhD program in computer science, yet planning to be an artist, yet also genuinely in love with Lisp hacking and working away at On Lisp. In other words, like many a grad student, I was working energetically on multiple projects that were not my thesis.\\n\\nI didn\\'t see a way out of this situation. I didn\\'t want to drop out of grad school, but how else was I going to get out? I remember when my friend Robert Morris got kicked out of Cornell for writing the internet worm of 1988, I was envious that he\\'d found such a spectacular way to get out of grad school.\\n\\nThen one day in April 1990 a crack appeared in the wall. I ran into professor Cheatham and he asked if I was far enough along to graduate that June. I didn\\'t have a word of my dissertation written, but in what must have been the quickest bit of thinking in my life, I decided to take a shot at writing one in the 5 weeks or so that remained before the deadline, reusing parts of On Lisp where I could, and I was able to respond, with no perceptible delay \"Yes, I think so. I\\'ll give you something to read in a few days.\"\\n\\nI picked applications of continuations as the topic. In retrospect I should have written about macros and embedded languages. There\\'s a whole world there that\\'s barely been explored. But all I wanted was to get out of grad school, and my rapidly written dissertation sufficed, just barely.\\n\\nMeanwhile I was applying to art schools. I applied to two: RISD in the US, and the Accademia di Belli Arti in Florence, which, because it was the oldest art school, I imagined would be good. RISD accepted me, and I never heard back from the Accademia, so off to Providence I went.\\n\\nI\\'d applied for the BFA program at RISD, which meant in effect that I had to go to college again. This was not as strange as it sounds, because I was only 25, and art schools are full of people of different ages. RISD counted me as a transfer sophomore and said I had to do the foundation that summer. The foundation means the classes that everyone has to take in fundamental subjects like drawing, color, and design.\\n\\nToward the end of the summer I got a big surprise: a letter from the Accademia, which had been delayed because they\\'d sent it to Cambridge England instead of Cambridge Massachusetts, inviting me to take the entrance exam in Florence that fall. This was now only weeks away. My nice landlady let me leave my stuff in her attic. I had some money saved from consulting work I\\'d done in grad school; there was probably enough to last a year if I lived cheaply. Now all I had to do was learn Italian.\\n\\nOnly stranieri (foreigners) had to take this entrance exam. In retrospect it may well have been a way of excluding them, because there were so many stranieri attracted by the idea of studying art in Florence that the Italian students would otherwise have been outnumbered. I was in decent shape at painting and drawing from the RISD foundation that summer, but I still don\\'t know how I managed to pass the written exam. I remember that I answered the essay question by writing about Cezanne, and that I cranked up the intellectual level as high as I could to make the most of my limited vocabulary. [2]\\n\\nI\\'m only up to age 25 and already there are such conspicuous patterns. Here I was, yet again about to attend some august institution in the hopes of learning about some prestigious subject, and yet again about to be disappointed. The students and faculty in the painting department at the Accademia were the nicest people you could imagine, but they had long since arrived at an arrangement whereby the students wouldn\\'t require the faculty to teach anything, and in return the faculty wouldn\\'t require the students to learn anything. And at the same time all involved would adhere outwardly to the conventions of a 19th century atelier. We actually had one of those little stoves, fed with kindling, that you see in 19th century studio paintings, and a nude model sitting as close to it as possible without getting burned. Except hardly anyone else painted her besides me. The rest of the students spent their time chatting or occasionally trying to imitate things they\\'d seen in American art magazines.\\n\\nOur model turned out to live just down the street from me.', start_char_idx=10369, end_char_idx=14708, text_template='{metadata_str}\\n\\n{content}', metadata_template='{key}: {value}', metadata_seperator='\\n'), score=0.8100195429647877)], metadata={'9e4d418c-649e-4317-9cc5-777fc659528a': {'file_path': '/Users/ignacio/Documents/recognai/argilla-llama-index/docs/examples/../data/paul_graham_essay.txt', 'file_name': 'paul_graham_essay.txt', 'file_type': 'text/plain', 'file_size': 75041, 'creation_date': '2024-03-25', 'last_modified_date': '2024-02-21'}, '2118264c-1adb-4bfa-9d98-68ab01e1120e': {'file_path': '/Users/ignacio/Documents/recognai/argilla-llama-index/docs/examples/../data/paul_graham_essay.txt', 'file_name': 'paul_graham_essay.txt', 'file_type': 'text/plain', 'file_size': 75041, 'creation_date': '2024-03-25', 'last_modified_date': '2024-02-21'}})"
+      ]
+     },
+     "execution_count": 7,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "response = query_engine.query(\"What did the author do growing up?\")\n",
+    "response"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "The prompt given and the response obtained will be logged in to Argilla server. You can check the data on Argilla's UI:\n",
+    "\n",
+    "![Argilla Dataset](../assets/argilla-ui-dataset.png)\n"
+   ]
+  }
+ ],
+ "metadata": {
+  "kernelspec": {
+   "display_name": ".venv",
+   "language": "python",
+   "name": "python3"
+  },
+  "language_info": {
+   "codemirror_mode": {
+    "name": "ipython",
+    "version": 3
+   },
+   "file_extension": ".py",
+   "mimetype": "text/x-python",
+   "name": "python",
+   "nbconvert_exporter": "python",
+   "pygments_lexer": "ipython3",
+   "version": "3.10.13"
+  }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 2
+}
diff --git a/pyproject.toml b/pyproject.toml
index ea2e85f..0868e53 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -18,8 +18,8 @@ classifiers = [
     "Programming Language :: Python :: 3.11",
 ]
 dependencies = [
-    "argilla >= 1.18.0",
-    "llama-index >= 0.9.32",
+    "argilla >= 1.22.0",
+    "llama-index >= 0.10.0",
     "packaging >= 23.2",
     "typing-extensions >= 4.3.0"
 ]
diff --git a/src/argilla_llama_index/__init__.py b/src/argilla_llama_index/__init__.py
index 43488e3..4dc2a4a 100644
--- a/src/argilla_llama_index/__init__.py
+++ b/src/argilla_llama_index/__init__.py
@@ -12,7 +12,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-__version__ = "0.0.1-alpha"
+__version__ = "1.0.0"
 
 from argilla_llama_index.llama_index_handler import ArgillaCallbackHandler
 
diff --git a/src/argilla_llama_index/helpers.py b/src/argilla_llama_index/helpers.py
new file mode 100644
index 0000000..8b57db0
--- /dev/null
+++ b/src/argilla_llama_index/helpers.py
@@ -0,0 +1,43 @@
+"""
+Auxiliary methods for the Argilla Llama Index integration.
+"""
+
+from datetime import datetime
+from typing import Dict, List
+
+from llama_index.core.callbacks.schema import CBEvent
+
+def _get_time_diff(event_1_time_str: str, event_2_time_str: str) -> float:
+    """
+    Get the time difference between two events Follows the American format (month, day, year).
+
+    Args:
+        event_1_time_str (str): The first event time.
+        event_2_time_str (str): The second event time.
+
+    Returns:
+        float: The time difference between the two events.
+    """
+    time_format = "%m/%d/%Y, %H:%M:%S.%f"
+
+    event_1_time = datetime.strptime(event_1_time_str, time_format)
+    event_2_time = datetime.strptime(event_2_time_str, time_format)
+
+    return round((event_2_time - event_1_time).total_seconds(), 4)
+
+
+def _calc_time(events_data: Dict[str, List[CBEvent]], id: str) -> float:
+    """
+    Calculate the time difference between the start and end of an event using the events_data.
+
+    Args:
+        events_data (Dict[str, List[CBEvent]]): The events data, stored in a dictionary.
+        id (str): The event id to calculate the time difference between start and finish timestamps.
+
+    Returns:
+        float: The time difference between the start and end of the event.
+    """
+
+    start_time = events_data[id][0].time
+    end_time = events_data[id][1].time
+    return _get_time_diff(start_time, end_time)
diff --git a/src/argilla_llama_index/llama_index_handler.py b/src/argilla_llama_index/llama_index_handler.py
index a4e928b..623f5c8 100644
--- a/src/argilla_llama_index/llama_index_handler.py
+++ b/src/argilla_llama_index/llama_index_handler.py
@@ -1,58 +1,71 @@
-from argilla._constants import DEFAULT_API_KEY, DEFAULT_API_URL
-import argilla as rg
-from typing import Any, Dict, List, Optional
+from collections import defaultdict
+from datetime import datetime
+import os
 from packaging.version import parse
+from typing import Any, Dict, List, Optional
 import warnings
-import os
-from datetime import datetime
-from collections import defaultdict
-from contextvars import ContextVar
 
+from argilla_llama_index.helpers import _calc_time, _get_time_diff
+
+import argilla as rg
+from argilla._constants import DEFAULT_API_KEY, DEFAULT_API_URL
 from llama_index.core.callbacks.base_handler import BaseCallbackHandler
 from llama_index.core.callbacks.schema import (
-    BASE_TRACE_EVENT,
     CBEventType,
     EventPayload,
     CBEvent,
 )
 
-global_stack_trace = ContextVar("trace", default=[BASE_TRACE_EVENT])
 
 class ArgillaCallbackHandler(BaseCallbackHandler):
-    """Callback handler for Argilla.
-    
-    Args:
-        dataset_name: The name of the dataset to log the events to. If the dataset does not exist,
-            a new one will be created.
-        number_of_retrievals: The number of retrieved documents to log.
-        workspace_name: The name of the workspace to log the events to.
-        api_url: The URL of the Argilla server.
-        api_key: The API key to use to connect to Argilla.
-        event_starts_to_ignore: A list of event types to ignore when they start.
-        event_ends_to_ignore: A list of event types to ignore when they end.
-        handlers: A list of handlers to run when an event starts or ends.
-    
-    Raises:
-        ImportError: If the `argilla` Python package is not installed or the one installed is not compatible
-        ConnectionError: If the connection to Argilla fails
-        FileNotFoundError: If the retrieval and creation of the `FeedbackDataset` fails
-    
-    Example:
-        >>> from argilla_llama_index import ArgillaCallbackHandler
-        >>> from llama_index import VectorStoreIndex, ServiceContext, SimpleDirectoryReader
-        >>> from llama_index.llms import OpenAI
-        >>> from llama_index import set_global_handler
-        >>> set_global_handler("argilla", dataset_name="query_model")
-        >>> llm = OpenAI(model="gpt-3.5-turbo", temperature=0.8)
-        >>> service_context = ServiceContext.from_defaults(llm=llm)
-        >>> docs = SimpleDirectoryReader("data").load_data()
-        >>> index = VectorStoreIndex.from_documents(docs, service_context=service_context)
-        >>> query_engine = index.as_query_engine()
-        >>> response = query_engine.query("What did the author do growing up dude?")
     """
+    Callback handler that logs predictions to Argilla.
+
+    This handler automatically logs the predictions made with LlamaIndex to Argilla,
+    without the need to create a dataset and log the predictions manually. Events relevant
+    to the predictions are automatically logged to Argilla as well, including timestamps of
+    all the different steps of the retrieval and prediction process.
+
+    Attributes:
+        dataset_name (str): The name of the Argilla dataset.
+        number_of_retrievals (int): The number of retrievals to log.
+        workspace_name (str): The name of the Argilla workspace.
+        api_url (str): Argilla API URL.
+        api_key (str): Argilla API key.
+        event_starts_to_ignore (List[CBEventType]): List of event types to ignore at the start of the trace.
+        event_ends_to_ignore (List[CBEventType]): List of event types to ignore at the end of the trace.
+        handlers (List[BaseCallbackHandler]): List of extra handlers to include.
+
+    Methods:
+        start_trace(trace_id: Optional[str] = None) -> None:
+            Logic to be executed at the beggining of the tracing process.
+
+        end_trace(trace_id: Optional[str] = None, trace_map: Optional[Dict[str, List[str]]] = None) -> None:
+            Logic to be executed at the end of the tracing process.
+
+        on_event_start(event_type: CBEventType, payload: Optional[Dict[str, Any]] = None, event_id: Optional[str] = None, parent_id: str = None) -> str:
+            Store event start data by event type. Executed at the start of an event.
+        
+        on_event_end(event_type: CBEventType, payload: Optional[Dict[str, Any]] = None, event_id: str = None) -> None:
+            Store event end data by event type. Executed at the end of an event.
+
+    Usage:
+    ```python
+    from llama_index.core import VectorStoreIndex, ServiceContext, SimpleDirectoryReader, set_global_handler
+    from llama_index.llms.openai import OpenAI
+
+    set_global_handler("argilla", dataset_name="query_model")
 
-    REPO_URL: str = "https://github.com/argilla-io/argilla"
-    ISSUES_URL: str = f"{REPO_URL}/issues"
+    llm = OpenAI(model="gpt-3.5-turbo", temperature=0.8, openai_api_key=os.getenv("OPENAI_API_KEY"))
+
+    service_context = ServiceContext.from_defaults(llm=llm)
+    docs = SimpleDirectoryReader("../../data").load_data()
+    index = VectorStoreIndex.from_documents(docs, service_context=service_context)
+    query_engine = index.as_query_engine()
+
+    response = query_engine.query("What did the author do growing up?")
+    ```
+    """
 
     def __init__(
         self,
@@ -65,34 +78,15 @@ def __init__(
         event_ends_to_ignore: Optional[List[CBEventType]] = None,
         handlers: Optional[List[BaseCallbackHandler]] = None,
     ) -> None:
-        """Initialize the Argilla callback handler.
-        
-        Args:
-            dataset_name: The name of the dataset to log the events to. If the dataset does not exist,
-                a new one will be created.
-            number_of_retrievals: The number of retrieved documents to log.
-            workspace_name: The name of the workspace to log the events to.
-            api_url: The URL of the Argilla server.
-            api_key: The API key to use to connect to Argilla.
-            event_starts_to_ignore: A list of event types to ignore when they start.
-            event_ends_to_ignore: A list of event types to ignore when they end.
-            handlers: A list of handlers to run when an event starts or ends.
-    
-        Raises:
-            ImportError: If the `argilla` Python package is not installed or the one installed is not compatible
-            ConnectionError: If the connection to Argilla fails
-            FileNotFoundError: If the retrieval and creation of the `FeedbackDataset` fails
-        
-        """
-        
+
         self.event_starts_to_ignore = event_starts_to_ignore or []
         self.event_ends_to_ignore = event_ends_to_ignore or []
         self.handlers = handlers or []
         self.number_of_retrievals = number_of_retrievals
 
-        # Import Argilla 
         try:
             import argilla as rg
+
             self.ARGILLA_VERSION = rg.__version__
 
         except ImportError:
@@ -101,20 +95,18 @@ def __init__(
                 "Python package installed. Please install it with `pip install argilla`"
             )
 
-        # Check whether the Argilla version is compatible
         if parse(self.ARGILLA_VERSION) < parse("1.18.0"):
             raise ImportError(
                 f"The installed `argilla` version is {self.ARGILLA_VERSION} but "
                 "`ArgillaCallbackHandler` requires at least version 1.18.0. Please "
                 "upgrade `argilla` with `pip install --upgrade argilla`."
             )
-        
-        # API_URL and API_KEY
-        # Show a warning message if Argilla will assume the default values will be used
+
+        # Ensure the API URL and API key are set, or assume the default values
         if api_url is None and os.getenv("ARGILLA_API_URL") is None:
             warnings.warn(
                 (
-                    "Since `api_url` is None, and the env var `ARGILLA_API_URL` is not"
+                    "Since `api_url` is None, and the environment var `ARGILLA_API_URL` is not"
                     f" set, it will default to `{DEFAULT_API_URL}`, which is the"
                     " default API URL in Argilla Quickstart."
                 ),
@@ -124,81 +116,32 @@ def __init__(
         if api_key is None and os.getenv("ARGILLA_API_KEY") is None:
             warnings.warn(
                 (
-                    "Since `api_key` is None, and the env var `ARGILLA_API_KEY` is not"
+                    "Since `api_key` is None, and the environment var `ARGILLA_API_KEY` is not"
                     f" set, it will default to `{DEFAULT_API_KEY}`, which is the"
                     " default API key in Argilla Quickstart."
                 ),
             )
             api_key = DEFAULT_API_KEY
-    
-        # Connect to Argilla with the provided credentials, if applicable
-        try:
-            rg.init(
-                api_key=api_key, 
-                api_url=api_url
-            )
-        except Exception as e:
-            raise ConnectionError(
-                f"Could not connect to Argilla with exception: '{e}'.\n"
-                "Please check your `api_key` and `api_url`, and make sure that "
-                "the Argilla server is up and running. If the problem persists "
-                f"please report it to {self.ISSUES_URL} as an `integration` issue."
-            ) from e
+
         
+        rg.init(api_key=api_key, api_url=api_url)
+
         # Set the Argilla variables
         self.dataset_name = dataset_name
         self.workspace_name = workspace_name or rg.get_workspace()
 
-        # Retrieve the `FeedbackDataset` from Argilla
+        # Either create a new dataset or use an existing one, updating it if necessary
         try:
-            if self.dataset_name in [ds.name for ds in rg.FeedbackDataset.list()]:
-                self.dataset = rg.FeedbackDataset.from_argilla(
-                    name=self.dataset_name,
-                    workspace=self.workspace_name,
-                )
-                self.is_new_dataset_created = False
-
-                if number_of_retrievals > 0:
-                    required_context_fields = self._add_context_fields(number_of_retrievals)
-                    required_context_questions = self._add_context_questions(number_of_retrievals)
-                    existing_fields = [field.to_local() for field in self.dataset.fields]
-                    existing_questions = [question.to_local() for question in self.dataset.questions]
-                    # If the required fields and questions do not match with the existing ones, update the dataset and upload it again with "-updated" added to the name
-                    if all(element in existing_fields for element in required_context_fields) == False or all(element in existing_questions for element in required_context_questions) == False:
-                        local_dataset = self.dataset.pull()
-
-                        fields_to_pop = []
-                        for index, field in enumerate(local_dataset.fields):
-                            if field.name.startswith("retrieved_document_"):
-                                fields_to_pop.append(index)
-                                fields_to_pop.sort(reverse=True)
-                        else:
-                            for index in fields_to_pop:
-                                local_dataset.fields.pop(index)
-                        
-                        questions_to_pop = []
-                        for index, question in enumerate(local_dataset.questions):
-                            if question.name.startswith("rating_retrieved_document_"):
-                                questions_to_pop.append(index)
-                                questions_to_pop.sort(reverse=True)
-                        else:
-                            for index in questions_to_pop:
-                                local_dataset.questions.pop(index)
-
-                        for field in required_context_fields:
-                            local_dataset.fields.append(field)
-                        for question in required_context_questions:
-                            local_dataset.questions.append(question)
-                        self.dataset = local_dataset.push_to_argilla(self.dataset_name+"-updated")
-
-            # If the dataset does not exist, create a new one with the given name
-            else:
+            if self.dataset_name not in [ds.name for ds in rg.FeedbackDataset.list()]:
                 dataset = rg.FeedbackDataset(
                     fields=[
                         rg.TextField(name="prompt", required=True),
                         rg.TextField(name="response", required=False),
-                        rg.TextField(name="time-details", title="Time Details", use_markdown=True)
-                    ] + self._add_context_fields(number_of_retrievals),
+                        rg.TextField(
+                            name="time-details", title="Time Details", use_markdown=True
+                        ),
+                    ]
+                    + self._add_context_fields(number_of_retrievals),
                     questions=[
                         rg.RatingQuestion(
                             name="response-rating",
@@ -213,31 +156,104 @@ def __init__(
                             description="What feedback do you have for the response?",
                             required=False,
                         ),
-                    ] + self._add_context_questions(number_of_retrievals),
-                        guidelines="You're asked to rate the quality of the response and provide feedback.",
-                        allow_extra_metadata=True,
+                    ]
+                    + self._add_context_questions(number_of_retrievals),
+                    guidelines="You're asked to rate the quality of the response and provide feedback.",
+                    allow_extra_metadata=True,
                 )
+
                 self.dataset = dataset.push_to_argilla(self.dataset_name)
                 self.is_new_dataset_created = True
                 warnings.warn(
-                (
-                    f"No dataset with the name {self.dataset_name} was found in workspace "
-                    f"{self.workspace_name}. A new dataset with the name {self.dataset_name} "
-                    "has been created with the question fields `prompt` and `response`"
-                    "and the rating question `response-rating` with values 1-7 and text question"
-                    " named `response-feedback`."
-                ),
-            )
+                    (
+                        f"No dataset with the name {self.dataset_name} was found in workspace "
+                        f"{self.workspace_name}. A new dataset with the name {self.dataset_name} "
+                        "has been created with the question fields `prompt` and `response`"
+                        "and the rating question `response-rating` with values 1-7 and text question"
+                        " named `response-feedback`."
+                    ),
+                )
+
+            else:
+                # Update the existing dataset. If the fields and questions do not match, the dataset will be updated using the
+                # -updated flag in the name.
+                if self.dataset_name in [ds.name for ds in rg.FeedbackDataset.list()]:
+                    self.dataset = rg.FeedbackDataset.from_argilla(
+                        name=self.dataset_name,
+                        workspace=self.workspace_name,
+                    )
+
+                    self.is_new_dataset_created = False
+
+                    if number_of_retrievals > 0:
+                        required_context_fields = self._add_context_fields(
+                            number_of_retrievals
+                        )
+                        required_context_questions = self._add_context_questions(
+                            number_of_retrievals
+                        )
+                        existing_fields = [
+                            field.to_local() for field in self.dataset.fields
+                        ]
+                        existing_questions = [
+                            question.to_local() for question in self.dataset.questions
+                        ]
+                        # If the required fields and questions do not match with the existing ones, update the dataset and upload it again with "-updated" added to the name
+                        if not (
+                            all(
+                                element in existing_fields
+                                for element in required_context_fields
+                            )
+                            and all(
+                                element in existing_questions
+                                for element in required_context_questions
+                            )
+                        ):
+                            local_dataset = self.dataset.pull()
+
+                            fields_to_pop = []
+                            for index, field in enumerate(local_dataset.fields):
+                                if field.name.startswith("retrieved_document_"):
+                                    fields_to_pop.append(index)
+                                    fields_to_pop.sort(reverse=True)
+                            else:
+                                for index in fields_to_pop:
+                                    local_dataset.fields.pop(index)
+
+                            questions_to_pop = []
+                            for index, question in enumerate(local_dataset.questions):
+                                if question.name.startswith(
+                                    "rating_retrieved_document_"
+                                ):
+                                    questions_to_pop.append(index)
+                                    questions_to_pop.sort(reverse=True)
+                            else:
+                                for index in questions_to_pop:
+                                    local_dataset.questions.pop(index)
+
+                            for field in required_context_fields:
+                                local_dataset.fields.append(field)
+                            for question in required_context_questions:
+                                local_dataset.questions.append(question)
+                            self.dataset = local_dataset.push_to_argilla(
+                                self.dataset_name + "-updated"
+                            )
 
         except Exception as e:
             raise FileNotFoundError(
                 f"`FeedbackDataset` retrieval and creation both failed with exception `{e}`."
-                f" If the problem persists please report it to {self.ISSUES_URL} "
+                f" If the problem persists please report it to https://github.com/argilla-io/argilla/issues/ "
                 f"as an `integration` issue."
             ) from e
-        
-        supported_context_fields = [f"retrieved_document_{i+1}" for i in range(number_of_retrievals)]
-        supported_fields = ["prompt", "response", "time-details"] + supported_context_fields
+
+        supported_context_fields = [
+            f"retrieved_document_{i+1}" for i in range(number_of_retrievals)
+        ]
+        supported_fields = [
+            "prompt",
+            "response",
+            "time-details",
+        ] + supported_context_fields
         if supported_fields != [field.name for field in self.dataset.fields]:
             raise ValueError(
                 f"`FeedbackDataset` with name={self.dataset_name} in the workspace="
@@ -245,17 +261,14 @@ def __init__(
                 f"`llama-index` integration. Supported fields are: {supported_fields},"
                 f" and the current `FeedbackDataset` fields are {[field.name for field in self.dataset.fields]}."
             )
-        
+
         self.events_data: Dict[str, List[CBEvent]] = defaultdict(list)
         self.event_map_id_to_name = {}
         self._ignore_components_in_tree = ["templating"]
         self.components_to_log = set()
         self.event_ids_traced = set()
 
-    def _add_context_fields(
-        self,
-        number_of_retrievals: int
-    ) -> List:
+    def _add_context_fields(self, number_of_retrievals: int) -> List:
         """Create the context fields to be added to the dataset."""
         context_fields = [
             rg.TextField(
@@ -267,29 +280,25 @@ def _add_context_fields(
             for doc in range(number_of_retrievals)
         ]
         return context_fields
-    
-    def _add_context_questions(
-        self,
-        number_of_retrievals: int
-    ) -> List:
+
+    def _add_context_questions(self, number_of_retrievals: int) -> List:
         """Create the context questions to be added to the dataset."""
         rating_questions = [
             rg.RatingQuestion(
                 name="rating_retrieved_document_" + str(doc + 1),
-                title="Rate the relevance of the Retrieved Document " + str(doc + 1) + " (if present)",
+                title="Rate the relevance of the Retrieved Document "
+                + str(doc + 1)
+                + " (if present)",
                 values=list(range(1, 8)),
                 # After https://github.com/argilla-io/argilla/issues/4523 is fixed, we can use the description
-                description=None, #"Rate the relevance of the retrieved document."
+                description=None,  # "Rate the relevance of the retrieved document."
                 required=False,
             )
             for doc in range(number_of_retrievals)
         ]
         return rating_questions
 
-    def _create_root_and_other_nodes(
-        self, 
-        trace_map: Dict[str, List[str]]
-    ) -> None:
+    def _create_root_and_other_nodes(self, trace_map: Dict[str, List[str]]) -> None:
         """Create the root node and the other nodes in the tree."""
         self.root_node = self._get_event_name_by_id(trace_map["root"][0])
         self.event_ids_traced = set(trace_map.keys()) - {"root"}
@@ -297,17 +306,15 @@ def _create_root_and_other_nodes(
         for id in self.event_ids_traced:
             self.components_to_log.add(self._get_event_name_by_id(id))
 
-    def _get_event_name_by_id(
-        self, 
-        event_id: str
-    ) -> str:
+    def _get_event_name_by_id(self, event_id: str) -> str:
         """Get the name of the event by its id."""
         return str(self.events_data[event_id][0].event_type).split(".")[1].lower()
-    
+
         # TODO: If we have a component more than once, properties currently don't account for those after the first one and get overwritten
+
     def _add_missing_metadata_properties(
-        self, 
-        dataset: rg.FeedbackDataset, 
+        self,
+        dataset: rg.FeedbackDataset,
     ) -> None:
         """Add missing metadata properties to the dataset."""
         required_metadata_properties = []
@@ -317,15 +324,22 @@ def _add_missing_metadata_properties(
                 metadata_name = "total_time"
             required_metadata_properties.append(metadata_name)
 
-        existing_metadata_properties = [property.name for property in dataset.metadata_properties]
-        missing_metadata_properties = [property for property in required_metadata_properties if property not in existing_metadata_properties]
+        existing_metadata_properties = [
+            property.name for property in dataset.metadata_properties
+        ]
+        missing_metadata_properties = [
+            property
+            for property in required_metadata_properties
+            if property not in existing_metadata_properties
+        ]
 
         for property in missing_metadata_properties:
-            title= " ".join([word.capitalize() for word in property.split('_')])
+            title = " ".join([word.capitalize() for word in property.split("_")])
             if title == "Llm Time":
                 title = "LLM Time"
             dataset.add_metadata_property(
-                rg.FloatMetadataProperty(name=property, title=title))
+                rg.FloatMetadataProperty(name=property, title=title)
+            )
             if self.is_new_dataset_created == False:
                 warnings.warn(
                     (
@@ -334,14 +348,13 @@ def _add_missing_metadata_properties(
                         f"Properties have been added to the dataset with "
                     ),
                 )
-                
+
     def _check_components_for_tree(
-        self,
-        tree_structure_dict: Dict[str, List[str]]
+        self, tree_structure_dict: Dict[str, List[str]]
     ) -> Dict[str, List[str]]:
         """
         Check whether the components in the tree are in the components to log.
-        Removes components that are not in the components to log so that they are not shown in the tree.  
+        Removes components that are not in the components to log so that they are not shown in the tree.
         """
         final_components_in_tree = self.components_to_log.copy()
         final_components_in_tree.add("root")
@@ -353,13 +366,15 @@ def _check_components_for_tree(
                 del tree_structure_dict[key]
         for key, value in tree_structure_dict.items():
             if isinstance(value, list):
-                tree_structure_dict[key] = [element for element in value if element.strip("0") in final_components_in_tree]
+                tree_structure_dict[key] = [
+                    element
+                    for element in value
+                    if element.strip("0") in final_components_in_tree
+                ]
         return tree_structure_dict
-                
+
     def _get_events_map_with_names(
-        self, 
-        events_data: Dict[str, List[CBEvent]],
-        trace_map: Dict[str, List[str]]
+        self, events_data: Dict[str, List[CBEvent]], trace_map: Dict[str, List[str]]
     ) -> Dict[str, List[str]]:
         """
         Returns a dictionary where trace_map is mapped with the event names instead of the event ids.
@@ -369,16 +384,19 @@ def _get_events_map_with_names(
         for event_id in self.event_ids_traced:
             event_name = str(events_data[event_id][0].event_type).split(".")[1].lower()
             while event_name in self.event_map_id_to_name.values():
-                event_name = event_name + "0" 
+                event_name = event_name + "0"
             self.event_map_id_to_name[event_id] = event_name
-        events_trace_map = {self.event_map_id_to_name.get(k, k): [self.event_map_id_to_name.get(v, v) for v in values] for k, values in trace_map.items()}
+        events_trace_map = {
+            self.event_map_id_to_name.get(k, k): [
+                self.event_map_id_to_name.get(v, v) for v in values
+            ]
+            for k, values in trace_map.items()
+        }
 
         return events_trace_map
-    
+
     def _extract_and_log_info(
-        self, 
-        events_data: Dict[str, List[CBEvent]],
-        trace_map: Dict[str, List[str]]
+        self, events_data: Dict[str, List[CBEvent]], trace_map: Dict[str, List[str]]
     ) -> None:
         """
         Main function that extracts the information from the events and logs it to Argilla.
@@ -389,7 +407,9 @@ def _extract_and_log_info(
         events_trace_map = self._get_events_map_with_names(events_data, trace_map)
         root_node = trace_map["root"]
         data_to_log = {}
+
         if len(root_node) == 1:
+
             # Create logging data for the root node
             if self.root_node == "agent_step":
                 # Event start
@@ -398,9 +418,13 @@ def _extract_and_log_info(
                 query_start_time = event.time
                 # Event end
                 event = events_data[root_node[0]][1]
-                data_to_log["response"] = event.payload.get(EventPayload.RESPONSE).response
+                data_to_log["response"] = event.payload.get(
+                    EventPayload.RESPONSE
+                ).response
                 query_end_time = event.time
-                data_to_log["agent_step_time"] = _get_time_diff(query_start_time, query_end_time)
+                data_to_log["agent_step_time"] = _get_time_diff(
+                    query_start_time, query_end_time
+                )
 
             elif self.root_node == "query":
                 # Event start
@@ -409,16 +433,19 @@ def _extract_and_log_info(
                 query_start_time = event.time
                 # Event end
                 event = events_data[root_node[0]][1]
-                data_to_log["response"] = event.payload.get(EventPayload.RESPONSE).response
+                data_to_log["response"] = event.payload.get(
+                    EventPayload.RESPONSE
+                ).response
                 query_end_time = event.time
-                data_to_log["query_time"] = _get_time_diff(query_start_time, query_end_time)
-            
+                data_to_log["query_time"] = _get_time_diff(
+                    query_start_time, query_end_time
+                )
+
             else:
                 return
-            
+
             # Create logging data for the rest of the components
             self.event_ids_traced.remove(root_node[0])
-
             number_of_components_used = defaultdict(int)
             components_to_log_without_root_node = self.components_to_log.copy()
             components_to_log_without_root_node.remove(self.root_node)
@@ -436,18 +463,34 @@ def _extract_and_log_info(
                         data_to_log[f"{event_name}_time"] = _calc_time(events_data, id)
 
                 if event_name_reduced == "llm":
-                    data_to_log[f"{event_name}_system_prompt"] = events_data[id][0].payload.get(EventPayload.MESSAGES)[0].content
-                    data_to_log[f"{event_name}_model_name"] = events_data[id][0].payload.get(EventPayload.SERIALIZED)["model"]
+                    data_to_log[f"{event_name}_system_prompt"] = (
+                        events_data[id][0].payload.get(EventPayload.MESSAGES)[0].content
+                    )
+                    data_to_log[f"{event_name}_model_name"] = events_data[id][
+                        0
+                    ].payload.get(EventPayload.SERIALIZED)["model"]
 
                 retrieved_document_counter = 1
                 if event_name_reduced == "retrieve":
-                    for retrieval_node in events_data[id][1].payload.get(EventPayload.NODES):
+                    for retrieval_node in events_data[id][1].payload.get(
+                        EventPayload.NODES
+                    ):
                         retrieve_dict = retrieval_node.to_dict()
-                        retrieval_metadata[f"{event_name}_document_{retrieved_document_counter}_score"] = retrieval_node.score
-                        retrieval_metadata[f"{event_name}_document_{retrieved_document_counter}_filename"] = retrieve_dict["node"]["metadata"]["file_name"]
-                        retrieval_metadata[f"{event_name}_document_{retrieved_document_counter}_text"] = retrieve_dict["node"]["text"]
-                        retrieval_metadata[f"{event_name}_document_{retrieved_document_counter}_start_character"] = retrieve_dict["node"]["start_char_idx"]
-                        retrieval_metadata[f"{event_name}_document_{retrieved_document_counter}_end_character"] = retrieve_dict["node"]["end_char_idx"]
+                        retrieval_metadata[
+                            f"{event_name}_document_{retrieved_document_counter}_score"
+                        ] = retrieval_node.score
+                        retrieval_metadata[
+                            f"{event_name}_document_{retrieved_document_counter}_filename"
+                        ] = retrieve_dict["node"]["metadata"]["file_name"]
+                        retrieval_metadata[
+                            f"{event_name}_document_{retrieved_document_counter}_text"
+                        ] = retrieve_dict["node"]["text"]
+                        retrieval_metadata[
+                            f"{event_name}_document_{retrieved_document_counter}_start_character"
+                        ] = retrieve_dict["node"]["start_char_idx"]
+                        retrieval_metadata[
+                            f"{event_name}_document_{retrieved_document_counter}_end_character"
+                        ] = retrieve_dict["node"]["end_char_idx"]
                         retrieved_document_counter += 1
                         if retrieved_document_counter > self.number_of_retrievals:
                             break
@@ -461,59 +504,85 @@ def _extract_and_log_info(
                     metadata_to_log[keys] = data_to_log[keys]
                 elif keys != "query" and keys != "response":
                     metadata_to_log[keys] = data_to_log[keys]
-                        
+
             if len(number_of_components_used) > 0:
                 for key, value in number_of_components_used.items():
                     metadata_to_log[f"number_of_{key}_used"] = value + 1
-            
+
             metadata_to_log.update(retrieval_metadata)
-            
+
             tree_structure = self._create_tree_structure(events_trace_map, data_to_log)
             tree = self._create_svg(tree_structure)
 
             fields = {
-                "prompt": data_to_log["query"], 
+                "prompt": data_to_log["query"],
                 "response": data_to_log["response"],
-                "time-details": tree
+                "time-details": tree,
             }
 
             if self.number_of_retrievals > 0:
                 for key, value in list(retrieval_metadata.items()):
                     if key.endswith("_text"):
-                        fields[f"retrieved_document_{key[-6]}"] = f"DOCUMENT SCORE: {retrieval_metadata[key[:-5]+'_score']}\n\n" + value
+                        fields[f"retrieved_document_{key[-6]}"] = (
+                            f"DOCUMENT SCORE: {retrieval_metadata[key[:-5]+'_score']}\n\n"
+                            + value
+                        )
                         del metadata_to_log[key]
 
             self.dataset.add_records(
                 records=[
-                    {
-                        "fields": fields,
-                        "metadata": metadata_to_log
-                    },
+                    {"fields": fields, "metadata": metadata_to_log},
                 ]
             )
-    
+
     def _create_tree_structure(
-        self,
-        events_trace_map: Dict[str, List[str]],
-        data_to_log: Dict[str, Any]
+        self, events_trace_map: Dict[str, List[str]], data_to_log: Dict[str, Any]
     ) -> List:
         """Create the tree data to be converted to an SVG."""
         events_trace_map = self._check_components_for_tree(events_trace_map)
         data = []
-        data.append((0, 0, self.root_node.strip("0").upper(), data_to_log[f"{self.root_node}_time"]))
+        data.append(
+            (
+                0,
+                0,
+                self.root_node.strip("0").upper(),
+                data_to_log[f"{self.root_node}_time"],
+            )
+        )
         current_row = 1
         for root_child in events_trace_map[self.root_node]:
-            data.append((current_row, 1, root_child.strip("0").upper(), data_to_log[f"{root_child}_time"]))
+            data.append(
+                (
+                    current_row,
+                    1,
+                    root_child.strip("0").upper(),
+                    data_to_log[f"{root_child}_time"],
+                )
+            )
             current_row += 1
             for child in events_trace_map[root_child]:
-                data.append((current_row, 2, child.strip("0").upper(), data_to_log[f"{child}_time"]))
+                data.append(
+                    (
+                        current_row,
+                        2,
+                        child.strip("0").upper(),
+                        data_to_log[f"{child}_time"],
+                    )
+                )
                 current_row += 1
         return data
-        
-    def _create_svg(
-        self, 
-        data: List
-    ) -> str:
+
+    def _create_svg(self, data: List) -> str:
+        """
+        Create an SVG file from the data.
+
+        Args:
+            data (List): The data to create the SVG file from.
+
+        Returns:
+            str: The SVG file.
+        """
+
         # changing only the box height changes all other values as well
         # others can be adjusted individually if needed
         box_height = 47
@@ -525,7 +594,7 @@ def _create_svg(
         text_centering = box_height * 0.6341
         node_name_indent = box_height * 0.35
         time_indent = box_height * 7.15
-        
+
         body = ""
         for each in data:
             row, indent, node_name, node_time = each
@@ -537,7 +606,9 @@ def _create_svg(
 </g>
             """
             body += body_raw
-            base = base =f"""
+            base = (
+                base
+            ) = f"""
 <?xml version="1.0" encoding="UTF-8"?>
 <svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 750 {len(data)*row_constant}">
 {body}
@@ -546,14 +617,24 @@ def _create_svg(
             base = base.strip()
         return base
 
-    def start_trace(
-        self, 
-        trace_id: Optional[str] = None
-    ) -> None:
-        """Launch a trace."""
+    # The four methods required by the abstrac class BaseCallbackHandler.
+    # These methods are the one being executed on the different events, by the llama-index
+    # BaseCallbackHandler class.
+
+    def start_trace(self, trace_id: Optional[str] = None) -> None:
+        """
+        Start tracing events.
+
+        Args:
+            trace_id (str, optional): The trace_id to start tracing.
+        """
+
         self._trace_map = defaultdict(list)
         self._cur_trace_id = trace_id
         self._start_time = datetime.now()
+
+        # Clear the events and the components prior to running the query.
+        # They are usually events related to creating the docs and indexing.
         self.events_data.clear()
         self.components_to_log.clear()
 
@@ -562,7 +643,14 @@ def end_trace(
         trace_id: Optional[str] = None,
         trace_map: Optional[Dict[str, List[str]]] = None,
     ) -> None:
-        """End a trace."""
+        """
+        End tracing events.
+
+        Args:
+            trace_id (str, optional): The trace_id to end tracing.
+            trace_map (Dict[str, List[str]], optional): The trace_map to end. This map has been obtained from the parent class.
+        """
+
         self._trace_map = trace_map or defaultdict(list)
         self._end_time = datetime.now()
         self._create_root_and_other_nodes(trace_map)
@@ -574,42 +662,40 @@ def on_event_start(
         event_type: CBEventType,
         payload: Optional[Dict[str, Any]] = None,
         event_id: Optional[str] = None,
-        parent_id: Optional[str] = None,
-        **kwargs: Any,
-    ) -> None:
-        """Run handlers when an event starts."""
+        parent_id: str = None,
+    ) -> str:
+        """
+        Store event start data by event type. Executed at the start of an event.
+
+        Args:
+            event_type (CBEventType): The event type to store.
+            payload (Dict[str, Any], optional): The payload to store.
+            event_id (str, optional): The event id to store.
+            parent_id (str, optional): The parent id to store.
+
+        Returns:
+            str: The event id.
+        """
+
         event = CBEvent(event_type, payload=payload, id_=event_id)
         self.events_data[event_id].append(event)
 
+        return event.id_
+
     def on_event_end(
         self,
         event_type: CBEventType,
         payload: Optional[Dict[str, Any]] = None,
-        event_id: Optional[str] = None,
-        **kwargs: Any,
+        event_id: str = None,
     ) -> None:
-        """Run handlers when an event ends."""
+        """
+        Store event end data by event type. Executed at the end of an event.
+
+        Args:
+            event_type (CBEventType): The event type to store.
+            payload (Dict[str, Any], optional): The payload to store.
+            event_id (str, optional): The event id to store.
+        """
+
         event = CBEvent(event_type, payload=payload, id_=event_id)
         self.events_data[event_id].append(event)
-
-def _get_time_diff(
-    event_1_time_str: str, 
-    event_2_time_str: str
-) -> float:
-    """Get the time difference between two events."""
-    time_format = "%m/%d/%Y, %H:%M:%S.%f"
-
-    event_1_time = datetime.strptime(event_1_time_str, time_format)
-    event_2_time = datetime.strptime(event_2_time_str, time_format)
-
-    return round((event_2_time - event_1_time).total_seconds(), 4)
-
-def _calc_time(
-    events_data: Dict[str, List[CBEvent]], 
-    id: str
-) -> float:
-    """Calculate the time difference between the start and end of an event using the events_data."""
-    start_time = events_data[id][0].time
-    end_time = events_data[id][1].time
-    return _get_time_diff(start_time, end_time)
-    
\ No newline at end of file


Test patch:
diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml
new file mode 100644
index 0000000..5947f87
--- /dev/null
+++ b/.github/workflows/integration-tests.yml
@@ -0,0 +1,83 @@
+name: 🧪 Integration Tests
+
+on:
+  push:
+    branches:
+      - '*'
+
+jobs:
+  integration_tests:
+    name: Running integration tests, which require an Argilla instance running
+    runs-on: ubuntu-latest
+    services:
+      search-engine:
+        image:
+          searchEngineDockerImage:
+            description: "The name of the Docker image of the search engine to use."
+            default: docker.elastic.co/elasticsearch/elasticsearch:8.8.2
+            required: false
+            type: string
+        ports:
+          - 6900:6900
+        env:
+          searchEngineDockerEnv:
+            description: "The name of the Docker image of the search engine to use."
+            default: '{"discovery.type": "single-node", "xpack.security.enabled": "false"}'
+            required: false
+            type: string
+    defaults:
+      run:
+        shell: bash -l {0}
+    steps:
+      - name: Checkout Code 🛎
+        uses: actions/checkout@v3
+      - name: Setup Conda Env 🐍
+        uses: conda-incubator/setup-miniconda@v2
+        with:
+          miniforge-variant: Mambaforge
+          miniforge-version: latest
+          use-mamba: true
+          activate-environment: argilla
+      - name: Get date for conda cache
+        id: get-date
+        run: echo "::set-output name=today::$(/bin/date -u '+%Y%m%d')"
+        shell: bash
+      - name: Cache Conda env
+        uses: actions/cache@v3
+        id: cache
+        with:
+          path: ${{ env.CONDA }}/envs
+          key: conda-${{ runner.os }}--${{ runner.arch }}--${{ steps.get-date.outputs.today }}-${{ hashFiles('environment_dev.yml') }}-${{ env.CACHE_NUMBER }}
+      - name: Update environment
+        if: steps.cache.outputs.cache-hit != 'true'
+        run: mamba env update -n argilla -f environment_dev.yml
+      - name: Cache pip 👜
+        uses: actions/cache@v3
+        with:
+          path: ~/.cache/pip
+          key: ${{ runner.os }}-pip-${{ env.CACHE_NUMBER }}-${{ hashFiles('pyproject.toml') }}
+      - name: Set Argilla search engine env variable
+        if: startsWith(inputs.searchEngineDockerImage, 'docker.elastic.co')
+        run: |
+          echo "ARGILLA_SEARCH_ENGINE=elasticsearch" >> "$GITHUB_ENV"
+          echo "Configure elasticsearch engine"
+      - name: Set Argilla search engine env variable
+        if: startsWith(inputs.searchEngineDockerImage, 'opensearchproject')
+        run: |
+          echo "ARGILLA_SEARCH_ENGINE=opensearch" >> "$GITHUB_ENV"
+          echo "Configure opensearch engine"
+      - name: Launch Argilla Server
+        env:
+          ARGILLA_ENABLE_TELEMETRY: 0
+        run: |
+          pip install -e ".[server]"
+          python -m argilla server database migrate
+          python -m argilla server database users create_default
+          python -m argilla server start &
+      - name: Run end2end examples 📈
+        env:
+          ARGILLA_ENABLE_TELEMETRY: 0
+        run: |
+          pip install pytest
+          pytest tests
+
diff --git a/tests/test_llama_index_callback.py b/tests/test_llama_index_callback.py
index 998c05a..d711e2b 100644
--- a/tests/test_llama_index_callback.py
+++ b/tests/test_llama_index_callback.py
@@ -1,13 +1,16 @@
+from argilla_llama_index.helpers import _calc_time, _get_time_diff
+
 import unittest
 from unittest.mock import patch, MagicMock
-from argilla_llama_index import ArgillaCallbackHandler, _get_time_diff, _calc_time # TODO: correct import
+from argilla_llama_index import ArgillaCallbackHandler
+
 
 class TestArgillaCallbackHandler(unittest.TestCase):
     def setUp(self):
         self.dataset_name = "test_dataset_llama_index"
-        self.workspace_name = "argilla"
+        self.workspace_name = "admin"
         self.api_url = "http://localhost:6900"
-        self.api_key = "argilla.apikey"
+        self.api_key = "admin.apikey"
 
         self.handler = ArgillaCallbackHandler(
             dataset_name=self.dataset_name,
@@ -21,7 +24,7 @@ def setUp(self):
         self.components_to_log = MagicMock()
         self._ignore_components_in_tree = MagicMock()
         self.trace_map = MagicMock()
-       
+
         self.tree_structure_dict = {
             "root": ["query"],
             "query": ["retrieve", "synthesize"],
@@ -56,33 +59,23 @@ def test_init_file_not_found_error(self, mock_from_argilla, mock_list):
                 api_key=self.api_key,
             )
 
-    def test_add_missing_metadata_properties(self):
-        dataset = self.handler.dataset
-        is_new_dataset_created = True
-        self.handler._add_missing_metadata_properties(dataset, is_new_dataset_created)
-        self.assertEqual(len(dataset.metadata_properties), 6)
-
     def test_check_components_for_tree(self):
         self.handler._check_components_for_tree(self.tree_structure_dict)
 
-    def test_create_tree(self):
-
-        tree = self.handler._create_tree(self.tree_structure_dict, self.data_to_log)
-        self.assertIsInstance(tree, str)
-
     def test_get_events_map_with_names(self):
 
-        trace_map = {
-            "query": ["retrieve"],
-            "llm": []
-        }
-        events_map = self.handler._get_events_map_with_names(self.events_data, trace_map)
-        self.assertIsInstance(events_map, tuple)
+        trace_map = {"query": ["retrieve"], "llm": []}
+        events_map = self.handler._get_events_map_with_names(
+            self.events_data, trace_map
+        )
+        self.assertIsInstance(events_map, dict)
         self.assertEqual(len(events_map), 2)
 
     def test_extract_and_log_info(self):
 
-        tree_structure_dict = self.handler._check_components_for_tree(self.tree_structure_dict)
+        tree_structure_dict = self.handler._check_components_for_tree(
+            self.tree_structure_dict
+        )
         self.handler._extract_and_log_info(self.events_data, tree_structure_dict)
 
     def test_start_trace(self):
@@ -97,7 +90,6 @@ def test_on_event_start(self):
         parent_id = "456"
         self.handler.on_event_start(event_type, payload, event_id, parent_id)
 
-
     def test_on_event_end(self):
         event_type = "event1"
         payload = {}
@@ -113,11 +105,15 @@ def test_get_time_diff(self):
     def test_calc_time(self):
 
         id = "event1"
-        self.events_data.__getitem__().__getitem__().time = "01/11/2024, 17:01:04.328656"
-        self.events_data.__getitem__().__getitem__().time = "01/11/2024, 17:02:07.328523"
+        self.events_data.__getitem__().__getitem__().time = (
+            "01/11/2024, 17:01:04.328656"
+        )
+        self.events_data.__getitem__().__getitem__().time = (
+            "01/11/2024, 17:02:07.328523"
+        )
         time = _calc_time(self.events_data, id)
         self.assertIsInstance(time, float)
 
+
 if __name__ == "__main__":
     unittest.main()
-