feat(lightrag): Implement mix search mode combining knowledge graph and vector retrieval

- Add 'mix' mode to QueryParam for hybrid search functionality
- Implement mix_kg_vector_query to combine knowledge graph and vector search results
- Update LightRAG class to handle 'mix' mode queries
- Enhance README with examples and explanations for the new mix search mode
- Introduce new prompt structure for generating responses based on combined search results
This commit is contained in:
Magic_yuan
2024-12-28 11:56:28 +08:00
parent e6b2f68e7c
commit aaaf617451
5 changed files with 305 additions and 2 deletions

View File

@@ -16,7 +16,7 @@ T = TypeVar("T")
@dataclass
class QueryParam:
mode: Literal["local", "global", "hybrid", "naive"] = "global"
mode: Literal["local", "global", "hybrid", "naive", "mix"] = "global"
only_need_context: bool = False
only_need_prompt: bool = False
response_type: str = "Multiple Paragraphs"