pub struct KnowledgeEntry {
pub id: String,
pub key: String,
pub value: MemoryValue,
pub created_by: String,
pub created_at: DateTime<Utc>,
pub updated_by: String,
pub updated_at: DateTime<Utc>,
pub tags: Vec<String>,
pub acl: Option<Vec<String>>,
pub metadata: HashMap<String, String>,
}Expand description
A shared knowledge entry
Fields§
§id: StringUnique identifier
key: StringKey for the knowledge
value: MemoryValueThe value/content
created_by: StringAgent that created this entry
created_at: DateTime<Utc>When it was created
updated_by: StringAgent that last updated this entry
updated_at: DateTime<Utc>When it was last updated
Tags for categorization
acl: Option<Vec<String>>Access control list (agent IDs that can access)
metadata: HashMap<String, String>Optional metadata
Implementations§
Source§impl KnowledgeEntry
impl KnowledgeEntry
Sourcepub fn new(
key: impl Into<String>,
value: impl Into<MemoryValue>,
created_by: impl Into<String>,
) -> Self
pub fn new( key: impl Into<String>, value: impl Into<MemoryValue>, created_by: impl Into<String>, ) -> Self
Create a new knowledge entry
Set tags
Sourcepub fn with_metadata(
self,
key: impl Into<String>,
value: impl Into<String>,
) -> Self
pub fn with_metadata( self, key: impl Into<String>, value: impl Into<String>, ) -> Self
Add metadata
Sourcepub fn has_access(&self, agent_id: &str) -> bool
pub fn has_access(&self, agent_id: &str) -> bool
Check if an agent has access
Trait Implementations§
Source§impl Clone for KnowledgeEntry
impl Clone for KnowledgeEntry
Source§fn clone(&self) -> KnowledgeEntry
fn clone(&self) -> KnowledgeEntry
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for KnowledgeEntry
impl Debug for KnowledgeEntry
Source§impl<'de> Deserialize<'de> for KnowledgeEntry
impl<'de> Deserialize<'de> for KnowledgeEntry
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for KnowledgeEntry
impl RefUnwindSafe for KnowledgeEntry
impl Send for KnowledgeEntry
impl Sync for KnowledgeEntry
impl Unpin for KnowledgeEntry
impl UnwindSafe for KnowledgeEntry
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more