At PyBay 2025 this weekend, Guido van Rossum presented a new Python package called "typeagent" that implements "structured RAG", a different approach to indexing and retrieval. This is how I understand it:
š Ingestion: It uses an LLM to turn the content into structured data like entities, topics, actions. It defines the schema in TypeScript, since LLMs are adept at generating TypeScript-adherent schemas. Then the structured data is stored in a standard database (no graph DB needed).
š Retrieval: It again uses an LLM to turn the user query into similarly structured data, and then retrieves matching structured data from the database. If the token budget allows, it also adds the original content the data was extracted from.
It is *not* the same as GraphRAG, as that approach builds up hierarchical knowledge graphs based off multiple pieces of related data. GraphRAG enables you to ask more zoomed out questions, but doesn't scale well for scenarios where new data is being added all the time.
Guido demonstrated the approach by asking questions on his personal Gmail inbox, like about people and events mentioned in emails. My impression is that this approach could work particularly well for conversation retrieval, perhaps in combination with a hybrid search.
Try out the new package and see what you think -
it's on my TODO list to explore soon!
https://lnkd.in/gdgt7xCr
š Ingestion: It uses an LLM to turn the content into structured data like entities, topics, actions. It defines the schema in TypeScript, since LLMs are adept at generating TypeScript-adherent schemas. Then the structured data is stored in a standard database (no graph DB needed).
š Retrieval: It again uses an LLM to turn the user query into similarly structured data, and then retrieves matching structured data from the database. If the token budget allows, it also adds the original content the data was extracted from.
It is *not* the same as GraphRAG, as that approach builds up hierarchical knowledge graphs based off multiple pieces of related data. GraphRAG enables you to ask more zoomed out questions, but doesn't scale well for scenarios where new data is being added all the time.
Guido demonstrated the approach by asking questions on his personal Gmail inbox, like about people and events mentioned in emails. My impression is that this approach could work particularly well for conversation retrieval, perhaps in combination with a hybrid search.
Try out the new package and see what you think -
it's on my TODO list to explore soon!
https://lnkd.in/gdgt7xCr