OpenAI Embeddings
OpenAI Embeddings turns text into a numeric fingerprint of its meaning using OpenAI models. With that fingerprint, NappAI can find the documents that say something similar to what you are looking for, even when they use different words, for example in a knowledge base.
You connect the component to a vector database, which uses it both to store your documents and to search them. Use it if your company works with OpenAI.
When to use it
- Give an agent the knowledge in your manuals, contracts or FAQs by storing them in a vector database.
- Build an internal search that finds documents by their meaning, not only by exact words.
- You already use OpenAI as your AI model and want to use the same account.
Configuration
| Field | What it does |
|---|---|
| Credential (required) | The credential of the service OpenAI API. Pick one with Choose an option or create one with Add new credential. See Credentials. |
| Model | The OpenAI model that calculates the fingerprints: text-embedding-3-small, text-embedding-3-large or text-embedding-ada-002. Default: text-embedding-3-small. |
Advanced options
| Field | What it does |
|---|---|
| Dimensions | The size of the fingerprint, as a count of numbers. Only some models support it. Empty, the model’s own size is used. |
| Chunk Size | How many texts are sent to OpenAI in each request. Default: 1000. |
| Max Retries | How many times a failed request is retried. Default: 3. |
| Request Timeout | Maximum waiting time for each request, in seconds. Empty, OpenAI’s own is used. |
| OpenAI API Base | The address of an OpenAI-compatible service, if you do not use OpenAI’s. It must start with http. Empty, OpenAI is used. |
| OpenAI Organization | The organisation in your OpenAI account the requests are charged to, if you have several. |
| Skip Empty | When on, empty texts are skipped instead of being sent. Default: off. |
The other advanced options (Default Headers, Default Query, Client, Deployment, Embedding Context Length, Model Kwargs, OpenAI API Type, OpenAI API Version, OpenAI Proxy, Show Progress Bar, TikToken Model Name and TikToken Enable) are for special connections. Leave them as they are unless the person who manages your service tells you otherwise.
Output
- Embeddings: the model that calculates the fingerprints, ready to use. Connect it to the Embedding input of a vector database: Astra DB, Cassandra, Chroma DB, Couchbase, Elasticsearch, FAISS, Milvus, MongoDB Vector Store, PGVector, Pinecone, Qdrant, Redis, Supabase Vector Store, Upstash, Vectara, Weaviate Cloud (v4). Other components with an input of this type accept it too, such as Semantic Text Splitter or Text Embedder.
Example
An administrative agency, Gestoría Montes, wants its assistant to answer using its guide to procedures.
- In a loading flow, split the documents into chunks with Recursive Character Text Splitter and pass them to Chroma DB with Operation set to
Add. - Add OpenAI Embeddings and connect its Embeddings output to the Embedding input of Chroma DB.
- In the assistant flow, use the same Chroma DB collection with the same OpenAI Embeddings component to find the chunks that answer each question.