orka.nodes.memory_reader_node module

class orka.nodes.memory_reader_node.MemoryReaderNode(node_id: str, **kwargs)[source]

Bases: BaseNode

A node that retrieves information from OrKa’s memory system using semantic search.

The MemoryReaderNode performs intelligent memory retrieval using RedisStack’s HNSW indexing for 100x faster vector search. It supports context-aware search, temporal ranking, and configurable similarity thresholds.

Key Features:
  • 100x faster semantic search with HNSW indexing

  • Context-aware memory retrieval

  • Temporal ranking of results

  • Configurable similarity thresholds

  • Namespace-based organization

namespace

Memory namespace to search in

Type:

str

limit

Maximum number of results to return

Type:

int

Whether to use conversation context

Type:

bool

context_weight

Weight given to context in search (0-1)

Type:

float

temporal_weight

Weight given to recency in ranking (0-1)

Type:

float

similarity_threshold

Minimum similarity score (0-1)

Type:

float

enable_temporal_ranking

Whether to boost recent memories

Type:

bool

Example:

- id: memory_search
  type: memory-reader
  namespace: knowledge_base
  params:
    limit: 5
    enable_context_search: true
    context_weight: 0.4
    temporal_weight: 0.3
    similarity_threshold: 0.8
    enable_temporal_ranking: true
  prompt: |
    Find relevant information about:
    {{ input }}

    Consider:
    - Similar topics
    - Recent interactions
    - Related context
The node automatically:
  1. Converts input to vector embeddings

  2. Performs HNSW-accelerated similarity search

  3. Applies temporal ranking if enabled

  4. Filters by similarity threshold

  5. Returns formatted results with metadata

async run(context: dict[str, Any]) dict[str, Any][source]

Read memories using RedisStack enhanced vector search.

get_search_metrics() dict[str, Any][source]

Get search performance metrics.