Source: MemTensor#518
- Service is running:
python -m uvicorn memos.api.server_api:app --host 0.0.0.0 --port 8001 .envis configured for Redis, embeddings, and the vector DB (current test setup: Redis reachable, Qdrant Cloud connected).
-
Purpose: Write a memory (sync/async).
-
Example request (sync):
curl -s -X POST http://127.0.0.1:8001/product/add \ -H 'Content-Type: application/json' \ -d '{ "user_id": "tester", "mem_cube_id": "default_cube", "memory_content": "Apple is a fruit rich in fiber.", "async_mode": "sync" }'
-
Observed result:
200, message: "Memory added successfully", returns the writtenmemory_idand related info.
-
Purpose: List all memories for the user/type to confirm writes.
-
Example request:
curl -s -X POST http://127.0.0.1:8001/product/get_all \ -H 'Content-Type: application/json' \ -d '{ "user_id": "tester", "memory_type": "text_mem", "mem_cube_ids": ["default_cube"] }'
-
Observed result:
200, shows the recently written apple memories (WorkingMemory/LongTermMemory/UserMemory present,vector_sync=success).
-
Purpose: Vector search memories.
-
Example request:
curl -s -X POST http://127.0.0.1:8001/product/search \ -H 'Content-Type: application/json' \ -d '{ "query": "What fruit is rich in fiber?", "user_id": "tester", "mem_cube_id": "default_cube", "top_k": 5, "pref_top_k": 3, "include_preference": false }'
-
Observed result: previously returned 400 because payload indexes (e.g.,
vector_sync) were missing in Qdrant. Index creation is now automatic during Qdrant initialization (memory_type/status/vector_sync/user_name). -
If results are empty or errors persist, verify indexes exist (auto-created on restart) or recreate/clean the collection.
/product/addand/product/get_allare healthy./product/searchstill returns empty results even with vectors present; likely related to search filters or vector retrieval.- Suggested follow-ups: inspect
SearchHandlerflow, filter conditions (user_id/session/cube_name), and vector DB search calls; capture logs or compare with directVecDBFactory.searchcalls.