14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
# File 'lib/llmemory/cli/commands/search.rb', line 14
def execute(argv, _opts)
user_id = argv.shift
query = argv.join(" ").strip
unless user_id && !query.empty?
$stderr.puts "Usage: llmemory search USER_ID \"query\" [--type short|long|all]"
exit 1
end
type = @search_type || "all"
if type == "short" || type == "all"
search_short_term(user_id, query)
end
if type == "long" || type == "all"
if Llmemory.configuration.long_term_type.to_s == "graph_based"
search_graph_based(user_id, query)
else
search_file_based(user_id, query)
end
end
end
|