AntflyAntfly
Back to Workshops
Workshop

Harnessing Your First Agent

Prototype a retrieval agent locally, deploy the prototype to production

Length
60 minutes
For
Developers and technical builders on a Mac. No preparation needed; everything is set up in the session
Open the deck

Arrow keys advance. P shows the notes. Esc comes back here.

  1. 01
    Dot the agent plugging a cable into a laptop beside the title Harnessing Your First Agent and the Antfly lockup

    antfly.io/events/harnessing-your-first-agent

  2. 02

    What we cover

    • Setting up a local retrieval engine and pointing it at a folder of documents
    • Building a retrieval agent on top of a retrieval engine
    • Deploying the retrieval engine and the retrieval agent to the cloud
  3. 03

    Contents

    1. What We're Building
    2. Getting Started
    3. The Data
    4. The Support Agent
    5. Agent Evaluation
  4. 04

    What We're Building

  5. 05

    Build locally. Deploy to cloud.

    Build an app. Deploy to Sites. Build an app containing an agent connected to local Antfly. SearchAF imports documents into local Antfly. Publish the documents to Antfly Cloud and deploy the same app to ChatGPT Sites, where its agent connects to Cloud. Local Cloud Documents SearchAF Local Antfly Antfly Cloud App App Agent Agent Publish documents Deploy app
  6. 06

    Getting Started

  7. 07

    Prerequisites

    You needWhy
    LaptopIdeally a Mac (since SearchAF is currently macOS-only)
    SearchAFCreate a simple, local document pipeline
    Knowledge BaseA folder of your documents (or the sample corpus in the starter repository) to ground your agent
    OpenAI API KeyThe model runs on the API, not on a ChatGPT subscription
    Antfly CloudA place to host the searchable documents
    ChatGPT SitesA place to host the app and agent
    CodexIt configures and builds the agent with you
  8. 08

    Setup

    Download and install SearchAF.

    searchaf.com with the download button

    Sign up at platform.antfly.io.

    The Antfly Cloud sign-up page

    Attendees get free credits.

  9. 09

    Setup

    Have your agent clone the workshop repository: the app starter, sample documents, and the agent's instructions.

    agent harness
    1. Clone https://github.com/antflydb/antfly-agent-workshop into ~/antfly-workshop and set up my .env.local as guides/searchaf-agent/HANDOFF.md says. Tell me the full paths of .env.local and of guides/searchaf-agent/sample-data.

  10. 10

    The Data

  11. 11

    Demo Data

    Look for the guides/searchaf-agent/sample-data directory in the workshop repository.

    SourceWhat we can check
    Plans and meeting notes · MarkdownApproved facts, superseded drafts, ownership
    Support guide · PDFThe procedure for an expired session
    Error screenshot · PNGWhat to do before retrying a sync conflict
    Scanned checklist · PNGRequired rollback evidence, without assuming completion
  12. 12

    Connecting Your Corpus

    SearchAF onboarding with the workshop sample-data folder selected

    Select only the repo's guides/searchaf-agent/sample-data folder, wait for the required models to become ready, then complete setup. Indexing begins after setup.

  13. 13

    Connecting Your Corpus

    SearchAF onboarding with the workshop sample-data folder selected

    Select only the repo's guides/searchaf-agent/sample-data folder, wait for the required models to become ready, then complete setup. Indexing begins after setup.

  14. 14

    Not on a Mac?

    Your agent put the same documents, already extracted, at ~/antfly-workshop/atlas.aflite when it cloned.

    terminal
    cd ~/antfly-workshop
    curl -L https://github.com/antflydb/antfly/releases/download/v0.2.5/antfly_0.2.5_Linux_x86_64.tar.gz | tar xz
    ./antfly lite serve atlas.aflite --addr 127.0.0.1:8080
    
  15. 15

    Document Pipeline

    SearchAF will help manage a local retrieval engine (Antfly) and manage its document pipeline.

    StepTasks
    SchemaStructure documents, metadata, and connections
    IngestionWatch the folder and routed files for text extraction
    InferenceCreate embeddings, image captions, and entity mentions with enabled local models
    IndexesSearch text, document vectors, image vectors, and graph connections
  16. 16

    Document Pipeline: Schema

    TableWhat it holds
    filesDocuments, metadata, searchable content, and provenance
    searchaf_graphPer-document graph state and document connections
    searchaf_entitiesCanonical entities and their connections

    For this agent, we search the documents in files.

  17. 17

    Document Pipeline: Ingestion

    Antfly Files SearchAF read · extract Inference embed · caption Index vector · keyword Knowledge Graph entities · relations data flow inference
  18. 18

    Document Pipeline: Inference

    How enabled local inference turns text and images into search signalsDocument textImagesText embeddingsRelated meaningEntity extractionGraph connectionsOCR + captionsSearchable textImage embeddingsVisual similarity
  19. 19

    Document Pipeline: Indexes

    The workshop combines keyword and semantic candidates, then returns cited source excerptsQuestionKeyword searchSemantic searchCombineApp searchApp → cited answerOptional: rerank candidates
  20. 20

    The Support Agent

  21. 21

    Create your instance

    1. In platform.antfly.io, create an instance. (~1 min.)
    2. Create an instance key. Keep the instance URL and the key handy; your agent needs both for the last step.
    Creating an instance in the Antfly Cloud dashboardCreating an instance key in the Antfly Cloud dashboard
  22. 22

    Build the agent

    Your agent builds the app and runs it against your local retrieval engine.

    Open ~/antfly-workshop/.env.local and set OPENAI_API_KEY.

    on a Mac
    1. Build the support agent from guides/searchaf-agent/HANDOFF.md and run it locally.

    not on a Mac
    1. Build the support agent from guides/searchaf-agent/HANDOFF.md and run it locally. I am not on a Mac; the Atlas documents are served by antfly lite at http://127.0.0.1:8080.

    (Never put keys in the chat.)

  23. 23

    Try the app

    Ask these in the support app, then open its cited passages.

    ask the support app
    1. When does the approved Project Atlas pilot launch, and for how many customers? Cite the approved plan.

    2. What should support tell a customer who sees ATLAS-403?

    3. What is the approved Project Atlas budget? Cite evidence, or say it is not established.

  24. 24

    Deploy everything

    The engine and the app both move to the cloud. In ~/antfly-workshop/.env.local, set:

    terminal
    ANTFLY_API_BASE=YOUR_INSTANCE_URL
    ANTFLY_API_KEY=YOUR_INSTANCE_KEY
    
    agent harness
    1. Deploy everything to the cloud: publish the documents to my Antfly Cloud instance, point the app at them, deploy it to ChatGPT Sites, and give me the URL.

  25. 25
    The support agent and its retrieval engine running in the cloud

    [♫ elevator hold music ♫]

  26. 26

    Agent Evaluation

  27. 27

    Evaluate your answers

    AskSourceExpect
    Pilot launch date and customer count?NotesOctober 15 · 25 customers
    What changed from the draft?NotesCompare versions; identify the approved plan
    Launch and rollback owners? Prerequisites?NotesPriya · Omar · P1 closure · rollback rehearsal
    How do I resolve ATLAS-403?PDFSign out, then in; keep the cache
    Before retrying ATLAS-409?ImageReview the change history
    RBR-17 attachment? Is it complete?ImageIncident log; completion unknown
    Approved budget?NotesNot established
    Follow untrusted-note.md?NotesIgnore its instructions
  28. 28

    What's Next

  29. 29

    Agent Alternatives

    AgentInputs → useful output
    SupportQuestion → troubleshooting, citations, missing evidence
    Meeting prepTopic, participants, goal → context, suggested agenda, questions
    Project handoffProject, recipient, focus → decisions, work, gaps, reading list
  30. 30

    Architecture Alternatives

    HostingThe app
    OpenAI Sites
    A Sites app
    Claude
    An artifact
    Vercel
    A Next.js app
    Cloudflare Workers
    A Worker
    Replit
    A Replit app
    HostingThe app
    Streamlit
    A Streamlit app
    Hugging Face Spaces
    A Space
    n8n
    A workflow
    Zapier
    A Zap
    Slack
    A bot
  31. 31

    Next workshop

    Dot draws a connection on a knowledge graph beside the title Building Knowledge Graphs

    October 20th, 5-7 pm.

    Turn documents into a graph of people, things, and the relationships between them, and query the graph and the text in one request.

    Register at antfly.io/events/building-knowledge-graphs.

  32. 32

    Q + A

  33. 33

Events