getmetal / motorhead

🧠 Motorhead is a memory and information retrieval server for LLMs.

Home Page:https://getmetal.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Extending context types

uyasarkocal opened this issue · comments

commented

Would it be possible to integrate Knowledge Graph or Entity type context into motörhead?

@uyasarkocal can you give me an example of a query<>response, also a use case?

If it makes sense for the project we can do it.

Thanks for the issue!

commented

KG is usable with langchain, which has been the best memory type to overcome token limits for my case.
Langchain Knowledge Graph Integration Code
Langchain KG and Entity Mem. prompts
This is how it uses KG, this memory type might be a little more complex since it loads into a networkx graph. (storing it is a bit more difficult but has a lot of options like pickle, json etc.)

Entity type memory is easier, since a prompt extracts entities from chats with a simpler structure (Just "entity:knowledge") and does not need to load into any library to work.

Incorporating both KG and Entity type memory into Motörhead would greatly enhance the quality of knowledge and information that can be retrieved and shared during chat interactions.

Example for KG knowledge triplets with conversation from Motörhead's Readme.md:
<|>(Electronic music, encompasses, many different styles) <|>(People, dance to, electronic music) <|>(Colombia, has, a vibrant electronic music scene) <|>(Colombian DJs, have gained, international recognition) <|>(Baum, is one of, the most popular clubs for electronic music in Bogotá)

As you may notice, as this knowledge triplets extend with the chat it supplies a much more sophisticated context with relations while storing much more smaller data.

@Czechh Thanks for your attention and this product 🤘🏼

This is awesome @uyasarkocal - I'm currently working on log term memory with a semantic index. I can start looking into this right after that.

Need to build a working example to understand it better.