Skip to main content

AgentTraversal

Struct AgentTraversal 

Source
pub struct AgentTraversal { /* private fields */ }
Expand description

Main interface for agent graph traversal operations.

Implementations§

Source§

impl AgentTraversal

Source

pub fn new(document: Document) -> Self

Create a new agent traversal system.

Source

pub fn with_rag_provider(self, provider: Arc<dyn RagProvider>) -> Self

Create with a RAG provider.

Source

pub fn with_global_limits(self, limits: GlobalLimits) -> Self

Create with custom global limits.

Source

pub fn update_document(&self, document: Document) -> Result<()>

Update the internal document with a new copy.

Use this when you’ve added blocks to the original document after creating the AgentTraversal.

Source

pub fn get_document(&self) -> Result<Document>

Get a clone of the internal document.

Source

pub fn create_session(&self, config: SessionConfig) -> Result<AgentSessionId>

Create a new agent session.

Source

pub fn get_session( &self, id: &AgentSessionId, ) -> Result<RwLockReadGuard<'_, HashMap<AgentSessionId, AgentSession>>>

Get a reference to a session.

Source

pub fn close_session(&self, id: &AgentSessionId) -> Result<()>

Close a session.

Source

pub fn navigate_to( &self, session_id: &AgentSessionId, target: BlockId, ) -> Result<NavigationResult>

Navigate to a specific block.

Source

pub fn go_back( &self, session_id: &AgentSessionId, steps: usize, ) -> Result<NavigationResult>

Go back in navigation history.

Source

pub fn expand( &self, session_id: &AgentSessionId, block_id: BlockId, direction: ExpandDirection, options: ExpandOptions, ) -> Result<ExpansionResult>

Expand from a block in a given direction.

Source

pub async fn search( &self, session_id: &AgentSessionId, query: &str, options: SearchOptions, ) -> Result<RagSearchResults>

Perform semantic search (requires RAG provider).

Source

pub fn find_by_pattern( &self, session_id: &AgentSessionId, role: Option<&str>, tag: Option<&str>, label: Option<&str>, pattern: Option<&str>, ) -> Result<FindResult>

Find blocks by pattern (no RAG required).

Source

pub fn view_block( &self, session_id: &AgentSessionId, block_id: BlockId, mode: ViewMode, ) -> Result<BlockView>

View a specific block.

Source

pub fn view_neighborhood( &self, session_id: &AgentSessionId, ) -> Result<NeighborhoodView>

View the neighborhood around the current cursor position.

Source

pub fn find_path( &self, session_id: &AgentSessionId, from: BlockId, to: BlockId, max_length: Option<usize>, ) -> Result<Vec<BlockId>>

Find a path between two blocks.

Source

pub fn context_add( &self, session_id: &AgentSessionId, block_id: BlockId, _reason: Option<String>, _relevance: Option<f32>, ) -> Result<()>

Add a block to the context window.

Source

pub fn context_add_results( &self, session_id: &AgentSessionId, ) -> Result<Vec<BlockId>>

Add all last results to context.

Source

pub fn context_remove( &self, session_id: &AgentSessionId, _block_id: BlockId, ) -> Result<()>

Remove a block from context.

Source

pub fn context_clear(&self, session_id: &AgentSessionId) -> Result<()>

Clear the context window.

Source

pub fn context_focus( &self, session_id: &AgentSessionId, block_id: Option<BlockId>, ) -> Result<()>

Set focus block.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more