embed_text
Embed text into a 768-dim vector for HyDE-style retrieval or direct query search. Choose RETRIEVAL_DOCUMENT for hypothetical papers or RETRIEVAL_QUERY for user queries.
Instructions
Embed a text string into a 768-dim Gemini Flash vector. Use for HyDE-style retrieval: (1) write a hypothetical short paper that would perfectly answer the user's query, (2) embed it with task_type='RETRIEVAL_DOCUMENT' (default — matches the corpus embedding side), (3) pass the resulting embedding back through search-style tools to find real papers nearest to the hypothetical. task_type='RETRIEVAL_QUERY' matches the query side and is useful for direct user-query embedding without HyDE. Pro-only — requires an SF_API_KEY on a Pro account; anonymous and free callers get a 403 pro_required. Cost: ~$0.0001/call; rate-limited at 30/minute per API key.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | Text to embed (1-8000 chars). For HyDE flows this is your hypothetical answer/abstract. | |
| task_type | No | RETRIEVAL_DOCUMENT (default) matches paper-side embeddings — use for HyDE. RETRIEVAL_QUERY matches query-side semantic search. | RETRIEVAL_DOCUMENT |