Skip to content

[Bug] search_conversation tool totally disappeared (3rd time) #16706

Closed

Description

@Dhrhciebcy

Environment

Where are you using Unsloth?

  • Unsloth desktop application
  • Unsloth web UI (unsloth studio)
  • Unsloth CLI
  • Python package or notebook
  • Colab or Kaggle

Operating system and version:
Windows 11 24H2

GPU model(s) and accelerator backend:
NVIDIA CUDA — RTX 5090 Mobile

Versions:

  • Unsloth: v0.1.915-beta
  • Package: 2026.11.2
  • Desktop: 0.1.915-beta
  • llama.cpp: custom build (TheTom), commit 30d6881 — but in reality it is irrelevant

What happened?

Same identical issue of #16187 and #16602, the new update has probably solved nothing.

@danielhanchen @debojyoti-dev ok, we're probably facing a very stubborn problem. I don't know now if it's just me or if it's everyone's problem. I don't know if you could try it too, you don't necessarily need long chats, just limiting the maximum context window of an AI model to a smaller chat is enough. At this point, if there's anything I can do to help you solve this problem once and for all, I'd definitely be happy to help


The search_conversation tool has totally disappeared from the list of tools available to an AI model—both for models running via llama.cpp and those accessed via API. Consequently, once a chat is compacted, the AI ​​model no longer has any recollection of what happened previously, with no way now to retrieve that informations.

Steps to reproduce:

  1. Asking any question in a long chat—one that exceeds the AI ​​model's current context window
  2. The context will surely be compacted

Expected behavior:
As shown in the photo, the model would have firstly used the search_conversation tool and subsequently begun its reasoning process. Note how, in this example, it uses the tool even during the reasoning process, whenever it needs to retrieve information that probably is already in the chat

Image

Actual behavior:
The model is completely oblivious and hasn’t the faintest idea what is going on—especially if the chat history has been aggressively compacted.

API model:

Image

Local llama.cpp model:

Image

When the search_conversation tool was working I tried asking the model the exact same question, and it replied that it saw it among its available tools and had even used it in front of me. Both of these two screenshots were taken on the new version (v0.1.915-beta)


Model and operation involved:
Inference — Studio chat tab, auto-compaction (rolling context window) + per-thread archive retrieval.

  • Local: Qwen 3.8-27B-Q5_K_M + mmproj, via llama.cpp backend
  • Remote: Qwen 3.8 Flash Next-IQ3_S via Strata backend (OpenAI-compatible)
    Same behaviour on both paths, same on desktop app and web UI

Activity

  1. added
    feature request
    on Nov 4, 2026
  2. debojyoti-dev commented on Nov 5, 2026

    @debojyoti-dev
    Contributor

    Hi @Dhrhciebcy, thanks for the detailed report and screenshots. I'd like to work on this one.

    I think the common piece across #16187, #16602 and this issue is the conversation archive write, not the tool list. search_conversation is only offered once something has been archived for the chat, and archiving needs the embedding model to run. When that step fails, Studio still drops the old turns on compaction but saves nothing searchable, so the model gets no recalled turns and the tool never appears. I reproduced that on a local Studio build: with a working embedder the tool comes back from the turn after the first compaction, and with a failing one it never does and the model says it sees no earlier turns, as in your screenshots.

    My plan is to keep the dropped turns searchable by keywords when the embedding step can't run, so the tool and the automatic recall keep working, and to re-index them with embeddings once the embedder works again. If you can, a look in the Studio log for conversation_archive.ingest_failed or conversation_archive.embedder_pending lines would confirm it on your machine.

    cc @danielhanchen

  3. JNLLM commented on Nov 5, 2026

    @JNLLM

    Hi there. I'm experiencing the same woes that @Dhrhciebcy explains. The chat compaction is so extreme that the next 40k tokens are expended into "what I was doing??", and the poor model does what it can to return to the tracks. I don't think this is a good compaction method since I'm experimenting adding a rule to "write the steps that you will be following to {file}.md before proceeding" and feeding into the next response after compaction.

    About compaction I have noticed that "preserve_thinking" matters: Model thinks into the [output omitted: ... no context room left] zone. Then auto compaction follows. But "preserve_thinking" off discards thinking tokens. So the next response is still in "orange" context zone. The model keeps thinking into red context zone [output omitted: ... no context room left] again. Then compaction at last, and a lost model trying to keep its sanity again.

    Maybe we need some kind of thread to help the model to keep its focus? I know that "search_conversation" tool call should help, but I found that sometimes goes to a point into the past that it is not relevant in the recent context in very long chats. When I saw "bookmarks" the first thing I thouth was that "hey, a system for marking relevant context" but also I was wrong :D

    Of course I am not an expert. Maybe I am wrong in all of it.

    But as allways, thank you for yout work.

  4. Dhrhciebcy commented on Nov 5, 2026

    @Dhrhciebcy
    Author

    @debojyoti-dev you're absolutely right about the embedding model, I hadn't thought about that! I’ve just checked the logs, and I can confirm that an error related to the embedding model appeared during my yesterday tests:

    {"timestamp": "2026-11-04T22:43:38.351909Z", "level": "info", "event": "[llama-server] 1.05.161.649 W srv   operator (): got exception: {\"error\":{\"code\":400,\"message\":\"Unable to generate parser for this template. Automatic parser generation failed: \\n------------\\nWhile executing CallExpression at line 43, column 24 in source:\\n... not messages %}\u21b5    {{- raise_exception('No messages provided.') }}\u21b5{%- endif %...\\n                                           ^\\nError: Jinja Exception: No messages provided.\",\"type\":\"invalid_request_error\"}}"}
    {"timestamp": "2026-11-04T22:43:39.334503Z", "level": "info", "event": "request_completed", "method": "GET", "path": "/api/inference/monitor", "status_code": 200, "process_time_ms": 3.56}
    {"timestamp": "2026-11-04T22:43:42.383962Z", "level": "info", "event": "request_completed", "method": "GET", "path": "/api/liveness", "status_code": 200, "process_time_ms": 0.79}
    llama-server embedder exited early (code 1)
    conversation_archive.ingest_failed thread_id=ac191141-20ad-4191-aca8-71b3c5f275cd
    Traceback (most recent call last):
      File "C:\Users\Andryx\.unsloth\studio\unsloth_studio\Lib\site-packages\studio\backend\core\rag\conversation_archive.py", line 866, in _archive_turns
        chunk_limit = embeddings.chunk_tokens(model)
      File "C:\Users\Andryx\.unsloth\studio\unsloth_studio\Lib\site-packages\studio\backend\core\rag\embeddings.py", line 1493, in chunk_tokens
        limit = max_tokens(model_name)
      File "C:\Users\Andryx\.unsloth\studio\unsloth_studio\Lib\site-packages\studio\backend\core\rag\embeddings.py", line 1475, in max_tokens
        return _get_backend(model_name).max_tokens(model_name = model_name)
               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
      File "C:\Users\Andryx\.unsloth\studio\unsloth_studio\Lib\site-packages\studio\backend\core\rag\embed_llama_server.py", line 1220, in max_tokens
        self._ensure_ready(model_name)
        ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
      File "C:\Users\Andryx\.unsloth\studio\unsloth_studio\Lib\site-packages\studio\backend\core\rag\embed_llama_server.py", line 990, in _ensure_ready
        self._spawn(model_name)
        ~~~~~~~~~~~^^^^^^^^^^^^
      File "C:\Users\Andryx\.unsloth\studio\unsloth_studio\Lib\site-packages\studio\backend\utils\gpu_memory_events.py", line 35, in wrapper
        return fn(*args, **kwargs)
      File "C:\Users\Andryx\.unsloth\studio\unsloth_studio\Lib\site-packages\studio\backend\core\rag\embed_llama_server.py", line 824, in _spawn
        self._spawn_once(use_gpu, model_name)
        ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^
      File "C:\Users\Andryx\.unsloth\studio\unsloth_studio\Lib\site-packages\studio\backend\core\rag\embed_llama_server.py", line 917, in _spawn_once
        raise RuntimeError(
            f"llama-server embedder failed to become healthy. Last output:\n{tail[:2000]}"
        )
    RuntimeError: llama-server embedder failed to become healthy. Last output:
    0.00.028.232 I log_info: verbosity = 3 (adjust with the `-lv N` CLI arg)
    0.00.028.235 I device_info:
    0.00.136.683 I   - CUDA0   : NVIDIA GeForce RTX 5090 Laptop GPU (24462 MiB, 21970 MiB free)
    0.00.136.706 I   - CPU     : Intel(R) Core(TM) Ultra 9 275HX (65210 MiB, 31452 MiB free)
    0.00.136.802 I system_info: n_threads = 24 (n_threads_batch = 24) / 24 | CUDA : ARCHS = 500,610,700,750,800,860,890,900 | USE_GRAPHS = 1 | PEER_MAX_BATCH_SIZE = 128 | FA_ALL_QUANTS = 1 | CPU : SSE3 = 1 | SSSE3 = 1 | AVX = 1 | AVX2 = 1 | F16C = 1 | FMA = 1 | BMI2 = 1 | LLAMAFILE = 1 | OPENMP = 1 | REPACK = 1 |
    0.00.136.809 W srv  llama_server: embeddings enabled with n_batch (2048) > n_ubatch (512)
    0.00.136.810 W srv  llama_server: setting n_batch = n_ubatch = 512 to avoid assertion failure
    0.00.136.811 I srv  llama_server: n_parallel is set to auto, using n_parallel = 4 and kv_unified = true
    0.00.136.869 I srv          init: running without SSL
    0.00.136.901 I srv          init: api_keys: ****Hh58
    0.00.136.971 I srv          init: using 23 threads for HTTP server
    0.00.137.358 I srv         start: binding port with default address family
    0.00.142.332 I srv  llama_server: loading model
    0.00.142.356 I srv    load_model: loading model 'C:\Users\Andryx\.cache\huggingface\hub\models--unsloth--embeddinggemma-2-GGUF\snapshots\031f0d4b35536f69ab3509d4893c923264fcf253\embeddinggemma-2-F16.gguf'
    0.00.432.028 E llama_model_load: error loading model: unknown model architecture: 'gemma-embedding2'
    0.00.432.035 E llama_model_load_from_file_impl: failed to load model
    0.00.432.037 E common_init_from_params: failed to load model 'C:\Users\Andryx\.cache\huggingface\hub\models--unsloth--embeddinggemma-2-GGUF\snapshots\031f0d4b35536f69ab3509d4893c923264fcf253\embeddinggemma-2-F16.gguf'
    0.00.432.042 E srv    load_model: failed to load model, 'C:\Users\Andryx\.cache\huggingface\hub\models--unsloth--embeddinggemma-2-GGUF\snapshots\031f0d4b35536f69ab3509d4893c923264fcf253\embeddinggemma-2-F16.gguf'
    0.00.432.046 I s
    {"timestamp": "2026-11-04T22:43:49.372527Z", "level": "info", "event": "request_completed", "method": "GET", "path": "/api/inference/monitor", "status_code": 200, "process_time_ms": 4.53}
    llama-server embedder exited early (code 1)
    conversation_archive.dense_unavailable thread_id=ac191141-20ad-4191-aca8-71b3c5f275cd
    Traceback (most recent call last):
      File "C:\Users\Andryx\.unsloth\studio\unsloth_studio\Lib\site-packages\studio\backend\core\rag\conversation_archive.py", line 2454, in _candidates
        for hit in retrieval.retrieve_hybrid(
                   ~~~~~~~~~~~~~~~~~~~~~~~~~^
            conn,
            ^^^^^
        ...<6 lines>...
            dense_k = legs,
            ^^^^^^^^^^^^^^^
        ):
        ^
      File "C:\Users\Andryx\.unsloth\studio\unsloth_studio\Lib\site-packages\studio\backend\core\rag\retrieval.py", line 173, in retrieve_hybrid
        dense = retrieve_dense(conn, scope, query, dense_k or config.TOP_K_DENSE, model_name = model_name)
      File "C:\Users\Andryx\.unsloth\studio\unsloth_studio\Lib\site-packages\studio\backend\core\rag\retrieval.py", line 86, in retrieve_dense
        vectors, identity = embeddings.encode_with_identity(
                            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
            [query], model_name = effective, normalize = True
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        )
        ^
      File "C:\Users\Andryx\.unsloth\studio\unsloth_studio\Lib\site-packages\studio\backend\core\rag\embeddings.py", line 1429, in encode_with_identity
        vectors = encode(texts, model_name = model_name, normalize = normalize)
      File "C:\Users\Andryx\.unsloth\studio\unsloth_studio\Lib\site-packages\studio\backend\core\rag\embeddings.py", line 1454, in encode
        vectors = backend.encode(texts, model_name = model_name, normalize = normalize)
      File "C:\Users\Andryx\.unsloth\studio\unsloth_studio\Lib\site-packages\studio\backend\core\rag\embed_llama_server.py", line 1126, in encode
        vectors = self._encode_active(texts, normalize = normalize, model_name = model_name)
      File "C:\Users\Andryx\.unsloth\studio\unsloth_studio\Lib\site-packages\studio\backend\core\rag\embed_llama_server.py", line 1148, in _encode_active
        data = self._post(
            "/v1/embeddings",
            {"input": chunk, "model": "embedding", "encoding_format": "float"},
            model_name = model_name,
        )
      File "C:\Users\Andryx\.unsloth\studio\unsloth_studio\Lib\site-packages\studio\backend\core\rag\embed_llama_server.py", line 1052, in _post
        return self._post_active(path, payload, model_name)
               ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "C:\Users\Andryx\.unsloth\studio\unsloth_studio\Lib\site-packages\studio\backend\core\rag\embed_llama_server.py", line 1064, in _post_active
        self._ensure_ready(model_name)
        ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
      File "C:\Users\Andryx\.unsloth\studio\unsloth_studio\Lib\site-packages\studio\backend\core\rag\embed_llama_server.py", line 990, in _ensure_ready
        self._spawn(model_name)
        ~~~~~~~~~~~^^^^^^^^^^^^
      File "C:\Users\Andryx\.unsloth\studio\unsloth_studio\Lib\site-packages\studio\backend\utils\gpu_memory_events.py", line 35, in wrapper
        return fn(*args, **kwargs)
      File "C:\Users\Andryx\.unsloth\studio\unsloth_studio\Lib\site-packages\studio\backend\core\rag\embed_llama_server.py", line 824, in _spawn
        self._spawn_once(use_gpu, model_name)
        ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^
      File "C:\Users\Andryx\.unsloth\studio\unsloth_studio\Lib\site-packages\studio\backend\core\rag\embed_llama_server.py", line 917, in _spawn_once
        raise RuntimeError(
            f"llama-server embedder failed to become healthy. Last output:\n{tail[:2000]}"
        )
    RuntimeError: llama-server embedder failed to become healthy. Last output:
    0.00.023.239 I log_info: verbosity = 3 (adjust with the `-lv N` CLI arg)
    0.00.023.243 I device_info:
    0.00.107.788 I   - CUDA0   : NVIDIA GeForce RTX 5090 Laptop GPU (24462 MiB, 21970 MiB free)
    0.00.107.797 I   - CPU     : Intel(R) Core(TM) Ultra 9 275HX (65210 MiB, 31374 MiB free)
    0.00.107.847 I system_info: n_threads = 24 (n_threads_batch = 24) / 24 | CUDA : ARCHS = 500,610,700,750,800,860,890,900 | USE_GRAPHS = 1 | PEER_MAX_BATCH_SIZE = 128 | FA_ALL_QUANTS = 1 | CPU : SSE3 = 1 | SSSE3 = 1 | AVX = 1 | AVX2 = 1 | F16C = 1 | FMA = 1 | BMI2 = 1 | LLAMAFILE = 1 | OPENMP = 1 | REPACK = 1 |
    0.00.107.850 W srv  llama_server: embeddings enabled with n_batch (2048) > n_ubatch (512)
    0.00.107.850 W srv  llama_server: setting n_batch = n_ubatch = 512 to avoid assertion failure
    0.00.107.851 I srv  llama_server: n_parallel is set to auto, using n_parallel = 4 and kv_unified = true
    0.00.107.881 I srv          init: running without SSL
    0.00.107.895 I srv          init: api_keys: ****B_bQ
    0.00.107.927 I srv          init: using 23 threads for HTTP server
    0.00.108.094 I srv         start: binding port with default address family
    0.00.120.754 I srv  llama_server: loading model
    0.00.120.779 I srv    load_model: loading model 'C:\Users\Andryx\.cache\huggingface\hub\models--unsloth--embeddinggemma-2-GGUF\snapshots\031f0d4b35536f69ab3509d4893c923264fcf253\embeddinggemma-2-F16.gguf'
    0.00.441.733 E llama_model_load: error loading model: unknown model architecture: 'gemma-embedding2'
    0.00.441.757 E llama_model_load_from_file_impl: failed to load model
    0.00.441.759 E common_init_from_params: failed to load model 'C:\Users\Andryx\.cache\huggingface\hub\models--unsloth--embeddinggemma-2-GGUF\snapshots\031f0d4b35536f69ab3509d4893c923264fcf253\embeddinggemma-2-F16.gguf'
    0.00.441.764 E srv    load_model: failed to load model, 'C:\Users\Andryx\.cache\huggingface\hub\models--unsloth--embeddinggemma-2-GGUF\snapshots\031f0d4b35536f69ab3509d4893c923264fcf253\embeddinggemma-2-F16.gguf'
    0.00.441.767 I s
    {"timestamp": "2026-11-04T22:43:59.416467Z", "level": "info", "event": "request_completed", "method": "GET", "path": "/api/inference/monitor", "status_code": 200, "process_time_ms": 3.65}
    

    But I also figured out the reason for this: the version of llama.cpp I was using was an older one that didn't support embeddinggemma 2. So, this morning I immediately switched the version of llama.cpp to the one built into Unsloth Studio.
    The result is rather "strange": the model via the API still doesn't see the search_conversation tool, whereas this time, the model loaded using llama.cpp detected it and used it right away (see the screenshot below, it replied to me in Italian but never mind ahahah):

    Image

    The strange thing, however, concerns an experiment I decided to conduct afterward: in Unsloth Studio, I reverted to the older version of llama.cpp and tried to regenerate the model's response; to my surprise, the search_conversation tool was still there (see the screenshot below):

    Image

    Below is the log:

    {"timestamp": "2026-11-05T11:24:15.846040Z", "level": "info", "event": "request_completed", "method": "GET", "path": "/api/inference/monitor", "status_code": 200, "process_time_ms": 4.85}
    llama-server embedder exited early (code 1)
    {"timestamp": "2026-11-05T11:24:16.438959Z", "level": "info", "event": "[llama-server] 3.03.196.164 W srv   operator (): got exception: {\"error\":{\"code\":500,\"message\":\"\\n------------\\nWhile executing CallExpression at line 43, column 24 in source:\\n... not messages %}\u21b5    {{- raise_exception('No messages provided.') }}\u21b5{%- endif %...\\n                                           ^\\nError: Jinja Exception: No messages provided.\",\"type\":\"server_error\"}}"}
    llama-server embedder exited early (code 1)
    conversation_archive.ingest_failed thread_id=ac191141-20ad-4191-aca8-71b3c5f275cd
    Traceback (most recent call last):
      File "C:\Users\Andryx\.unsloth\studio\unsloth_studio\Lib\site-packages\studio\backend\core\rag\conversation_archive.py", line 866, in _archive_turns
        chunk_limit = embeddings.chunk_tokens(model)
      File "C:\Users\Andryx\.unsloth\studio\unsloth_studio\Lib\site-packages\studio\backend\core\rag\embeddings.py", line 1493, in chunk_tokens
        limit = max_tokens(model_name)
      File "C:\Users\Andryx\.unsloth\studio\unsloth_studio\Lib\site-packages\studio\backend\core\rag\embeddings.py", line 1475, in max_tokens
        return _get_backend(model_name).max_tokens(model_name = model_name)
               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
      File "C:\Users\Andryx\.unsloth\studio\unsloth_studio\Lib\site-packages\studio\backend\core\rag\embed_llama_server.py", line 1220, in max_tokens
        self._ensure_ready(model_name)
        ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
      File "C:\Users\Andryx\.unsloth\studio\unsloth_studio\Lib\site-packages\studio\backend\core\rag\embed_llama_server.py", line 990, in _ensure_ready
        self._spawn(model_name)
        ~~~~~~~~~~~^^^^^^^^^^^^
      File "C:\Users\Andryx\.unsloth\studio\unsloth_studio\Lib\site-packages\studio\backend\utils\gpu_memory_events.py", line 35, in wrapper
        return fn(*args, **kwargs)
      File "C:\Users\Andryx\.unsloth\studio\unsloth_studio\Lib\site-packages\studio\backend\core\rag\embed_llama_server.py", line 824, in _spawn
        self._spawn_once(use_gpu, model_name)
        ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^
      File "C:\Users\Andryx\.unsloth\studio\unsloth_studio\Lib\site-packages\studio\backend\core\rag\embed_llama_server.py", line 917, in _spawn_once
        raise RuntimeError(
            f"llama-server embedder failed to become healthy. Last output:\n{tail[:2000]}"
        )
    RuntimeError: llama-server embedder failed to become healthy
    

    As you can see, the embedding model failed again, as it did last night, but despite everything, the search_conversation tool was detected and used correctly (again from the model via llama.cpp). I don't know if I'm stating the obvious (most likely), but I wanted to point it out anyway.
    A few honest notes: while doing this experiment, I neither reloaded the entire model nor restarted Unsloth Studio.


    In all of this, if I may express an opinion, I would have noticed this problem with the embedding model much earlier if Unsloth Studio had flagged the error, for example with a pop-up notification.
    Therefore, @debojyoti-dev I would suggest, in addition to your change, possibly also adding this feature, an error notification to the user from Unsloth Studio in case there are problems with the embed model, which could therefore also affect the correct functionality of the search_conversation tool.

    I would always thank @JNLLM for his support to the various issues I'm reporting, as well as you developers of course, who are quick to step in and always come to my aid

  5. self-assigned this
    on Nov 6, 2026
  6. danielhanchen commented on Nov 7, 2026

    @danielhanchen
    Member

    Fixed! When the embedding model could not start (here an older custom llama.cpp that cannot load embeddinggemma-2), compaction dropped the old turns without saving a searchable copy, so the chat had no archive and search_conversation was never offered. Fixed in #16718: those turns are now kept for keyword search, so the tool and recall keep working, and they are re-embedded automatically once the embedder runs again. Thanks @debojyoti-dev for the fix and @Dhrhciebcy for the logs that pinned it down.
    To update: Unsloth Desktop will have an update banner. For Studio, use unsloth studio update. For Docker, use docker exec <container> unsloth-studio-update. Reopen if it still happens.

  7. added a commit that references this issue on Nov 7, 2026
    91935a1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugfeature request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions