Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSON parser errors when retrieving C++ code from archival memory. #729

Closed
3 tasks
jimlloyd opened this issue Dec 28, 2023 · 6 comments
Closed
3 tasks

JSON parser errors when retrieving C++ code from archival memory. #729

jimlloyd opened this issue Dec 28, 2023 · 6 comments

Comments

@jimlloyd
Copy link
Contributor

Describe the bug
I have loaded some C++ source code using memgpt load directory .... So far I am loading just one component directory that has just a few source files so that I can experiment and work through issues. The first issue is that the JSON parser has difficulty parsing the response after searching archival memory. My hypothesis is that the code contains character sequences that are not properly encoded/escaped which causes the stringified JSON to be malformed.

I will attach a larger capture from the session, but the initial part of the error message is:

> Enter your message: Search your archival memory for any references to WaitingForAction, which is a C++ class template (a.k.a template class). Please summarize what you know about WaitingForAct
ion. 
An exception ocurred when running agent.step(): 
Traceback (most recent call last):
  File "/Users/jim.lloyd/.pyenv/versions/memgpt/lib/python3.11/site-packages/memgpt/local_llm/json_parser.py", line 154, in clean_json
    data = json.loads(raw_llm_output)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jim.lloyd/.pyenv/versions/3.11.6/lib/python3.11/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jim.lloyd/.pyenv/versions/3.11.6/lib/python3.11/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jim.lloyd/.pyenv/versions/3.11.6/lib/python3.11/json/decoder.py", line 353, in raw_decode
    obj, end = self.scan_once(s, idx)
               ^^^^^^^^^^^^^^^^^^^^^^
json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 6 column 33 (char 144)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/jim.lloyd/.pyenv/versions/memgpt/lib/python3.11/site-packages/memgpt/local_llm/json_parser.py", line 158, in clean_json
    data = json.loads(raw_llm_output + "}")
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jim.lloyd/.pyenv/versions/3.11.6/lib/python3.11/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jim.lloyd/.pyenv/versions/3.11.6/lib/python3.11/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jim.lloyd/.pyenv/versions/3.11.6/lib/python3.11/json/decoder.py", line 353, in raw_decode
    obj, end = self.scan_once(s, idx)
               ^^^^^^^^^^^^^^^^^^^^^^
json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 6 column 33 (char 144)

During handling of the above exception, another exception occurred:
...

Please describe your setup

  • MemGPT version
    • What is the output of memgpt version? (eg "0.2.4")

I am using pymemgpt-nightly from the night of Dec 27th/28th. memgpt version doesn't reflect this -- perhaps you can add some suffix to the semver string?

jim.lloyd@jimsm2 memgpt % memgpt version
0.2.10
  • How did you install memgpt?
    Basically I did: pip install pymemgpt-nightly
    However this was after a pip uninstall pymemgpt and before that I had done pip install pymemgpt followed by pip install pymemgpt[local].

  • Describe your setup

    • What's your OS (Windows/MacOS/Linux)?
      Apple Powerbook M2 64Gb ram running Sonoma 14.2.

    • How are you running memgpt? (cmd.exe/Powershell/Anaconda Shell/Terminal)
      Terminal session inside VS Code.

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
I created the data source using this command:

memgpt load directory --recursive --name test_action_state_machine --input-dir ~/{project}/cpp/eta/action_state_machine

I then ran memgpt and did a /attach and selected test_action_state_machine.

If you're not using OpenAI, please provide additional information on your local LLM setup:

Local LLM details

Everything running locally:

  • llama.cpp
./server -m models/openhermes-2.5-mistral-7b-16k.Q8_0.gguf -c 16384
  • text-embeddings-router
model=BAAI/bge-large-en-v1.5
revision=refs/pr/5
text-embeddings-router --model-id $model --revision $revision --port 3000
@jimlloyd
Copy link
Contributor Author

> Enter your message: You are an expert with the programming language C++. You will be my C++ programming assistant. Your archival memory contains some C++ code now and I want your help to 1) un
derstand that code better, and 2) be able to make enhancments to the code. Please summarize this new instructions and update your core memory.
💭 Locating the user's request in conversation history.
💭 Searching for C++ keywords in archival memory.
⚡🧠 [function] updating memory with archival_memory_search
💭 Updating core memory with the user's request and archival search results.
⚡🧠 [function] updating memory with core_memory_append
> Enter your message: Search your archival memory for any references to WaitingForAction, which is a C++ class template (a.k.a template class). Please summarize what you know about WaitingForAct
ion. 
An exception ocurred when running agent.step(): 
Traceback (most recent call last):
  File "/Users/jim.lloyd/.pyenv/versions/memgpt/lib/python3.11/site-packages/memgpt/local_llm/json_parser.py", line 154, in clean_json
    data = json.loads(raw_llm_output)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jim.lloyd/.pyenv/versions/3.11.6/lib/python3.11/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jim.lloyd/.pyenv/versions/3.11.6/lib/python3.11/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jim.lloyd/.pyenv/versions/3.11.6/lib/python3.11/json/decoder.py", line 353, in raw_decode
    obj, end = self.scan_once(s, idx)
               ^^^^^^^^^^^^^^^^^^^^^^
json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 6 column 33 (char 144)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/jim.lloyd/.pyenv/versions/memgpt/lib/python3.11/site-packages/memgpt/local_llm/json_parser.py", line 158, in clean_json
    data = json.loads(raw_llm_output + "}")
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jim.lloyd/.pyenv/versions/3.11.6/lib/python3.11/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jim.lloyd/.pyenv/versions/3.11.6/lib/python3.11/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jim.lloyd/.pyenv/versions/3.11.6/lib/python3.11/json/decoder.py", line 353, in raw_decode
    obj, end = self.scan_once(s, idx)
               ^^^^^^^^^^^^^^^^^^^^^^
json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 6 column 33 (char 144)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/jim.lloyd/.pyenv/versions/memgpt/lib/python3.11/site-packages/memgpt/local_llm/json_parser.py", line 162, in clean_json
    data = json.loads(raw_llm_output + "}}")
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jim.lloyd/.pyenv/versions/3.11.6/lib/python3.11/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jim.lloyd/.pyenv/versions/3.11.6/lib/python3.11/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jim.lloyd/.pyenv/versions/3.11.6/lib/python3.11/json/decoder.py", line 353, in raw_decode
    obj, end = self.scan_once(s, idx)
               ^^^^^^^^^^^^^^^^^^^^^^
json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 6 column 33 (char 144)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/jim.lloyd/.pyenv/versions/memgpt/lib/python3.11/site-packages/memgpt/local_llm/json_parser.py", line 166, in clean_json
    data = json.loads(raw_llm_output + '"}}')
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jim.lloyd/.pyenv/versions/3.11.6/lib/python3.11/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jim.lloyd/.pyenv/versions/3.11.6/lib/python3.11/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jim.lloyd/.pyenv/versions/3.11.6/lib/python3.11/json/decoder.py", line 353, in raw_decode
    obj, end = self.scan_once(s, idx)
               ^^^^^^^^^^^^^^^^^^^^^^
json.decoder.JSONDecodeError: Unterminated string starting at: line 6 column 33 (char 144)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/jim.lloyd/.pyenv/versions/memgpt/lib/python3.11/site-packages/memgpt/local_llm/json_parser.py", line 171, in clean_json
    data = json.loads(repaired)
           ^^^^^^^^^^^^^^^^^^^^
  File "/Users/jim.lloyd/.pyenv/versions/3.11.6/lib/python3.11/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jim.lloyd/.pyenv/versions/3.11.6/lib/python3.11/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jim.lloyd/.pyenv/versions/3.11.6/lib/python3.11/json/decoder.py", line 353, in raw_decode
    obj, end = self.scan_once(s, idx)
               ^^^^^^^^^^^^^^^^^^^^^^
json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 6 column 33 (char 144)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/jim.lloyd/.pyenv/versions/memgpt/lib/python3.11/site-packages/memgpt/local_llm/json_parser.py", line 176, in clean_json
    data = json.loads(repaired)
           ^^^^^^^^^^^^^^^^^^^^
  File "/Users/jim.lloyd/.pyenv/versions/3.11.6/lib/python3.11/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jim.lloyd/.pyenv/versions/3.11.6/lib/python3.11/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jim.lloyd/.pyenv/versions/3.11.6/lib/python3.11/json/decoder.py", line 353, in raw_decode
    obj, end = self.scan_once(s, idx)
               ^^^^^^^^^^^^^^^^^^^^^^
json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 6 column 33 (char 144)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/jim.lloyd/.pyenv/versions/memgpt/lib/python3.11/site-packages/memgpt/local_llm/json_parser.py", line 23, in extract_first_json
    return json.loads(string[start_index : i + 1])
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jim.lloyd/.pyenv/versions/3.11.6/lib/python3.11/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jim.lloyd/.pyenv/versions/3.11.6/lib/python3.11/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jim.lloyd/.pyenv/versions/3.11.6/lib/python3.11/json/decoder.py", line 353, in raw_decode
    obj, end = self.scan_once(s, idx)
               ^^^^^^^^^^^^^^^^^^^^^^
json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 5 column 33 (char 143)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/jim.lloyd/.pyenv/versions/memgpt/lib/python3.11/site-packages/memgpt/local_llm/json_parser.py", line 180, in clean_json
    data = extract_first_json(raw_llm_output + "}}")
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jim.lloyd/.pyenv/versions/memgpt/lib/python3.11/site-packages/memgpt/local_llm/json_parser.py", line 25, in extract_first_json
    raise LLMJSONParsingError(f"Matched closing bracket, but decode failed with error: {str(e)}")
memgpt.errors.LLMJSONParsingError: Matched closing bracket, but decode failed with error: Expecting property name enclosed in double quotes: line 5 column 33 (char 143)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/jim.lloyd/.pyenv/versions/memgpt/lib/python3.11/site-packages/memgpt/local_llm/json_parser.py", line 184, in clean_json
    data = clean_and_interpret_send_message_json(raw_llm_output)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jim.lloyd/.pyenv/versions/memgpt/lib/python3.11/site-packages/memgpt/local_llm/json_parser.py", line 70, in clean_and_interpret_send_message_json
    raise LLMJSONParsingError(f"Couldn't manually extract send_message pattern from:\n{json_string}")
memgpt.errors.LLMJSONParsingError: Couldn't manually extract send_message pattern from:

{
  "function": "archival_memory_search",
  "params": {
    "inner_thoughts": "Looking for WaitingForAction.",
    "query": "WaitingForAction",

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/jim.lloyd/.pyenv/versions/memgpt/lib/python3.11/site-packages/memgpt/local_llm/llm_chat_completion_wrappers/chatml.py", line 279, in output_to_chat_completion_response
    function_json_output = clean_json(raw_llm_output)
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jim.lloyd/.pyenv/versions/memgpt/lib/python3.11/site-packages/memgpt/local_llm/json_parser.py", line 186, in clean_json
    raise LLMJSONParsingError(
memgpt.errors.LLMJSONParsingError: Failed to decode valid MemGPT JSON from LLM output:
=====

{
  "function": "archival_memory_search",
  "params": {
    "inner_thoughts": "Looking for WaitingForAction.",
    "query": "WaitingForAction",
=====

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/jim.lloyd/.pyenv/versions/memgpt/lib/python3.11/site-packages/memgpt/local_llm/chat_completion_proxy.py", line 126, in get_chat_completion
    chat_completion_result = llm_wrapper.output_to_chat_completion_response(result, first_message=first_message)
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jim.lloyd/.pyenv/versions/memgpt/lib/python3.11/site-packages/memgpt/local_llm/llm_chat_completion_wrappers/chatml.py", line 281, in output_to_chat_completion_response
    raise Exception(f"Failed to decode JSON from LLM output:\n{raw_llm_output} - error\n{str(e)}")
Exception: Failed to decode JSON from LLM output:

{
  "function": "archival_memory_search",
  "params": {
    "inner_thoughts": "Looking for WaitingForAction.",
    "query": "WaitingForAction", - error
Failed to decode valid MemGPT JSON from LLM output:
=====

{
  "function": "archival_memory_search",
  "params": {
    "inner_thoughts": "Looking for WaitingForAction.",
    "query": "WaitingForAction",
=====

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/jim.lloyd/.pyenv/versions/memgpt/lib/python3.11/site-packages/memgpt/main.py", line 284, in run_agent_loop
    new_messages, user_message, skip_next_user_input = process_agent_step(user_message, no_verify)
                                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jim.lloyd/.pyenv/versions/memgpt/lib/python3.11/site-packages/memgpt/main.py", line 260, in process_agent_step
    new_messages, heartbeat_request, function_failed, token_warning = memgpt_agent.step(
                                                                      ^^^^^^^^^^^^^^^^^^
  File "/Users/jim.lloyd/.pyenv/versions/memgpt/lib/python3.11/site-packages/memgpt/agent.py", line 683, in step
    raise e
  File "/Users/jim.lloyd/.pyenv/versions/memgpt/lib/python3.11/site-packages/memgpt/agent.py", line 614, in step
    response = self.get_ai_reply(
               ^^^^^^^^^^^^^^^^^^
  File "/Users/jim.lloyd/.pyenv/versions/memgpt/lib/python3.11/site-packages/memgpt/agent.py", line 812, in get_ai_reply
    raise e
  File "/Users/jim.lloyd/.pyenv/versions/memgpt/lib/python3.11/site-packages/memgpt/agent.py", line 793, in get_ai_reply
    response = create(
               ^^^^^^^
  File "/Users/jim.lloyd/.pyenv/versions/memgpt/lib/python3.11/site-packages/memgpt/openai_tools.py", line 361, in wrapper
    raise e
  File "/Users/jim.lloyd/.pyenv/versions/memgpt/lib/python3.11/site-packages/memgpt/openai_tools.py", line 334, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jim.lloyd/.pyenv/versions/memgpt/lib/python3.11/site-packages/memgpt/openai_tools.py", line 413, in create
    return get_chat_completion(
           ^^^^^^^^^^^^^^^^^^^^
  File "/Users/jim.lloyd/.pyenv/versions/memgpt/lib/python3.11/site-packages/memgpt/local_llm/chat_completion_proxy.py", line 131, in get_chat_completion
    raise LocalLLMError(f"Failed to parse JSON from local LLM response - error: {str(e)}")
memgpt.errors.LocalLLMError: Failed to parse JSON from local LLM response - error: Failed to decode JSON from LLM output:

{
  "function": "archival_memory_search",
  "params": {
    "inner_thoughts": "Looking for WaitingForAction.",
    "query": "WaitingForAction", - error
Failed to decode valid MemGPT JSON from LLM output:
=====

{
  "function": "archival_memory_search",
  "params": {
    "inner_thoughts": "Looking for WaitingForAction.",
    "query": "WaitingForAction",
=====
? Retry agent.step()? No
> Enter your message: /memory

Dumping memory contents:


### CORE MEMORY ###
=== Persona ===
My name is MemGPT.
I am an AI assistant designed to help human users with document analysis.
I can use this space in my core memory to keep track of my current tasks and goals.

The answer to the human's question will usually be located somewhere in your archival memory, so keep paging through results until you find enough information to construct an answer.
Do not respond to the human until you have arrived at an answer.
Just received a detailed explanation of the WaitingForAction template.
I will assist you in understanding C++ code, enhancing it.

=== Human ===
First name: Chad
first name: Jim

### ARCHIVAL MEMORY ###
Jim confirmed his full name, first name: Jim
#include "eta/error/panic.hpp"
#include "eta/chrono/Chrono.hpp"

namespace eta::action_state_machine {
using namespace eta::chrono;

template<typename MachineState, typename DataClock>
typename ActionStateMachine<MachineState, DataClock>::CoverageMap::Map ActionStateMachine<MachineState, DataClock>::CoverageMap::sMap;

template<typename MachineState, typename DataClock>
ActionStateMachine<MachineState, DataClock>::CoverageMap::~CoverageMap()
{
    ETA_DEFINE_LOGGER(logger, "ActionStateMachine", "coverage");

    for (const auto state : wise_enum::range<MachineState>)
    {
        for (const auto status: wise_enum::range<Status>)
        {
            const auto key = std::make_tuple(state.value, status.value);
            auto it = sMap.find(key);
            auto count = it==sMap.end() ? 0 : it->second;
            ETA_DBG(logger, "{}\t{} \t{}\n", count, state.name, status.name);
        }
    }
}

template<typename MachineState, typename DataClock>
float ActionStateMachine<MachineState, DataClock>::CoverageMap::coverage() const
{
    const auto total = wise_enum::size<MachineState> * wise_enum::size<Status>;
    assert(total > 0);
0 : it->second;
            ETA_DBG(logger, "{}\t{} \t{}\n", count, state.name, status.name);
        }
    }
}

...
...

The above shows only some of the C++ code from archival memory. This is from a proprietary code base so I am not at liberty to freely share more code.

@cpacker
Copy link
Collaborator

cpacker commented Dec 29, 2023

I think there are likely issues with parsing JSON when MemGPT is trying to code (generating code), but all of the error traces you seem to be more standard local LLM JSON decoding errors, eg:

Failed to decode valid MemGPT JSON from LLM output:
=====

{
  "function": "archival_memory_search",
  "params": {
    "inner_thoughts": "Looking for WaitingForAction.",
    "query": "WaitingForAction",
=====

^this indicates that the local LLM (dolphin mixtral) outputted that string, which the MemGPT parsing code had trouble turning into valid JSON (which is odd - that looks pretty salvageable to me, but I'll try adding it to a unit test to check).

More related to putting c++ in archival memory, I tried putting the code snippet you included in a directory and ran load + run and wasn't able to reproduce any JSON errors:

Working w/ OpenAI gpt-4 backend (shouldn't have any JSON reconstruction errors since that doesn't happen anyawys w/ openai backend):

image

"Working" w/ quickstart backend:

image

@cpacker
Copy link
Collaborator

cpacker commented Dec 29, 2023

Just confirmed via pytest it looks like our current JSON parser breaks on that string, will add a patch for it now:

E                                       memgpt.errors.LLMJSONParsingError: Failed to decode valid MemGPT JSON from LLM output:
E                                       =====
E                                       
E                                       
E                                       {
E                                         "function": "archival_memory_search",
E                                         "params": {
E                                           "inner_thoughts": "Looking for WaitingForAction.",
E                                           "query": "WaitingForAction",
E                                       
E                                       =====

memgpt/local_llm/json_parser.py:186: LLMJSONParsingError

@cpacker
Copy link
Collaborator

cpacker commented Dec 29, 2023

Patch for the specific LLM output in your trace is here (so you shouldn't see that exact error anymore): #739

@jmtrappier
Copy link

I do not know if this has been reported yet, but when I talk to the bot in English, there are no JSON errors. However, as soon as I speak in French (thus with accents and characters that do not exist in English), I get a lot of errors. There may be an issue due to this.

Surprising in 2024...

Copy link

github-actions bot commented Dec 6, 2024

This issue has been automatically closed due to 60 days of inactivity.

@github-actions github-actions bot closed this as completed Dec 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants