Class: Engram::Configuration
- Inherits:
-
Object
- Object
- Engram::Configuration
- 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
-
#completion ⇒ Object
Returns the value of attribute completion.
-
#consolidator ⇒ Object
Returns the value of attribute consolidator.
-
#default_limit ⇒ Object
Returns the value of attribute default_limit.
-
#embedder ⇒ Object
Returns the value of attribute embedder.
-
#extraction_min_confidence ⇒ Object
Returns the value of attribute extraction_min_confidence.
-
#importance_weight ⇒ Object
Returns the value of attribute importance_weight.
-
#processed_turns ⇒ Object
Returns the value of attribute processed_turns.
-
#recency_halflife ⇒ Object
Returns the value of attribute recency_halflife.
-
#recency_weight ⇒ Object
Returns the value of attribute recency_weight.
-
#store ⇒ Object
Returns the value of attribute store.
-
#touch_on_recall ⇒ Object
Returns the value of attribute touch_on_recall.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
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
#completion ⇒ Object
Returns the value of attribute completion.
8 9 10 |
# File 'lib/engram/configuration.rb', line 8 def completion @completion end |
#consolidator ⇒ Object
Returns the value of attribute consolidator.
8 9 10 |
# File 'lib/engram/configuration.rb', line 8 def consolidator @consolidator end |
#default_limit ⇒ Object
Returns the value of attribute default_limit.
8 9 10 |
# File 'lib/engram/configuration.rb', line 8 def default_limit @default_limit end |
#embedder ⇒ Object
Returns the value of attribute embedder.
8 9 10 |
# File 'lib/engram/configuration.rb', line 8 def @embedder end |
#extraction_min_confidence ⇒ Object
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_weight ⇒ Object
Returns the value of attribute importance_weight.
8 9 10 |
# File 'lib/engram/configuration.rb', line 8 def importance_weight @importance_weight end |
#processed_turns ⇒ Object
Returns the value of attribute processed_turns.
8 9 10 |
# File 'lib/engram/configuration.rb', line 8 def processed_turns @processed_turns end |
#recency_halflife ⇒ Object
Returns the value of attribute recency_halflife.
8 9 10 |
# File 'lib/engram/configuration.rb', line 8 def recency_halflife @recency_halflife end |
#recency_weight ⇒ Object
Returns the value of attribute recency_weight.
8 9 10 |
# File 'lib/engram/configuration.rb', line 8 def recency_weight @recency_weight end |
#store ⇒ Object
Returns the value of attribute store.
8 9 10 |
# File 'lib/engram/configuration.rb', line 8 def store @store end |
#touch_on_recall ⇒ Object
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 |