ππ Langchain.rb
For: NYC.rb
By: Andrei Bondarev
Date: July 12, 2023
About Me
Background
ππ Langchain.rb
Source: βEmerging Architectures for LLM Applicationsβ (a16z blog)
Why Ruby?
Use-cases
Tools
Vector search
Definition: Vector search is a way to find related objects that have similar characteristics using machine learning models that detect semantic relationships between objects in an index.
Word embedding: a vector (array) of float numbers (coordinates) that represents properties of the word.
Vector size == Dimension.
Example: [0.15, 0.67, 0.54, 0.21, β¦ ]
Vector search
Sentence embeddings: similar to word embeddings but converts the semantic meaning to a vector of numbers for the whole sentence
Vector search X LLM matrix
| Chroma | Milvus | Pgvector | Pinecone | Qdrant | Weaviate | β¦ |
Cohere | β | β | β | β | β | β | β |
Google Palm | β | β | β | β | β | β | β |
Hugging Face | β | β | β | β | β | β | β |
Local Llama | β | β | β | β | β | β | β |
OpenAI | β | β | β | β | β | β | β |
β¦ | β | β | β | β | β | β | β |
Benefits
Vector search
ActiveRecord integration
Vector search
Q&A on top of imported corporate βbenefits brochureβ (2014)
Q&A over data
Chat bots
Project: alchaplinsky/aiconvo
Agents (experimental)
Tools
Prompt used in Langchain::Agent::ReActAgent
Langchain::Agent::ReActAgent
Langchain::Agent::SQLQueryAgent
Whatβs next?!
References
Questions?