Lightweight knowledge API (Tier 2). Simple store-embed-search for entries and edges.
Summary
Functions
Check if new content contradicts existing knowledge.
Create an edge between two entries.
Delete a knowledge entry.
Get recent entries for a scope.
Get recent entries for an owner across all scopes (global brain).
Store a knowledge entry with auto-embedding.
Search entries by owner across all scopes (global brain search).
Apply supersession: demote old entries matching entity+relation pattern. New entry supersedes old ones by setting their confidence to 0.1.
Functions
Check if new content contradicts existing knowledge.
Extracts entity claims from the content and checks against existing entries in the scope. Returns:
:ok— no conflicts found{:conflict, [conflicts]}— list of conflicts with details
Example
iex> Recollect.Knowledge.check_contradiction("Kai works on auth", scope_id, owner_id)
{:conflict, [%{existing: "Maya works on auth", type: :attribution_conflict}]}
Create an edge between two entries.
Delete a knowledge entry.
Get recent entries for a scope.
Get recent entries for an owner across all scopes (global brain).
Entries with scope_id = nil are treated as general knowledge
not bound to any workspace. They appear in this query.
Store a knowledge entry with auto-embedding.
Automatically captures current context (git repo, path, OS) unless
explicitly provided via :context_hints option.
Optionally auto-classifies content using LLM-free pattern matching
via Recollect.Classification. Enable with :auto_classify option.
Search entries by owner across all scopes (global brain search).
Results from the current workspace scope are prioritized higher.
Use :scope_priority to set the active workspace for boosting.
Returns {:ok, results} with result_type: :entry and scope_id on each result.
Apply supersession: demote old entries matching entity+relation pattern. New entry supersedes old ones by setting their confidence to 0.1.