Foresight.Backend behaviour (Foresight v0.1.0)

Copy Markdown View Source

Dispatch surface for storage backends.

Every public function in Foresight forwards to the configured backend module implementing these callbacks. Each callback returns result/0: {:ok, term()} or {:error, %Foresight.Error{}}.

Summary

Callbacks

Types

result()

@type result() :: {:ok, term()} | {:error, Foresight.Error.t()}

Callbacks

add_bank_background(t, t, t, keyword)

@callback add_bank_background(Foresight.Context.t(), String.t(), String.t(), keyword()) ::
  result()

audit_log_stats(t, map, keyword)

@callback audit_log_stats(Foresight.Context.t(), map(), keyword()) :: result()

bank_profile(t, t, keyword)

@callback bank_profile(Foresight.Context.t(), String.t(), keyword()) :: result()

bank_stats(t, t, keyword)

@callback bank_stats(Foresight.Context.t(), String.t(), keyword()) :: result()

cancel_operation(t, t, keyword)

@callback cancel_operation(Foresight.Context.t(), String.t(), keyword()) :: result()

clear_bank_memories(t, t, map, keyword)

@callback clear_bank_memories(Foresight.Context.t(), String.t(), map(), keyword()) ::
  result()

clear_memory_observations(t, t, t, keyword)

@callback clear_memory_observations(
  Foresight.Context.t(),
  String.t(),
  String.t(),
  keyword()
) :: result()

clear_observations(t, t, keyword)

@callback clear_observations(Foresight.Context.t(), String.t(), keyword()) :: result()

consolidate(t, term, keyword)

@callback consolidate(Foresight.Context.t(), term(), keyword()) :: result()

create_directive(t, t, map, keyword)

@callback create_directive(Foresight.Context.t(), String.t(), map(), keyword()) ::
  result()

create_mental_model(t, t, map, keyword)

@callback create_mental_model(Foresight.Context.t(), String.t(), map(), keyword()) ::
  result()

create_webhook(t, t, map, keyword)

@callback create_webhook(Foresight.Context.t(), String.t(), map(), keyword()) :: result()

delete_bank(t, t, keyword)

@callback delete_bank(Foresight.Context.t(), String.t(), keyword()) :: result()

delete_directive(t, t, t, keyword)

@callback delete_directive(Foresight.Context.t(), String.t(), String.t(), keyword()) ::
  result()

delete_document(t, t, t, keyword)

@callback delete_document(Foresight.Context.t(), String.t(), String.t(), keyword()) ::
  result()

delete_mental_model(t, t, t, keyword)

@callback delete_mental_model(Foresight.Context.t(), String.t(), String.t(), keyword()) ::
  result()

delete_webhook(t, t, t, keyword)

@callback delete_webhook(Foresight.Context.t(), String.t(), String.t(), keyword()) ::
  result()

entity_graph(t, map, keyword)

@callback entity_graph(Foresight.Context.t(), map(), keyword()) :: result()

export_bank_template(t, t, keyword)

@callback export_bank_template(Foresight.Context.t(), String.t(), keyword()) :: result()

get_bank_config(t, t, keyword)

@callback get_bank_config(Foresight.Context.t(), String.t(), keyword()) :: result()

get_chunk(t, t, keyword)

@callback get_chunk(Foresight.Context.t(), String.t(), keyword()) :: result()

get_directive(t, t, t, keyword)

@callback get_directive(Foresight.Context.t(), String.t(), String.t(), keyword()) ::
  result()

get_document(t, t, keyword)

@callback get_document(Foresight.Context.t(), String.t(), keyword()) :: result()

get_entity(t, t, keyword)

@callback get_entity(Foresight.Context.t(), String.t(), keyword()) :: result()

get_memory(t, t, keyword)

@callback get_memory(Foresight.Context.t(), String.t(), keyword()) :: result()

get_memory_history(t, t, keyword)

@callback get_memory_history(Foresight.Context.t(), String.t(), keyword()) :: result()

get_mental_model(t, t, t, map, keyword)

@callback get_mental_model(
  Foresight.Context.t(),
  String.t(),
  String.t(),
  map(),
  keyword()
) :: result()

get_mental_model_history(t, t, t, keyword)

@callback get_mental_model_history(
  Foresight.Context.t(),
  String.t(),
  String.t(),
  keyword()
) :: result()

get_operation(t, t, keyword)

@callback get_operation(Foresight.Context.t(), String.t(), keyword()) :: result()

import_bank_template(t, t, map, keyword)

@callback import_bank_template(Foresight.Context.t(), String.t(), map(), keyword()) ::
  result()

list_audit_logs(t, map, keyword)

@callback list_audit_logs(Foresight.Context.t(), map(), keyword()) :: result()

list_banks(t, keyword)

@callback list_banks(
  Foresight.Context.t(),
  keyword()
) :: result()

list_directives(t, t, map, keyword)

@callback list_directives(Foresight.Context.t(), String.t(), map(), keyword()) :: result()

list_document_chunks(t, t, map, keyword)

@callback list_document_chunks(Foresight.Context.t(), String.t(), map(), keyword()) ::
  result()

list_documents(t, map, keyword)

@callback list_documents(Foresight.Context.t(), map(), keyword()) :: result()

list_entities(t, map, keyword)

@callback list_entities(Foresight.Context.t(), map(), keyword()) :: result()

list_memories(t, map, keyword)

@callback list_memories(Foresight.Context.t(), map(), keyword()) :: result()

list_mental_models(t, t, map, keyword)

@callback list_mental_models(Foresight.Context.t(), String.t(), map(), keyword()) ::
  result()

list_operations(t, map, keyword)

@callback list_operations(Foresight.Context.t(), map(), keyword()) :: result()

list_tags(t, map, keyword)

@callback list_tags(Foresight.Context.t(), map(), keyword()) :: result()

list_webhook_deliveries(t, t, t, map, keyword)

@callback list_webhook_deliveries(
  Foresight.Context.t(),
  String.t(),
  String.t(),
  map(),
  keyword()
) ::
  result()

list_webhooks(t, t, keyword)

@callback list_webhooks(Foresight.Context.t(), String.t(), keyword()) :: result()

memories_timeseries(t, t, t, t, keyword)

@callback memories_timeseries(
  Foresight.Context.t(),
  String.t(),
  String.t(),
  String.t(),
  keyword()
) ::
  result()

memory_graph(t, map, keyword)

@callback memory_graph(Foresight.Context.t(), map(), keyword()) :: result()

patch_bank(t, t, map, keyword)

@callback patch_bank(Foresight.Context.t(), String.t(), map(), keyword()) :: result()

put_bank(t, t, map, keyword)

@callback put_bank(Foresight.Context.t(), String.t(), map(), keyword()) :: result()

recall(t, term, keyword)

@callback recall(Foresight.Context.t(), term(), keyword()) :: result()

recover_consolidation(t, t, keyword)

@callback recover_consolidation(Foresight.Context.t(), String.t(), keyword()) :: result()

reflect(t, term, keyword)

@callback reflect(Foresight.Context.t(), term(), keyword()) :: result()

refresh_mental_model(t, t, t, keyword)

@callback refresh_mental_model(Foresight.Context.t(), String.t(), String.t(), keyword()) ::
  result()

reprocess_document(t, t, t, keyword)

@callback reprocess_document(Foresight.Context.t(), String.t(), String.t(), keyword()) ::
  result()

reset_bank_config(t, t, keyword)

@callback reset_bank_config(Foresight.Context.t(), String.t(), keyword()) :: result()

retain(t, term, keyword)

@callback retain(Foresight.Context.t(), term(), keyword()) :: result()

retain_files(t, term, keyword)

@callback retain_files(Foresight.Context.t(), term(), keyword()) :: result()

retry_operation(t, t, keyword)

@callback retry_operation(Foresight.Context.t(), String.t(), keyword()) :: result()

update_bank_config(t, t, map, keyword)

@callback update_bank_config(Foresight.Context.t(), String.t(), map(), keyword()) ::
  result()

update_bank_disposition(t, t, map, keyword)

@callback update_bank_disposition(Foresight.Context.t(), String.t(), map(), keyword()) ::
  result()

update_directive(t, t, t, map, keyword)

@callback update_directive(
  Foresight.Context.t(),
  String.t(),
  String.t(),
  map(),
  keyword()
) :: result()

update_document(t, t, t, map, keyword)

@callback update_document(Foresight.Context.t(), String.t(), String.t(), map(), keyword()) ::
  result()

update_mental_model(t, t, t, map, keyword)

@callback update_mental_model(
  Foresight.Context.t(),
  String.t(),
  String.t(),
  map(),
  keyword()
) :: result()

update_webhook(t, t, t, map, keyword)

@callback update_webhook(Foresight.Context.t(), String.t(), String.t(), map(), keyword()) ::
  result()