circlemind-ai / fast-graphrag

RAG that intelligently adapts to your use case, data, and queries
MIT License
2.11k stars 88 forks source link

Not enough memory #16

Closed luandro closed 6 days ago

luandro commented 1 week ago

Describe the bug

I get a Not enough memory error when trying to run fast-graphrag on a VPS with 2Gb of RAM:

Error loading metadata file for vectordb storage './docs/entities_hnsw_metadata.pkl': Not enough memory: loadIndex failed to allocate level0
Error occurred loading checkpoint: Error loading metadata file for vectordb storage './docs/entities_hnsw_metadata.pkl': Not enough memory: loadIndex failed to allocate level0
No checkpoints to rollback to. Last checkpoint tried: None
Error occurred loading checkpoint: Not enough memory

Is there a minimal hardware requirement to run?

liukidar commented 1 week ago

Hello! Does this happen with an empty graph (i.e., before having inserted anything)?

luandro commented 1 week ago

Hi @liukidar! Yes it does, at the very start, before even starting to process anything. Running on my local computer it works fine. I've created a Docker image for it, in case you want to use for testing the exact setup:

docker run -v ./bot:/app/mapeo_docs -e TELEGRAM_BOT_TOKEN=xxx:xxx-xxx -e OPENAI_API_KEY=sk-proj-xxx communityfirst/awana_telegram_bot

Just need a Telegram bot token, which u can easily get with Bot Father.

liukidar commented 1 week ago

Yes, then I suppose hwnslib has some minimum requirements "Not enough memory: loadIndex failed to allocate level0" is generated by hwnslib here. If you really need to use it on a 2gb machine, it should be possible to use something more lightweight such as nanovectordb (it would require to create a wrapper that inherits from BaseVectorStorage)

luandro commented 6 days ago

Yup, you're right. Was trying to run on a 1Gb machine, worked fine on a 2Gb one. Thanks!

Would be amazing to have a lower resource option.