Class: Engram::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/engram/configuration.rb

Overview

Holds the wired adapters and defaults. Out of the box everything works in memory, so the gem is usable (and testable) with zero infrastructure. In a Rails app the initializer typically swaps in PgvectorStore + RubyLLMEmbedder + RubyLLMCompletion.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/engram/configuration.rb', line 12

def initialize
  @store = Adapters::InMemoryStore.new
  @embedder = Adapters::NullEmbedder.new
  @completion = nil # required for observe (extract/consolidate); nil until configured
  @default_limit = 5
  @consolidator = :heuristic # :heuristic (deterministic) or :llm (LLM-as-judge)
  @extraction_min_confidence = 0.5
  @processed_turns = Adapters::InMemoryProcessedTurns.new # idempotency for observe

  # Recall ranking. With both weights at 0.0, recall is plain similarity search.
  @importance_weight = 0.0
  @recency_weight = 0.0
  @recency_halflife = UseCases::Recall::DEFAULT_HALFLIFE
  @touch_on_recall = false
end

Instance Attribute Details

#completionObject

Returns the value of attribute completion.



8
9
10
# File 'lib/engram/configuration.rb', line 8

def completion
  @completion
end

#consolidatorObject

Returns the value of attribute consolidator.



8
9
10
# File 'lib/engram/configuration.rb', line 8

def consolidator
  @consolidator
end

#default_limitObject

Returns the value of attribute default_limit.



8
9
10
# File 'lib/engram/configuration.rb', line 8

def default_limit
  @default_limit
end

#embedderObject

Returns the value of attribute embedder.



8
9
10
# File 'lib/engram/configuration.rb', line 8

def embedder
  @embedder
end

#extraction_min_confidenceObject

Returns the value of attribute extraction_min_confidence.



8
9
10
# File 'lib/engram/configuration.rb', line 8

def extraction_min_confidence
  @extraction_min_confidence
end

#importance_weightObject

Returns the value of attribute importance_weight.



8
9
10
# File 'lib/engram/configuration.rb', line 8

def importance_weight
  @importance_weight
end

#processed_turnsObject

Returns the value of attribute processed_turns.



8
9
10
# File 'lib/engram/configuration.rb', line 8

def processed_turns
  @processed_turns
end

#recency_halflifeObject

Returns the value of attribute recency_halflife.



8
9
10
# File 'lib/engram/configuration.rb', line 8

def recency_halflife
  @recency_halflife
end

#recency_weightObject

Returns the value of attribute recency_weight.



8
9
10
# File 'lib/engram/configuration.rb', line 8

def recency_weight
  @recency_weight
end

#storeObject

Returns the value of attribute store.



8
9
10
# File 'lib/engram/configuration.rb', line 8

def store
  @store
end

#touch_on_recallObject

Returns the value of attribute touch_on_recall.



8
9
10
# File 'lib/engram/configuration.rb', line 8

def touch_on_recall
  @touch_on_recall
end