Interface IKnowledgeConnector
Defines the interface for a knowledge store that can store and retrieve knowledge items.
Namespace: VulcanAI.Connectors
Assembly: VulcanAI.dll
Syntax
public interface IKnowledgeConnector
Remarks
This interface provides the core functionality for managing knowledge in the system, including querying, adding, and lifecycle management of the knowledge store. Implementations should be thread-safe and handle concurrent access appropriately.
Methods
| Edit this page View SourceAddKnowledgeAsync(Knowledge)
Adds a new knowledge item to the store.
Declaration
Task AddKnowledgeAsync(Knowledge knowledge)
Parameters
Type | Name | Description |
---|---|---|
Knowledge | knowledge | The knowledge item to add. |
Returns
Type | Description |
---|---|
Task | A task that represents the asynchronous operation. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown when knowledge is null. |
QueryKnowledgeAsync(string, int?)
Queries the knowledge store for relevant knowledge items based on the provided query.
Declaration
Task<KnowledgeCollection> QueryKnowledgeAsync(string query, int? maxResults = null)
Parameters
Type | Name | Description |
---|---|---|
string | query | The search query string. |
int? | maxResults | The maximum number of results to return. If null, returns all results. |
Returns
Type | Description |
---|---|
Task<KnowledgeCollection> | A task that represents the asynchronous operation. The task result contains a KnowledgeCollection of relevant knowledge items sorted by relevance. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown when query is null. |
ArgumentException | Thrown when query is empty or whitespace. |
StartAsync()
Starts the knowledge store and performs any necessary initialization.
Declaration
Task StartAsync()
Returns
Type | Description |
---|---|
Task | A task that represents the asynchronous operation. |
Exceptions
Type | Condition |
---|---|
InvalidOperationException | Thrown when the store is already started. |
StopAsync()
Stops the knowledge store and performs any necessary cleanup.
Declaration
Task StopAsync()
Returns
Type | Description |
---|---|
Task | A task that represents the asynchronous operation. |
Exceptions
Type | Condition |
---|---|
InvalidOperationException | Thrown when the store is not started. |