Upgrade to Pro — share decks privately, control downloads, hide ads and more …

AI-Enabled Apps: Practical Uses of AI in Applic...

AI-Enabled Apps: Practical Uses of AI in Applications

Are you exploring how to incorporate artificial intelligence in new business applications or interested in creating more value from existing ones? Maybe you’re not sure where it makes sense or where cost outweighs the value. This talk will look at practical ways to take advantage of AI in everyday applications and some steps you can take to get there.

The presenter will start by covering some of the basics of AI, including some terms and common architectures. Then, we’ll look at some sensible approaches to incorporating AI into your applications. Finally, we will build our own AI-enabled application using SpringAI to truly understand the value it brings to the table.

Code: https://github.com/JMHReif/springai-goodreads

Jennifer Reif

August 15, 2024
Tweet

More Decks by Jennifer Reif

Other Decks in Technology

Transcript

  1. AI-Enabled Apps Practical Uses of AI in Applications Jennifer Reif

    [email protected] @JMHReif github.com/JMHReif jmhreif.com linkedin.com/in/jmhreif
  2. Who is Jennifer Reif? • Continuous learner • Conference speaker

    • Tech blogger • Other: geek Developer Advocate, Neo4j Jennifer Reif [email protected] @JMHReif github.com/JMHReif jmhreif.com linkedin.com/in/jmhreif
  3. Artificial intelligence capable of generating text, images, or other data

    using generative models, often in response to prompts. Generative AI models learn the patterns and structure of their input training data and then generate new data that has similar characteristics. Generative Arti fi cial Intelligence https://en.wikipedia.org/wiki/Generative_arti fi cial_intelligence
  4. LLMs What they’re good at… • General information • Public

    domain knowledge • Historical data • Creative / arts • Human assistant • Task delegation
  5. LLMs What they’re not so good at… • Lacking most

    recent data • Not always natural language • Language complexities, sarcasm, emotion • No sources • Hallucinations / Temperature • IP, bias, privacy
  6. RAG Retrieval Augmented Generation • Retrieval • Data retrieved from

    database • Augmented • Augments response with facts • Generation • Response in natural language Prompt + Relevant Information LLM API LLM
 Chat API User Database Search Prompt Response Relevant Results / Documents 2 3 1 Database
  7. Agentic Workflow Architecture • Uses “agents”/tools • LLM determines next

    step • Which tool/external source should be called • Uses result from tool as context Prompt + Relevant Information LLM API LLM
 Chat API User Tool Prompt Response Relevant Results / Documents 2 3 1 Source info
  8. Explainable AI • How did the LLM get this answer?

    • Grounding LLM answer with veri fi ed data With RAG + LLM
  9. Other benefits With non-LLM data • Information that LLM doesn’t

    have • More recent than LLM cuto ff • Private data • Ensure accurate, non-con fl icting data • Reduce hallucinations
  10. Private data set examples Probably data that already exists •

    Lessons learned • Project docs • Knowledge base / support docs • Onboarding / internal processes • Performance reviews / internal surveys • Job applicants / resumés • Internal trainings, videos, other content
  11. Example Kings and Queens king − man + woman ≈

    queen king man wom an 1 king man wom an 2 queen? 3
  12. Benefits Of using vectors • Embed nearly any type of

    data • Image, document, product, text, video, audio, sentence, word • Can be used to feed all sorts of architectures • Non-keyword search • Variety of criteria for search
  13. Similarity search • Expensive queries (compare to every vector) •

    Approximate nearest neighbor (k-ANN) • Example: Library • Book classi fi cation - author vs location of plot • Smaller search set = smaller retrieval time! Vector indexes Photo by Martin Adams on Unsplash
  14. Chatbot GDS Documentation • LLM hallucinating answers • Provide LLM

    with updated info • Assist users with learning GDS library • Backed by knowledge graph of documentation text • Streamlit + LangChain app • Log conversations with data • Improvements to responses!
  15. Benefits • Log conversations alongside grounding data • How LLM/users

    interact with documents • Monitor performance and improve • Analyze data: Algorithms + Visualization • Surface data quality issues in text • Chunk outliers or overlaps • Collapse duplicates
  16. Logging and Visualizing Conversations With a graph database Graph of

    an actual conversation between an Agent Neo user and the ChatGPT-4 LLM. Context Documents are labeled with their GDS Community.
  17. Semantic Search Movie search • Search movie based on di

    ff erent criteria • General theme or setting or plot? • Net fl ix search doesn’t work like this • Includes agentic approach (UI, trailers, etc) github.com/datastax/movies_plus_plus
  18. Benefits • Gather multiple data sources into one interface •

    Search on variety of criteria • Augment traditional search and LLM • Log interactions, likes, paths
  19. Recommendations Product (e.g. Book) • Search based on smaller criteria

    • Follow user journey for what to try next • Cross-sell • Use similarity from “unrelated” criteria Photo by Carl Raw on Unsplash
  20. Benefits • Combine di ff erent data sources • User

    preferences/lifestyles, order system, supply chain, etc • Cross-pollinate product categories • Customer 360, real-time markets, trends
  21. Other use cases • Fraud/Anomaly detection • Monitoring/Logging activities •

    Bugs and fi xes • Dependencies • Impact • Supply chain • Operations
  22. Nothing is a silver bullet • Can’t guarantee a consistent

    answer • Prompt engineering • Context window limits LLM is (of sorts) mind of its own
  23. Resources • Code: github.com/JMHReif/springai-goodreads • GraphAcademy courses: graphacademy.neo4j.com/categories/llms/ • NODES

    2024: dev.neo4j.com/nodes24 Jennifer Reif [email protected] @JMHReif github.com/JMHReif jmhreif.com linkedin.com/in/jmhreif