Documentation Index
Fetch the complete documentation index at: https://docs.praison.ai/llms.txt
Use this file to discover all available pages before exploring further.
KnowledgeStoreProtocol
Defined in the knowledge module.
Rust AI Agent SDK
Protocol for knowledge store backends.
Methods
search
async fn search(
&self,
query: &str,
user_id: Option<&str>,
agent_id: Option<&str>,
limit: usize,
) -> Result<SearchResult>
Search for relevant content
Parameters:
| Name | Type |
|---|
query | &str |
user_id | Option<&str> |
agent_id | Option<&str> |
limit | usize |
add
async fn add(
&mut self,
content: &str,
user_id: Option<&str>,
agent_id: Option<&str>,
metadata: Option<HashMap<String, String>>,
) -> Result<AddResult>
Add content to the store
Parameters:
| Name | Type |
|---|
content | &str |
user_id | Option<&str> |
agent_id | Option<&str> |
metadata | Option<HashMap<String |
get
async fn get(&self, item_id: &str) -> Result<Option<SearchResultItem>>
Get item by ID
Parameters:
get_all
async fn get_all(
&self,
user_id: Option<&str>,
agent_id: Option<&str>,
limit: usize,
) -> Result<SearchResult>
Get all items
Parameters:
| Name | Type |
|---|
user_id | Option<&str> |
agent_id | Option<&str> |
limit | usize |
update
async fn update(&mut self, item_id: &str, content: &str) -> Result<AddResult>
Update an item
Parameters:
| Name | Type |
|---|
item_id | &str |
content | &str |
delete
async fn delete(&mut self, item_id: &str) -> Result<bool>
Delete an item
Parameters:
delete_all
async fn delete_all(&mut self, user_id: Option<&str>, agent_id: Option<&str>) -> Result<bool>
Delete all items
Parameters:
| Name | Type |
|---|
user_id | Option<&str> |
agent_id | Option<&str> |
Source
View on GitHub
praisonai/src/knowledge/mod.rs at line 0