Jina AI
Jina AI provides embedding models for semantic search and related retrieval tasks. seekdb provides JinaEmbeddingFunction so you can generate Jina embeddings and use them with seekdb collections.
tip
Using Jina AI service requires you to follow Jina AI's pricing rules and may incur corresponding fees. Before proceeding, please visit their official website or refer to relevant documentation to confirm and accept their pricing standards. If you do not agree, please do not proceed.
Dependencies and authentication
- Have a Jina API key with access to the embedding models you plan to use.
- You can pass the key in code or set it in an environment variable (default:
JINA_API_KEY). UseapiKeyEnvVarif you use a different variable name.
Installation
npm i seekdb @seekdb/jina
Example: create a Jina embedding function
import { JinaEmbeddingFunction } from "@seekdb/jina";
const ef = new JinaEmbeddingFunction({
modelName: "jina-clip-v2",
// apiKeyEnvVar: "JINA_API_KEY",
});
Configurations:
- apiKey: Jina API key (optional; if omitted, read from the environment).
- apiKeyEnvVar: Environment variable name for the API key (default:
"JINA_API_KEY"). - modelName: Embedding model name (default:
"jina-clip-v2").