Base KnowledgeStore¶
Base Knowledge Store
BaseKnowledgeStore
¶
Bases: BaseModel
, ABC
Base Knowledge Store Class.
Source code in src/fed_rag/base/knowledge_store.py
load_node
abstractmethod
¶
load_nodes
abstractmethod
¶
retrieve
abstractmethod
¶
Retrieve top-k nodes from KnowledgeStore against a provided user query.
Returns:
Type | Description |
---|---|
list[tuple[float, KnowledgeNode]]
|
A list of tuples where the first element represents the similarity score |
list[tuple[float, KnowledgeNode]]
|
of the node to the query, and the second element is the node itself. |
Source code in src/fed_rag/base/knowledge_store.py
delete_node
abstractmethod
¶
clear
abstractmethod
¶
persist
abstractmethod
¶
load
abstractmethod
¶
Load the KnowledgeStore nodes from a permanent storage using name
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
ks_id
|
The id of the knowledge store to load. |
required |