Knowledgator UTCA
KnowledgatorGitHubDiscord
  • Welcome to UTCA documentation!
  • Quickstart
  • Concepts
    • Components
    • Types of components
    • ExecutionSchema
    • Context
    • Scopes
  • Development and Contribution
    • Contribution
    • Future relises
  • Framework structure
  • Core
    • Component
    • BaseExecutor
    • Action
    • Executable
    • Evaluator
    • Memory management
    • Schemas
    • Exceptions
  • Structural components
    • ExecutionSchema
    • Switch
    • ForEach
    • Filter
    • While
    • Condition
    • BREAK
    • Log
  • Base Actions
    • Flush
    • AddData
    • RenameAttribute
    • RenameAttributeQuery
    • SetValue
    • UnpackValue
    • NestToKey
    • ExecuteFunction
  • Predictors
    • Predictor
    • Transformers predictors
    • Transformers schemas
    • TokenSearcherPredictor
    • ComprehendItPredictor
    • GLiNERPredictor
    • OpenAIChatGPTPredictor
    • OpenAIWhisperPredictor
  • Tasks
    • Task
    • ComprehendIt
    • TokenSearcherTextCleaner
    • TokenSearcherNER
    • TokenSearcherQandA
    • TokenSearcherRelationExtraction
    • GLiNER
    • GLiNERRelationExtraction
    • GLiNERQandA
    • OpenAIChat
    • WhisperSpeechToText
    • TransformersTextToSpeech
    • TransformersChartsAndPlotsAnalysis
    • TransformersDocumentQandA
    • TransformersImageClassification
    • TransformersVisualQandA
    • TransformersObjectDetection
    • TransformersTextEmbedding
    • TransformersEntityLinking
    • TransformersTokenClassifier
    • TransformersTextSummarization
    • TransformersTextualQandA
    • TransformersTextClassification
    • TransformersChat
    • Objects
    • Chat tasks utilities
    • Relation extraction tasks utilities
  • Executable Schemas
    • SemanticSearchSchema
    • Web2Meaning
    • RequestsHTML
  • Datasources
    • Audio
    • DB
      • SQL
      • Neo4j
      • Chroma
      • Qdrant
    • Google Documents
    • Google Sheets
    • Image
    • Index
    • JSON
    • PDF
    • Plain text
    • Video
  • Conditions
    • RePattern
    • SemanticCondition
  • APIs
    • GoogleCloudClient
  • Integrations
    • Google Cloud
  • Examples
    • Basic image classification
    • Text to speech
    • PDF document processing
Powered by GitBook
On this page
  • Module: core
  • Memory
  • __init__
  • add_store
  • retrieve_store
  • delete_store
  • flush
  • MemorySetInstruction
  • SET
  • MOVE
  • SetMemory
  • __init__
  • __call__
  • MemoryGetInstruction
  • GET
  • POP
  • GetMemory
  • __init__
  • __call__
  • DeleteMemory
  • __init__
  • __call__
  • MemoryManager
  • __init__
  • get
  • set
  • delete
  • flush
  1. Core

Memory management

Memory, MemoryManager and memory components

PreviousEvaluatorNextSchemas

Last updated 1 year ago

Module:



Memory

Manage data


__init__

Arguments:

  • directory (Optional[str], optional): Path to directory. Defaults to None.

  • initial_data (Optional[Dict[str, Any]], optional): Data for initialization of memory. Defaults to None.


add_store

Save state with the given identifier

Arguments:

  • identifier (str): Identifier that will be used.

  • state (Any): State that will be associated with provided identifier.


retrieve_store

Retrieve state by its identifier, either from memory or disk

Arguments:

  • identifier (str): Identifier that will be used.

Raises:

  • KeyError: If identiifier is invalid.

Returns:

  • Any: Data associated with identifier.


delete_store

Delete a state by its identifier from both memory and disk

Arguments:

identifier (str): Identifier to delete.


flush

Clean memory




MemorySetInstruction

Set memory instruction


SET

Set data to memory


MOVE

Set data to memory and remove it from current data




SetMemory


__init__

Arguments:

  • set_key (str): Destination key.

  • get_key (Optional[str], optional): Key that used to retrieve data from register. If equals to None, complete register will be added to memory. Defaults to None.


__call__

Arguments:

Raises:

  • InavalidMemoryInstruction: If provided instruction doesnt exists.

Returns:




MemoryGetInstruction

Get memory instruction


GET

Get data from memory


POP

Get data from memory and delete it from memory




GetMemory


__init__

Arguments:

  • identifiers (List[Union[str, Tuple[str, str]]]): Key/keys that will be used to access data in memory and for setting to register.

  • default (Dict[str, Any]): A map of values to be returned for each provided identifier if the identifier(s) are not found. If an identifier is not found and no default value is provided for it, an exception will be raised. Defaults to None.


__call__

Arguments:

Raises:

  • InavalidMemoryInstruction: If provided instruction doesnt exists.

Returns:




DeleteMemory

Delete data from memory


__init__

Arguments:

  • identifiers (Optional[List[str]], optional): Keys associated with data. If equals to None, flushes memory. Defaults to None.


__call__

Arguments:

Raises:

  • InavalidMemoryInstruction: If provided instruction doesnt exists.

Returns:




MemoryManager

Manage memory


__init__

Arguments:

  • directory (Optional[str], optional): Path to directory. Defaults to None.

  • initial_data (Optional[Dict[str, Any]], optional): Data for initialization of memory. Defaults to None.


get

Get data from memory

Arguments:

  • identifiers (List[Union[str, Tuple[str, str]]]): Key/keys that will be used to access data in memory and for setting to register.

  • default (Dict[str, Any]): A map of values to be returned for each provided identifier if the identifier(s) are not found. If an identifier is not found and no default value is provided for it, an exception will be raised. Defaults to None.

  • delete (bool, optional): If equals to True, deletes accessed memory identifiers. Defaults to False.

Returns:


set

Set data to memory

Arguments:

  • get_key (str): Source of data.

  • set_key (str): Destination in memory.


delete

Delete specified identifier from memory

Arguments:

  • identifier (str): Identifier to delete.


flush

Clean memory



Subclass of

memory_instruction (, optional): Strategy for memory setting. Defaults to ..

input_data (): Current data.

evaluator (Optional[], optional): Evaluator in context of which executed. If equals to None, default evaluator will be created. Defaults to None.

: Result of execution.

Subclass of

memory_instruction (, optional): Strategy for memory access. Defaults to ..

input_data (): Current data.

evaluator (Optional[], optional): Evaluator in context of which executed. If equals to None, default evaluator will be created. Defaults to None.

: Result of execution.

input_data (): Current data.

evaluator (Optional[], optional): Evaluator in context of which executed. If equals to None, default evaluator will be created. Defaults to None.

: Result of execution.

register (): Current data.

: Result of execution.

register (): Current data.

Component
Evaluator
Component
Evaluator
Evaluator
MemorySetInstruction
MemorySetInstruction
SET
MemoryGetInstruction
MemoryGetInstruction
GET
core
Transformable
Transformable
Transformable
Transformable
Transformable
Transformable
Transformable
Transformable
Transformable