← All AI Engineer talks

AI Engineer World's Fair 2025

Building Alice’s Brain: an AI Sales Rep that Learns Like a Human - Sherwood & Satwik, 11x

Read the talk

Building Alice’s Brain: From Manual Sales Context to a Searchable Knowledge Base

Alice’s knowledge base turns seller documents, websites and media into retrievable context, then makes the evidence behind sales outreach visible to users.

From a talk by Sherwood Callaway and Satwik Singh

Before you start: Familiarity with language-model context windows, embeddings and basic web application architecture will help; sales terminology is introduced as needed.

What does Alice need to write a useful sales email?

A sales email needs more than a recipient’s name. It needs a reason that this seller’s offer matters to this particular person. That is the problem behind Alice, 11x’s AI sales development representative, or SDR. Sherwood Callaway, who introduces himself as the engineering lead for Alice, presents the system with Satwik Singh. Alongside Alice, 11x also builds Julian, a voice agent. An SDR sources leads, engages them across channels and books meetings; the outcomes that matter are positive replies and meetings booked. The opening example is an email Alice has written—the everyday output that her knowledge base must support.

Sherwood reports that Alice sends about 50,000 emails per day, compared with 20–50 for a human SDR. At the time of the talk, Alice was running campaigns for about 300 organizations. These are reported operating volumes, not measurements of reply rates or meetings booked; the human comparison’s conditions are not specified.

Email interface showing the subject “Quick thought about AudioMob’s financials” and a complete outreach message addressed to Norbert.
An example sales email referencing AudioMob’s growth and expense management.

Two terms separate the parties involved: the seller is the company using Alice to sell something, and the lead is the person receiving the outreach. The seller supplies business context, such as products and case studies, which Alice uses to personalize emails.

Alice needs knowledge on both sides of that relationship:

  • Seller context: Products, services, case studies, pain points, value propositions and the ideal customer profile, or ICP.
  • Lead context: Role, responsibilities, priorities, previously tried solutions, pain points and employer.

The knowledge-base work here focuses on knowing the seller: making its business information available when Alice needs to write.

0:250:34
Suggest correction

This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.

0:25 · section reference included

The limits of a manually curated library

Originally, sellers pushed context into Alice through a feature called the library. They entered each product and service, then filled in descriptions of its pain points, solutions and value propositions. These were not merely dashboard labels: the descriptions became context for email generation. During campaign creation, users selected which library offers Alice could access.

That workflow created two connected problems. First, onboarding required substantial manual entry, and users could not run campaigns until they had populated their library. Second, selecting offers forced a poor tradeoff: too few could leave Alice with nothing relevant for a particular lead, while too many filled the context window with material that made the resulting emails worse.

The change was to move context selection from the seller to Alice. Instead of asking users to describe and select every useful offer, the product would let Alice pull seller information into a knowledge base and retrieve the relevant material when writing each email.

3:093:22
Suggest correction

This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.

3:09 · section reference included

From uploaded resources to searchable knowledge

The new onboarding model resembles training a human SDR: provide source documents, allow time to learn and check what the person understands. For Alice, the equivalent is a centralized repository of seller information that can be consulted during message generation. Marketing materials, case studies, sales calls and press releases enter through three processing groups: documents and images, websites, and audio and video.

The ingestion architecture separates accepting a resource from making it searchable:

  1. Accept the upload. The client uploads a resource, which is saved to S3 and passed to the backend.
  2. Record and dispatch it. The backend creates database records and starts jobs according to the resource type and selected parsing vendor.
  3. Wait for parsing. Vendors process resources asynchronously, then send completion webhooks to the ingestion path.
  4. Persist and index the result. The application stores the parsed artifact in its database and embeds and upserts its content into Pinecone.
  5. Expose the knowledge. Database updates refresh the UI, while the agent can query Pinecone for the newly stored information.

The final architecture reveal connects the upload and processing infrastructure to that agent query.

Architecture diagram connecting a client, Amazon S3, GQL server, internal server, parsing API, Inngest, PostgreSQL, webhook handler, event consumer and Pinecone; the agent and query connection are highlighted.
Resource ingestion architecture, ending with an agent querying Pinecone.

Within this architecture, the team identifies five pipeline stages: parsing, chunking, storage, retrieval and visualization. The last stage is part of the product contract: users need a way to inspect what Alice has learned, not just a background process that finishes successfully.

5:355:53
Suggest correction

This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.

5:35 · section reference included

Make every resource usable as Markdown

Parsing converts resources such as PDFs, images and MP4 files into text that the downstream language-model workflow can use. Multimodal models offer another way to consume some of these inputs, but their restrictions did not eliminate the need for parsing in this system. Alice’s common output format is Markdown, which preserves meaningful distinctions such as headings, paragraphs and formatting rather than flattening everything into undifferentiated text.

The team chose not to build parsers from scratch. Supporting five resource types meant supporting many individual file formats, and each format could demand specialist knowledge. Vendors already concentrated their engineering effort on those problems. Outsourcing parsing offered a faster route to market and a more credible outcome than asking the Alice team to become experts in every input format.

Initial vendor selection used three requirements: support the necessary resource types, return Markdown and deliver results through webhooks. Two quality dimensions were deliberately not benchmarked at first:

  • Accuracy: Whether the extracted output matches the original resource.
  • Comprehensiveness: How much of the resource’s information appears in the output.

The team assumed leading vendors would fall within a reasonable band on both. Cost optimization was also deferred: the system was still pre-production, so they lacked the usage data needed to understand where spending would accumulate.

7:528:02
Suggest correction

This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.

7:52 · section reference included

Different parsers, one downstream format

For documents and images, the team selected LlamaParse, a LlamaIndex product. Among the document parsers they evaluated, it offered the broadest file-format support they found. Support also mattered: the team describes Jerry and the team joining a Slack channel within a couple of hours of the initial evaluation. The demonstration converts an 11x sales-deck PDF into Markdown, turning presentation content into material the rest of the pipeline can process.

For websites, they selected Firecrawl. They already knew it from another project, and the crawl endpoint they needed from the alternative, Tavily, was still in development during selection. That was an availability decision, not a finding that Tavily parsed websites poorly; Tavily now documents a crawl endpoint. The example takes the Brex homepage and produces another Markdown document.

For audio and video, they chose Cloudglue. The decisive capability was extracting information from the video imagery as well as transcribing speech. A transcript alone can miss information presented visually. The talk describes YouTube videos, MP4 files and other video formats becoming Markdown. Input route and API still matter when reproducing that behavior today: Cloudglue’s current Describe documentation demonstrates uploaded-video visual extraction, while its current Extract guide limits direct YouTube entity extraction to speech. The talk does not specify Alice’s historical YouTube processing route.

10:5611:15
Suggest correction

This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.

10:56 · section reference included

Preserve structure before enforcing size

Once every resource is Markdown, chunking turns long documents into units that can be embedded and retrieved. A title and a paragraph carry different kinds of meaning, so preserving structure matters. Retrieving an entire ten-page document would also make it harder to isolate the part relevant to a particular email.

Possible boundaries include tokens, sentences and Markdown headers; an LLM can also decide how to split a document. The choice starts with the intended retrieval unit: what information should stay together, what will the agent ask for, and will the same approach work for a PDF, a slide deck and a video-derived document? A chunk must preserve enough meaning to be useful while remaining suitable for embedding and storage.

Alice uses a waterfall: split on Markdown headers first, then sentences, then tokens as needed to satisfy a target token count. The target size is not specified in the talk. The following TypeScript expresses that control flow, with the boundary splitters and tokenizer supplied by the implementation:

typescript

type Split = (text: string) => string[];

type ChunkingRules = {
  maxTokens: number;
  countTokens: (text: string) => number;
  byMarkdownHeader: Split;
  bySentence: Split;
  byTokenLimit: Split;
};

function chunkMarkdown(text: string, rules: ChunkingRules): string[] {
  const splitters = [
    rules.byMarkdownHeader,
    rules.bySentence,
    rules.byTokenLimit,
  ];

  function split(part: string, level: number): string[] {
    if (rules.countTokens(part) <= rules.maxTokens) return [part];
    if (level === splitters.length) {
      throw new Error("Token splitter exceeded the configured limit");
    }
    return splitters[level](part).flatMap(piece => split(piece, level + 1));
  }

  return rules.byMarkdownHeader(text).flatMap(part => split(part, 1));
}

A section that already fits stays intact. An oversized section falls through to sentence boundaries, and an oversized sentence reaches the token splitter. This makes size enforcement progressively more aggressive instead of discarding structural boundaries immediately.

The team reports that the approach worked across their document types and preserved Markdown chunks they could display cleanly in the UI. It also prevented very long chunks from diluting the meaning of the information being embedded. That connects chunking to two consumers at once: retrieval needs focused units, and users need readable evidence.

12:3912:43
Suggest correction

This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.

12:39 · section reference included

Choose storage for the retrieval operation

Retrieval-augmented generation does not require a vector database. External context can come from a graph database, Elasticsearch, a document or relational database, a key-value store, files or S3. Alice uses vector storage because the operation the team wanted was similarity search.

The team chose Pinecone as an established, cloud-hosted provider with approachable guides and SDKs. Hosting removed another infrastructure responsibility. Its bundled embedding models also removed the need to select a separate embedding provider or host a model themselves: they could use the embedding capability supplied with the database service. Vendor support contributed beyond setup, helping the team examine alternative storage approaches, including graph databases and graph RAG.

14:5815:12
Suggest correction

This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.

14:58 · section reference included

Let the lead guide the research

With the seller’s information indexed, the next question is how to retrieve it. The talk describes a progression in which retrieval becomes increasingly controlled by the agent:

ApproachHow retrieval enters generation
Traditional RAGRetrieved context enriches the system prompt.
Agentic RAGThe agent calls retrieval tools within its workflow.
Deep research RAGThe agent plans retrieval and decides whether to search further.

In the last approach, research can broaden or deepen according to what the task still needs. Retrieval is no longer necessarily a single fixed step before generation.

Alice’s team built its research agent with Letta. The workflow begins with lead information, which conditions the research plan:

  1. Form a plan containing one or more context-retrieval steps.
  2. Execute the retrieval tool calls.
  3. Summarize the results.
  4. Return answers in a clean Q&A format.

The demonstration shows a result organized around two questions. The important connection is between lead-specific research and seller knowledge: the repository can contain broad business context, while the agent selects what is useful for the current recipient.

16:5417:04
Suggest correction

This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.

16:54 · section reference included

Make Alice’s knowledge inspectable

A seller is trusting Alice to represent its business. That creates concrete concerns: will she describe the products correctly, invent a case study or testimonial, or claim to solve a pain point the business does not address? The team’s response was to let users inspect the knowledge behind the output.

The product projects vectors from Pinecone into three dimensions using UMAP, then renders them as interactive nodes. Clicking a node reveals its associated text chunk. Sales and support teams use this view to demonstrate what Alice knows. The useful inspection operation is the connection from a visible node to stored source text; the spatial display itself is not a correctness test.

Product screenshot showing a network of colored nodes and connecting lines beside a text panel; Visualization is highlighted in the pipeline sidebar.
UMAP projection of the knowledge-base vectors, with a selected text passage alongside. The interface labels this view “Knowledge Graph Visualization.”

The ordinary onboarding path begins with an upload modal. Users add URLs, web pages, documents or videos and click Learn; the resources then appear in the knowledge-base UI. A separate Letta-powered agent lets users ask questions about that knowledge.

During campaign creation, knowledge-base content appears as Q&A on the left side of the interface. Expanding a question reveals the retrieved chunks used in the messaging flow. This brings evidence inspection into the task where it matters: a user can examine the context used to produce outreach instead of manually choosing every offer beforehand. The resulting experience returns to the human SDR analogy—provide the source material, then inspect how it is being used.

18:3018:44
Suggest correction

This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.

18:30 · section reference included

Reach production, then measure the remaining problems

The difficulty of this project came from the accumulation of small decisions: choosing technologies, supporting heterogeneous resource types and connecting their outputs into one usable workflow. Sherwood describes RAG as substantially harder than the team expected. Their production advice follows from that experience: first ship a system that satisfies the product requirements, then establish benchmarks from real usage and iterate.

Vendors were part of that learning process, not just interchangeable endpoints. The team recommends asking vendors to explain their offerings, compare alternatives and help customers understand why a particular approach fits. Those conversations can reduce the amount of specialist knowledge a small product team must acquire alone.

The remaining work was explicitly a future agenda:

  • Email hallucinations: Track and address unsupported claims in generated outreach.
  • Parsing quality: Evaluate vendors on accuracy and completeness, the dimensions deferred during initial selection.
  • Hybrid retrieval: Experiment with a graph database alongside vector storage.
  • Pipeline cost: Reduce spending across the full ingestion and retrieval path.

The implemented knowledge base changed how sellers supplied and inspected context. The next phase was to measure whether the extracted information was faithful and complete, whether Alice used it reliably, and what that reliability cost.

Future plans slide listing tracking email hallucinations, evaluating parsing vendors, experimenting with vector and graph databases, and reducing pipeline cost.
Future plans cover hallucinations, parsing quality, hybrid RAG and pipeline cost.
20:3820:48
Suggest correction

This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.

20:38 · section reference included

Resources

From the talk

Updates since the talk

Read the complete timestamped transcript
  1. 0:00

    [upbeat music] Okay.

  2. 0:15

    Thanks everyone for coming today. Uh, so today's talk is called Building Alice's Brain: How We Built an AI Sales Rep That Learns Like a Human.

  3. 0:25

    Uh, my name is Sherwood. I am one of the tech leads here at 11x. I lead engineering for our Alice product, and I'm joined by my colleague, Satwik.

  4. 0:34

    So 11x, for those of you who are unfamiliar, is a company that's building digital workers for the go-to-market organization. We have two digital workers today. We have Alice, who is our AI SDR, and then we also have, uh, Julian, who is our voice agent, and we have more workers on the way.

  5. 0:49

    Today, we're gonna be talking about Alice specifically, and actually, uh, Alice's brain or the knowledge base, which is effectively her brain.

  6. 0:58

    So let's start from the basics. Uh, what i-- what is an SDR? Well, an SDR is, is a sales development representative, if you're not familiar. I know that's a room full of engineers, so I s-- thought I would start with the basics.

  7. 1:08

    And this is essentially an entry-level sales role. This is the kind of job that you might get, uh, right out of school, and your responsibilities, uh, basically boil down to three things.

  8. 1:17

    First, you're sourcing leads. These are people that you'd like to sell to. Then you're contacting them or engaging them across channels. And finally, you're booking meetings with those people.

  9. 1:26

    So your goal here is to generate positive replies and meetings booked. These are the two, uh, key metrics for an SDR.

  10. 1:34

    And a lot of an SDR's job boils down to writing emails like the one that you see in front of you right now. This is actually an email that Alice has written, and, uh, it's an example of the type of, uh, of, the type of work output that Alice has.

  11. 1:47

    Uh, Alice sends about fifty thousand of these emails to, uh, uh, in a given day, and that's in comparison to a human SDR who would send twenty to fifty.

  12. 1:55

    Uh, and Alice is now running campaigns for about three hundred different, uh, business organizations.

  13. 2:03

    So before we go any further, I want to define some terms because, uh, since we work at 11x, we have our customers, but then our customers also have their customers, so things get a little confusing.

  14. 2:13

    Uh, today we'll be using the term seller to refer to the company that is selling something through Alice, that is our customer, and then we'll be using the term lead to refer to the person who's being sold to.

  15. 2:24

    And here's what that looks like as a diagram. You can see the seller is pushing context about their business. These are the, the products that they sell or the, uh, case studies that they have that they can reference in emails.

  16. 2:34

    She-- they're pushing that to Alice, and then Alice is then using that to personalize emails for each of the leads that she contacts.

  17. 2:42

    So there are two requirements that Alice needs to, uh, in order to succeed in her role. The first is that she needs to know the seller, the products, the, the services, the case studies, the pain points, the value props, the ICP.

  18. 2:54

    And the second is that she needs to know the lead, uh, their role, their responsibilities, what they care about, what other solutions they've tried, uh, pain points that they might be experiencing, the company they work for.

  19. 3:05

    And today, we're gonna be really focused on knowing the seller.

  20. 3:09

    So in our-- in the old version of our product, the seller would be responsible for pushing context about her, uh, about their business to Alice, and they did so through a manual experience, uh, called the library.

  21. 3:22

    And here you can see what it looks like there, where the library shows, uh, all of the different products and offers that are available for this business that, uh, Alice can then reference when she writes emails.

  22. 3:32

    The user would have to enter details about all, every individual product and service and all of the pain points and solutions and value props associated with them in our dashboard and including these detailed descriptions.

  23. 3:43

    And those descriptions would, uh, were, were important to get right because these actually get included in the context for the emails or for Alice when she writes the emails.

  24. 3:52

    Then later on, during campaign creation, uh, this is what it looks like to, to create a campaign. And you can see we have a lead in the top left, and the user is selecting the different offers that they've defined from the library in the top right that...

  25. 4:04

    And these are the offers that Alice has access to when she's generating her emails.

  26. 4:09

    We had a lot of problems with this user experience, and the first one was it was just extremely tedious. It was a really bad and, and cumbersome user experience.

  27. 4:17

    The user had to enter a lot of information, and that created this onboarding friction where, uh, users couldn't actually run campaigns until they had filled out their library.

  28. 4:27

    And finally, the emails that we were generating using this approach were just suboptimal. Users would have to either choose between too few ema-- uh, too few offers, uh, which meant that, uh, you'd have irre-irrelevant offers for a given lead or too many offers, which means that you have all of the stuff in the context window, and Alice

  29. 4:43

    just wasn't as smart when she write the, writes those emails.

  30. 4:47

    So how can we address this? Well, we had an idea, which is that instead of the seller being responsible for pushing context about the business to Alice, we could flip things around so that Alice can proactively, uh, pull all of the context about the seller into her system and then use whatever, whatever is most relevant when writing

  31. 5:05

    those emails. And that's effectively what we accomplished with the knowledge base, which we'll tell you more about in just a moment.

  32. 5:12

    So for the rest of the talk, we're going to first do a high-level overview of the knowledge base and how it works. Then we will do a deep dive on the pipeline, the different steps in our, uh, RAG system pipeline.

  33. 5:24

    Then after that, we will talk through the user experience of the knowledge base, and we will wrap up with some lessons from this project and, uh, future plans.

  34. 5:33

    So let's start out with, uh, an overview.

  35. 5:35

    All right. So overview, what is knowledge base, right? It's basically a way for us to kind of get closer to a human experience. Like if a hum-- if you're training a human SDR, you would kind of get them in, and then you will basically dump a bunch of documents on them, and then they ramp up throughout a

  36. 5:53

    period of like weeks or months, um, and you can basically check in on their prog-progress. Um, and similar to that, knowledge base is basically a centralized repository on our platform for the seller info, and then users can kind of come in, dump all their source material, and then we are able to reference that information at the time

  37. 6:11

    of message generation.

  38. 6:13

    Um, now what resources do SDRs care about? Here's a little glimpse into that. Marketing materials, case studies, uh, sales calls, press releases, you know, and a bunch of other stuff.

  39. 6:23

    Um, now how do we bucket these into categories that we're actually going to parse? Uh, well, we created documents and images, websites, and then media, audio, video, and you're gonna see why that's important.

  40. 6:36

    So here's an overview of what the architecture looks like. It starts off with the user uploading something, any document or resource in the client, and then we save it to our S3 bucket and then send it to the back end, um, which then, you know, creates a bunch of resources in our DB and then kicks off a

  41. 6:53

    bunch of jobs depending on the resource type and the vendor selected. Now, the vendors are asynchronously doing the parsing. Once they're done, they send a webhook to us, which we consume via ingest.

  42. 7:03

    And then once we've consumed that webhook, we take that parsed, uh,

  43. 7:09

    uh, artifact that we get back from the ven-vendors, and then we store it in our DB and then at the same time upsert it to Pinecone and embed it.

  44. 7:17

    Um, and then eventually once we store it in the local DB, we have like a UI update, and then eventually our agent can query Pinecone, our vector DB, for that stored information that we just put in.

  45. 7:31

    So now that we have a high level of understanding of how the knowledge base works, let's dig into each individual step in the pipeline. There are five different steps in the pipeline.

  46. 7:39

    The first is parsing, then there's chunking, then there's storage, then there's retrieval, and finally, we have visualization, which will, uh, sounds a little untraditional, but we'll cover it in a, in a moment.

  47. 7:52

    So let's start with parsing. Uh, what is parsing? I think that we probably all take this for granted, but it's worth defining. Parsing is the process of converting a non-text resource into text.

  48. 8:02

    And the reason that this is necessary is because, as we all know, language models, they speak text. So in order to make information that is represented in a different form like a PDF or an MP4 file or a, or an image legible or useful to the LLM, we need to first convert it to text.

  49. 8:19

    And so one way of thinking about parsing is it's the process of making non-text information legible to a large language model. Um, and we do have multimodal models that are one solution to this, but there are lots of restrictions on multimodal models that make it, um, that make parsing still relevant.

  50. 8:35

    So to illustrate that, we have the five different document types or resource types that we mentioned momentarily ago, uh, going through our parsing process and coming out as actually Markdown, which is a type of text that, uh, as we all know, contains, uh, some structural information and, and formatting, which is actually semantically, semantically meaningful and useful.

  51. 8:53

    Let's talk about the process of how we implemented parsing, and the, the short answer is that we did not. We didn't wanna build this from scratch, and we had a few different reasons for doing this.

  52. 9:02

    The first is that w- you just saw that we had five different resource types and a lot of different file types within each of them. We thought it was gonna be too many, and we thought it was gonna be too much work.

  53. 9:11

    We wanted to get to market quickly. Um, the last reason was that we just weren't that confident in the outcome. There are vendors who dedicate their entire company to building an effective parsing system for a specific resource type.

  54. 9:23

    We didn't want our team to, to have to become specialists in, in parsing for each one of these resource types and to build a, a parsing system for that.

  55. 9:30

    We thought that maybe if we tried to do this, the outcome actually just wouldn't be that, that successful. So we chose to work with a vendor, and here are a bunch of the vendors that we, uh, we came across.

  56. 9:41

    You can find ten or twenty or fifty with just a quick Google search, but these are some of the leaders that we evaluated.

  57. 9:48

    And in order to make a decision, we came up with some requir-requirements, and it was three specific requirements. The first was that we needed, uh, support for our necessary resour-resource types.

  58. 9:57

    That goes without saying. We also wanted Markdown output. And then finally, we wanted this vendor to support webhooks. We wanted to be able to receive that output in a convenient manner.

  59. 10:08

    A few things that we didn't consider to start out with. Accuracy. Crazy, we didn't consider accuracy. We didn't consider either accuracy or comprehensiveness. Our assumption here was that most of the vendors that are leaders in the market are gonna be within a reasonable band of accuracy and comprehensiveness.

  60. 10:25

    And accuracy would refer to whether or not the extracted output is-- actually matches the, the original resource. Comprehensiveness, on the other hand, is the amount of extracted information that is, uh, available, um, in the, in the final output.

  61. 10:39

    And the last thing that we didn't really consider was cost, uh, to be honest, and this was because we were-- the system was pre-production. We didn't have real production data yet, and we didn't know, uh, what our usage would be.

  62. 10:50

    And so we, we figured what we would do is we'd come back and optimize cost once we had real usage data.

  63. 10:56

    So onto our final selections. For documents and in-images, we chose to work with LlamaParse, which is a LlamaIndex product. Uh, I think Gerry was up here earlier today. Uh, and the reasons that we chose to work with LlamaParse was, first, it supported the most number of file types out of any document parsing solution we could find, and

  64. 11:15

    second, their support was really great. Gerry and his team were, were, were quick to get in a Slack channel with us, I think within just a couple of hours of us doing an initial evaluation.

  65. 11:25

    And with LlamaParse, we're able to turn documents like this PDF of a s-- uh, 11x sales deck into a Markdown file like the one you see on the right.

  66. 11:34

    For websites, we chose to work with Firecrawl. The other main vendor that we were considering was Tavily, and this is actually not really a m- a major knock on Tavily.

  67. 11:41

    For Firecrawl, we chose to work with them because first we were familiar. We had already worked with them on a previous project. And secondly, Tavily's crawl endpoint, which is the endpoint that we would have needed for this project, was still in development at the time, so it wasn't something we could actually use.

  68. 11:57

    And similar to, uh, LlamaParse with Ta-- with, uh, Firecrawl, we are able to take a website like this Brex homepage that you see here and turn it into another Markdown document.

  69. 12:07

    Then we have audio and video. And for audio and video, we chose to work with a newer, uh, upstart vendor called Cloudglue.

  70. 12:14

    And the reasons that we chose to work with Cloudglue were first, they supported both audio and video, not just audio. And con-- second, they were actually capable of extracting information from the video itself, as opposed to just transcribing the video and giving s- us back, uh, a, a Markdown file that contains the transcript of the audio.

  71. 12:32

    And so with Cloudglue, we're able to turn, uh, YouTube videos and MP4 files and other video formats into Markdown like you see on the right.

  72. 12:39

    So now that everything is Markdown, we move on to the next step, which is chunking.

  73. 12:43

    All right. Markdown, let's go. Now, basically, we have a blob of Markdown, right? And we want to kind of break it down into, like, semantic entities that we can embed and put it in our vector DB.

  74. 12:56

    At the same time, we wanna, uh, protect the structure of the Markdown because it contains some meaning inherently, like something's a title versus something's a paragraph. There is inherent meaning behind that.

  75. 13:08

    Um, so we're splitting these long blobs of text, like 10-page documents, into chunks that we can eventually retrieve, uh, after we've embedded and stored them in a vector DB, right?

  76. 13:18

    And now basically, we can im- like, take all of this and, like, we're thinking about how we can s- you know, split a long document into chunks, right? So chunking strategies.

  77. 13:30

    Um, you have various things that you can do. You can split on tokens, you can split on sentences. You can also split on Markdown headers, right? And then you can do like LLM calls and have an LLM split your [chuckles] document into chunks, you know, or any combination of the above.

  78. 13:46

    Um, now, what you wanna ask yourself when you're deciding on a chunking strategy is like, um, what kind of logical units am I trying to preserve in my data, right?

  79. 13:55

    What do I eventually want to extract during my retrieval, right? What strategy will keep them intact, and at the same time, you're able to successfully embed them and store them in whatever DB you want.

  80. 14:06

    Um, so and then should I s- try a different strategy for different resource types? We have like, we have to deal with PDFs, PowerPoints, videos, right? Um, and then eventually, what kinds of queries or retrieval strategies am I expecting?

  81. 14:20

    Um, and then we ended up with like a combination of all the three, like, all the things that we mentioned. So we split on Markdown headers, and then we kind of a waterfall.

  82. 14:30

    So because we want our, like, records in our vector DB to be a certain token count, so we split on Markdown headers, and then we split on sentences, and then eventually we split on tokens.

  83. 14:41

    And then, yeah, it's like worked well for us, uh, for all types of documents. Um, and it has successfully preserved our Markdown chunks that we can kind of cleanly show in the UI.

  84. 14:51

    Um, and it also prevents super long chunks, which are, you know, diluting the meaning behind your document if you end up with that.

  85. 14:58

    Okay, so we have split all of our Markdown into individual chunks. It's now time to put those chunks somewhere. We're gonna store them. Let's talk about storage technologies. So for storage technologies, I'm sure everyone is, like, here for the RAG section, so they think that we're using a vector database.

  86. 15:12

    We actually are using a vector database. But to be pedantic, RAG is Retrieval-augmented generation, so we all know that, uh, anytime you're retrieving context from an external source, whether it's a graph database or Elasticsearch or, uh, a file in the file system, that also qualifies as RAG.

  87. 15:29

    Um, some of the other options you can use for RAG, uh, I just mentioned a graph database, document databases, uh, relational databases, key-value stores. You could even use object storage like S3.

  88. 15:41

    In our case, we did use a vector database, and that's because we wanted to do simi- similarity search, which is what vector databases are, are built for and optimized for.

  89. 15:51

    Once again, we had a lot of options to choose from. This is, uh, not a complete or an exhaustive list.

  90. 15:58

    In the end, we chose to work with a company called Pinecone, and the reason that we chose to work with Pinecone was first, it was a well-known solution. We were kind of new to the space, and we thought, probably can't go wrong going with the market leader.

  91. 16:11

    It was cloud-hosted, and so our team wouldn't have to spin up any additional infrastructure.

  92. 16:16

    It was really easy to get started. They had great getting started guides and SDKs.

  93. 16:21

    Uh, they had embedding models bundled with the solution. So for a vector database, typically you have to embed the information before it goes into the database. Uh, that would require the use of a third-party or an external vector da- vector, uh, excuse me, embedding model.

  94. 16:33

    And, uh, with Pinecone, we didn't actually have to go find another embedding model provider or host our own embedding model. We just used the one that they provide. And last but not least, their customer support was awesome.

  95. 16:43

    They got on a lot of calls with us, helped us analyze, uh, different vector datas- database options and think through, uh, graph databases and graph RAG, whether that made sense for us.

  96. 16:54

    So retrieval, the RAG part of the RAG workflow that we just built, right? Um, you'll see that there's actually an evolution of different RAG techniques over the last year.

  97. 17:04

    We started off with just traditional RAG, which is kind of a play on you're pulling information and then enriching your system prompt for an LLM API call, right? And then eventually, that turned into an agentic RAG form, where now you have all these tools for getting information retrieval, and then you attach those tools to whatever agentic flow

  98. 17:24

    that you have, and then it calls the tool as a part of its larger flow, right? Now, something we- we're seeing emerge in the last couple of months is deep research RAG, where now you have these deep research agents which are coming up with a plan, and then they execute them, and the plan may contain one or

  99. 17:41

    many steps of retrieval, right? These deep research agents can go broad or deep depending on the context needs, and they can evaluate whether or not they wanna do more retrieval.

  100. 17:51

    Um, we ended up building a deep research agent. Um, we actually used a company called Letta. Letta is a cloud agent provider, and they're really easy to build with.

  101. 18:02

    Um, how it works, basically, we pass in the lead information to our agent, and then it basically comes up with a plan. Plan contains one or many context retrieval steps, and then eventually You know, does the tool call, summarizes the results, and then generates an answer for us in a nice clean Q&A manner, right?

  102. 18:23

    And then this is kind of how it looks like for a system with two questions that we ask. Um,

  103. 18:30

    Vis?

  104. 18:30

    Now on to visualization, the most, uh, mysterious part of the pipeline. So what does visualization have to do with a, a RAG or ETL pipeline? Um, for more context, our customers are trusting Alice to represent their business.

  105. 18:44

    They really want to know that Alice knows her stuff, that she actually knows the products that they sell, and she's not gonna lie about case studies or testimonials or, uh, make things up about the pain points that they address.

  106. 18:53

    So how can we reassure them? In our case, we came up with a solution which is to let Al- let users peek into Alice's brain. Get ready.

  107. 19:02

    This is what that looks like. We have a, an interactive three-D visualization of the knowledge base available in the product. What we've done here is taken all of the vectors, vectors from our, uh, Pinecone vector database and, uh, collapsed, or actually, excuse me, I think the correct term is projected them down to just three dimensions.

  108. 19:21

    So we're gonna render them as nodes in three-dimensional space.

  109. 19:23

    UMAP.

  110. 19:24

    Um, [chuckles] UMAP. With using UMAP. Uh, and once the nodes are visible in this space, you can click on any given node to view the associated chunk. This is one of the ways that, uh, for example, our sales team, our support team will demonstrate Alice's knowledge.

  111. 19:40

    Now how does it look like in the actual UI, right? Basically, you start off with this nice little modal. You know, you drop in your URLs, your web pages, your documents, your videos, and then you click Learn, and then it kinda shows up nicely in the UI.

  112. 19:53

    Um, you have all the resources there, and then you have the ability to interrogate Alice about what she knows of your knowledge base, right? It's a really nice agent that we built, again, using Lera.

  113. 20:04

    And here's how it looks like in the campaign creation flow. You see that on the left-hand side we have the knowledge base content showing up as a nice Q&A where you can click on the questions and it shows you a dropdown of the chunks that we retrieve, and these were used as a part of the messaging flow.

  114. 20:21

    So now with that, we have achieved our goal. Our agent is closer to a human than being an email-a-tron, right? We are now, [laughs]

  115. 20:30

    we are now basically, uh, emulating how you onboard a human SDR. You dump in a bunch of context, and they just know.

  116. 20:38

    So in conclusion, the knowledge base was a pretty revolutionary project for our product and really changed the user experience and also leveled up our team a lot. Uh, we learned a lot of lessons.

  117. 20:48

    It was hard to create this slide, but there are just three that I wanna highlight for you today. The first was that RAG is complex. It was a lot harder than we thought it was gonna be.

  118. 20:57

    There were a lot of micro-decisions made along the way, a lot of different technologies we had to evaluate. Supporting different research types was hard. Hopefully you all have a better appreciation of how complicated RAG can be.

  119. 21:08

    The second lesson was that you should first get to production before benchmarking, and then you can improve. And the idea here is that with all of those decisions and vendors to evaluate, uh, it can be hard to get started.

  120. 21:19

    So we recommend just getting something in production that satisfies the product requirements and then establishing some real benchmarks which you can use to iterate and improve.

  121. 21:28

    And the last learning here was that you should lean on vendors. You guys are all gonna be buying solutions, and they're gonna be fighting for your business. Make them work for it.

  122. 21:36

    Make them teach you about the different, uh, the different offerings and why their solution is better.

  123. 21:41

    And so our future plans are to first track and address hallucinations in our emails,

  124. 21:47

    evaluate parsing vendors on accuracy and completeness, those, uh, metrics that we, uh, identified earlier, experiment with hybrid RAG, the introduction of a graph database alongside our vector database, and finally to just focus on reducing cost across our entire pipeline.

  125. 22:03

    And if any of this sounds interesting to you, we are hiring, so please reach out to either Satwik or myself.

  126. 22:07

    Join us.

  127. 22:09

    And, uh, thank you all for coming today. [audience applauding] [upbeat music]