pub struct CortexClient { /* private fields */ }Expand description
A connected Cortex client.
Wraps the tonic gRPC client with ergonomic methods for common operations.
For full proto access use the proto re-export and call CortexClient::inner.
Implementations§
Source§impl CortexClient
impl CortexClient
Sourcepub async fn connect(addr: impl Into<String>) -> Result<Self>
pub async fn connect(addr: impl Into<String>) -> Result<Self>
Connect to a running Cortex server.
addr should be a full URI, e.g. "http://localhost:9090".
Sourcepub fn inner(&mut self) -> &mut CortexServiceClient<Channel>
pub fn inner(&mut self) -> &mut CortexServiceClient<Channel>
Expose the raw gRPC client for full proto access.
Sourcepub async fn create_node(
&mut self,
req: CreateNodeRequest,
) -> Result<NodeResponse>
pub async fn create_node( &mut self, req: CreateNodeRequest, ) -> Result<NodeResponse>
Create a node. Returns the stored NodeResponse.
Sourcepub async fn get_node(&mut self, id: &str) -> Result<Option<NodeResponse>>
pub async fn get_node(&mut self, id: &str) -> Result<Option<NodeResponse>>
Get a node by ID. Returns None if not found.
Sourcepub async fn search(
&mut self,
query: &str,
limit: u32,
) -> Result<SearchResponse>
pub async fn search( &mut self, query: &str, limit: u32, ) -> Result<SearchResponse>
Semantic similarity search. Returns scored result entries.
Sourcepub async fn search_hybrid(
&mut self,
query: &str,
anchor_ids: Vec<String>,
limit: u32,
) -> Result<Vec<HybridResultEntry>>
pub async fn search_hybrid( &mut self, query: &str, anchor_ids: Vec<String>, limit: u32, ) -> Result<Vec<HybridResultEntry>>
Hybrid search combining vector similarity with graph proximity.
anchor_ids are node IDs that anchor the graph proximity component.
Pass an empty Vec for pure hybrid mode with no anchors.
Sourcepub async fn briefing(&mut self, agent_id: &str) -> Result<String>
pub async fn briefing(&mut self, agent_id: &str) -> Result<String>
Generate a rendered context briefing for an agent. Returns markdown text.
Sourcepub async fn traverse(
&mut self,
node_id: &str,
depth: u32,
) -> Result<SubgraphResponse>
pub async fn traverse( &mut self, node_id: &str, depth: u32, ) -> Result<SubgraphResponse>
Graph traversal starting from node_id up to depth hops.
Sourcepub async fn create_edge(
&mut self,
from_id: &str,
to_id: &str,
relation: &str,
) -> Result<String>
pub async fn create_edge( &mut self, from_id: &str, to_id: &str, relation: &str, ) -> Result<String>
Create an edge between two nodes. Returns the edge ID.
Sourcepub async fn stats(&mut self) -> Result<StatsResponse>
pub async fn stats(&mut self) -> Result<StatsResponse>
Get graph statistics.
Auto Trait Implementations§
impl !Freeze for CortexClient
impl !RefUnwindSafe for CortexClient
impl Send for CortexClient
impl Sync for CortexClient
impl Unpin for CortexClient
impl UnsafeUnpin for CortexClient
impl !UnwindSafe for CortexClient
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request