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

query_date fails with 'operator does not exist: timestamp with time zone >= character varying' #1343

Open
3 tasks
madgrizzle opened this issue May 5, 2024 · 0 comments

Comments

@madgrizzle
Copy link
Contributor

Describe the bug
When performing a converstation_search_date, a query_date using PostgreSQL (and maybe others), fails with the following error:

operator does not exist: timestamp with time zone >= character varying

The issue is that the start_date and end_date are both strings and are treated as character varying in the SQL query.

.filter(self.db_model.created_at >= start_date)

I've been able to fix it by converting start_date and end_date to python datetime objects and pass those instead. I don't know if this is a PostgreSQL-specific issue or not. If so, I can create an override in the PostgresStorageConnector class instead.

Please describe your setup

  • How did you install memgpt?
    • pip install pymemgpt
  • Describe your setup
    • What's your OS (Windows/MacOS/Linux)?
      • Ubuntu 22.04
    • How are you running memgpt? (cmd.exe/Powershell/Anaconda Shell/Terminal)
      • terminal

Additional context

SELECT memgpt_recall_memory_agent.id AS memgpt_recall_memory_agent_id,
	   memgpt_recall_memory_agent.user_id AS memgpt_recall_memory_agent_user_id,
	   memgpt_recall_memory_agent.agent_id AS memgpt_recall_memory_agent_agent_id,
	   memgpt_recall_memory_agent.role AS memgpt_recall_memory_agent_role,
	   memgpt_recall_memory_agent.text AS memgpt_recall_memory_agent_text,
	   memgpt_recall_memory_agent.model AS memgpt_recall_memory_agent_model,
	   memgpt_recall_memory_agent.name AS memgpt_recall_memory_agent_name,
	   memgpt_recall_memory_agent.tool_calls AS memgpt_recall_memory_agent_tool_calls,
	   memgpt_recall_memory_agent.tool_call_id AS memgpt_recall_memory_agent_tool_call_id,
	   memgpt_recall_memory_agent.embedding AS memgpt_recall_memory_agent_embedding,
	   memgpt_recall_memory_agent.embedding_dim AS memgpt_recall_memory_agent_embedding_dim,
	   memgpt_recall_memory_agent.embedding_model AS memgpt_recall_memory_agent_embedding_model,
	   memgpt_recall_memory_agent.created_at AS memgpt_recall_memory_agent_created_at
FROM memgpt_recall_memory_agent
WHERE memgpt_recall_memory_agent.user_id = %s::UUID
AND memgpt_recall_memory_agent.agent_id = %s::UUID
AND memgpt_recall_memory_agent.created_at >= %s::VARCHAR
AND memgpt_recall_memory_agent.created_at <= %s::VARCHAR
LIMIT ALL OFFSET %s::INTEGER

[parameters: (UUID('00000000-0000-0000-0000-000000000000'), UUID('7a55f1b8-cce8-4ac5-8309-c19934bb056f'), '2024-05-05', '9999-12-31', 5)]

Local LLM details

If you are trying to run MemGPT with local LLMs, please provide the following information:

  • python3 -m vllm.entrypoints.openai.api_server --model TheBloke/NeuralHermes-2.5-Mistral-7B-GPTQ --revision gptq-8bit-32g-actorder_True --max-model-len 8192
  • Intel NUC i7 with external 4060TI 16GB GPU
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: To triage
Development

No branches or pull requests

1 participant