Skip to content
曾亮懿 ZengLiangYi Blog

Configuring Embeddings: Model Selection and Rebuilding

Check task support, actual embedding inputs, and index compatibility, then accept model settings and changes with known notes and no-answer queries.

曾亮懿

曾亮懿

3 min read
Table of contents Show Hide

Vector dimensions alone do not determine retrieval quality. An unchanged model name alone does not establish compatibility between stored vectors and new queries. Check the task, actual input, and test samples before configuring the model and inspecting index status.

This article follows ChatCrystal at 7642768. It provides no unmeasured ratings, price table, or claim that a particular dimension count is necessarily sufficient.

Check task support and operating boundaries

The provider registry supplies embedding factories for Ollama, OpenAI, Google, Azure, and Custom; Anthropic and OrcaRouter entries lack that path. A factory still requires an available embedding model, not an arbitrary generation model name.

The local default example is nomic-embed-text. See the official OpenAI embedding guide for the OpenAI service’s request shape. Compare target languages, technical terms, input lengths, response stability, data destinations, and resource usage. Recheck prices and availability at use time; local or cloud labels do not establish accuracy or cost.

Understand the text actually submitted

The embedding service combines titles, summaries, conclusions, tags, and code descriptions. Manual notes and Agent writebacks can additionally include code evidence, root causes, resolutions, error signatures, and files. It is inaccurate to say all sources always exclude code bodies.

The code uses 500 characters as a paragraph-grouping target, not a strict maximum per chunk. One long paragraph is not forcibly split into 500-character blocks here. Characters also differ from tokens; check actual model limits. Field concatenation order does not establish quantitatively weighted fields.

Start with settings you can inspect

This local example uses the default connection. If vectors or active tasks already exist, read confirmation prompts before proceeding:

crystal config set embedding.provider ollama
crystal config set embedding.baseURL http://localhost:11434
crystal config set embedding.model nomic-embed-text
crystal config get
crystal config test

The model must be downloaded and the service reachable. The Ollama adapter appends /v1, so use the root address here. Environment variables supply defaults that saved settings can override. Inspect actual values and the embedding test result.

Distinguish clearing from generation when switching

The configuration route requests confirmation for some changes. Confirmed provider or model changes clear vectors and the index and mark notes pending; they do not automatically enqueue rebuilding. Back up and verify the new configuration, then submit:

curl --request POST http://localhost:3721/api/embeddings/batch
curl http://localhost:3721/api/queue/status

The batch endpoint selects only pending, failed, and syncing notes and skips those with active tasks. queued counts submissions, not successes. An empty queue does not replace note-status checks. See model separation and rebuilding acceptance for detail and status commands.

Deleting only vectra-index does not mark done notes for processing, so a subsequent batch request can enqueue zero notes. Endpoint, same-name model revision, or input-strategy changes also do not necessarily trigger the configuration route’s clearing condition. For one note, the notes route offers a synchronous regeneration entry; replace the actual note ID:

POST http://localhost:3721/api/notes/<note-id>/embed

This regenerates vectors, not note bodies. Check tasks and backups before production-data operations and account for every affected note.

Accept the result with your questions

Prepare known-answer, paraphrase, exact error-name, and no-answer queries. Record target-note inclusion, ranking, false matches, and response failures. After note status becomes done, inspect retrieved content and applicability conditions.

More dimensions can increase storage and computation without establishing better accuracy. Comparing the same notes and queries explains whether the configuration suits this library. See the semantic search workflow for requests and scoring boundaries, and the Ollama workflow for local-service acceptance.

Share:

Related Posts

Evaluate embedding retrieval with fixed notes and labeled queries

Compare local and cloud embeddings with labeled queries and separate indexes, checking rebuild completion, retrieval quality, and resource costs.

曾亮懿 曾亮懿
3 min read
#ChatCrystal #Embedding #Evaluation

LLMs and embeddings: separate tasks, even with one provider

Distinguish text generation from vector generation, then verify ChatCrystal model settings, connection tests, and index rebuilding boundaries.

曾亮懿 曾亮懿
4 min read
#ChatCrystal #AI #Vector search

Choosing a Local Vector Store: Vectra, Chroma, and hnswlib

Compare Vectra, Chroma, and hnswlib through ChatCrystal’s deployment constraints: integration, retrieval cost, backups, and recovery boundaries.

曾亮懿 曾亮懿
6 min read
#ChatCrystal #TypeScript #Vector search #Architecture

From writing to code

Explore ChatCrystal, developer tools and daily learning notes on my GitHub. Questions about the implementation are welcome.