Facthouse

v0.42.0
io.github.gordonkjlee/facthouse Checked 1 day ago Published 1 day ago

Local AI memory: neuroscience-inspired Data→Information→Knowledge in SQLite you own.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

log_event

Record a raw exchange — a user message, your response, a tool call, a tool result, an artifact — as the episodic record consolidation later extracts facts from. Logging both sides gives that extraction the context to know what a reply refers to. Where the client has hooks configured, every event is logged for you automatically and you do not need to call this at all. Call it when there are no hooks, or when an exchange matters enough to preserve verbatim — a decision, a correction, a specification — and you want it recorded whether or not hooks are running. Duplicates are reconciled a…

ParameterTypeDescription
content *string | nullText content of the event
event_type *stringType of event
role *stringChannel that produced this event (user, assistant, system, tool). For a named person on a group transcript, keep role as user and pass speaker.
content_refstring | nullURI or path for non-text content
content_typestringHow to interpret the content. Defaults to 'text' for messages. Use 'json' for structured data, 'image' for screenshots or generated images, 'audio' for voice or audio clips, 'binary' for anything else…
metadataArbitrary metadata
speakerstring | nullNamed participant when the transcript has one (e.g. Alex). Role stays the channel — do not invent a person role.

get_events

Retrieve events from the current or a previous session. Returns the raw episodic record — messages, tool calls, tool results, and artifacts in sequence order. Use this to recall what happened earlier in a conversation (especially after context compaction), or to review a previous session.

ParameterTypeDescription
after_sequencenumberOnly return events after this sequence number (for pagination).
limitnumberMaximum events to return (default 50).
session_idstringSession to query (matches MCP or client session ID). Omit for the current session.

capture_fact

Store a durable fact worth remembering across sessions. A durable fact is a stable piece of knowledge about whatever this store is used for: its subjects, their attributes, their relationships, decisions, and context. Ignore ephemeral statements (current tasks, transient mood). Call this proactively whenever you learn something this store should keep. Capture is fast — the server stores the fact immediately. Entity extraction, domain classification, and cross-session reconciliation run in batch when you call consolidate. Capture frequently without slowing the conversation. Exact same-sessi…

ParameterTypeDescription
content *stringThe fact to capture
capture_contextstringWhat the conversation is about right now
confidencenumberOptional. Leave it out unless you doubt the fact. A value can only lower how firmly the fact is held, never raise it: use it for a hedge such as "the user might be…" (0.0–1.0).
domain_hintstringSuggested domain. Domains are whatever this store uses, not a fixed list — call get_schemas to see them, reuse an existing one where it fits, and propose a new short lowercase noun when none does. O…
importancenumberHow important (0.0–1.0). High for medical/safety, low for casual preferences
source_event_idstringID of the event that prompted this capture

check_fact

Report the user's answer after you checked a fact with them. Call this when a fact came back with assert_as ask, or any fact you checked with the user, and when the user tells you unprompted that something you recalled was never right. confirmed raises its confidence, usually to assert_as state. denied means the user says it was never right: it is retired, kept in history but no longer returned; if they gave the right version, also call capture_fact with it. A fact that was right but has changed (they moved, changed job, renamed something) is not denied: call capture_fact with the new version…

ParameterTypeDescription
answer *stringconfirmed: the user said it is right. denied: the user said it was never right (not that it has changed). unsure: the user did not know.
fact_id *stringThe id of the fact you checked (fact.id from a result)

get_session_context

At the start of every conversation, before answering, call get_session_context unless you already loaded the memory://briefing resource. That call returns the same working briefing the resource would have injected. Tools-only clients never fetch resources. Also returns facts captured in this session that have not been consolidated yet. Call it before re-capturing a fact you may have already stored this session.

ParameterTypeDescription
session_idstringSession to query. Omit for the current session.

consolidate

Copy, extract, and integrate. Copies new lines from named sources, extracts candidate facts from them, and integrates pending facts: domains, entities, duplicates, contradictions, the knowledge graph. Call this after capturing several facts, at a topic change, or before the conversation ends. Extract is capped at 50 of the oldest unexamined lines per call; events_remaining in the result says how many wait. Pass all: true to take the whole backlog in one call, or limit: N for the oldest N. When meaning search is on, integrate also embeds currently-true facts that have no vector for the worki…

ParameterTypeDescription
allbooleanExtract the whole backlog this call instead of the capped oldest batch
limitintegerExtract at most this many of the oldest unexamined lines

search_knowledge

Search the knowledge base. Call this BEFORE answering questions that might benefit from what this store knows. If you have not called get_session_context (or loaded memory://briefing) this conversation, do that first — otherwise you start without this store's context. Returns facts ranked by relevance with source attribution and confidence scores. Three fields come back. `results` is integrated knowledge: deduplicated, reconciled against everything else known, entities resolved. Each result carries speaker_role when the primary event is known (user, assistant, system, or tool) and speaker w…

ParameterTypeDescription
query *stringWhat to search for
domainstringPrioritise a domain. Domains are whatever this store uses — they are not a fixed list, so call get_schemas to see them rather than guessing. This biases ranking rather than filtering: facts in the d…

get_entity

Get everything known about a named thing — who or what it is, the facts about it, and how it connects to other things. A "thing" is any subject this store holds knowledge about: a person, an organisation, a project, a place, a product, a system — whatever the store is used for. This is the "tell me about X" tool. Call this WHENEVER a named thing is mentioned or alluded to and knowing it would improve your answer — including indirect references like "my manager", "the Helsinki office", "the payments service". Call it before advising on anything involving that thing, and before asking wh…

ParameterTypeDescription
name *stringThe thing's name. Resolve an indirect reference to a name first if you can (e.g. via get_context or a prior fact).
typestringOptional type filter, only for disambiguation when one name refers to two different things (a person and a project both called 'Mercury'). Types are whatever this store uses — omit it to match any t…

get_context

Get everything known about a topic, combining search with entity relationship traversal. More comprehensive than search_knowledge — it follows entity connections outward: from a named subject to the things it relates to, and the facts about those in turn. Call this when you need the COMPLETE picture of a topic, subject, or domain rather than a specific fact — planning something involving a person, project or system, catching up on a subject, or answering an open-ended question about any of them. Prefer search_knowledge when you want one fact fast; prefer this when missing a connection wo…

ParameterTypeDescription
topic *stringTopic, person, project, or domain to explore

get_schemas

List the knowledge domains this user's memory actually uses, and their subdomains. The set is not fixed — beyond the core domains it grows to fit the user, so it is worth asking rather than assuming. Call this before filtering a search by domain, before choosing a domain_hint for capture_fact, or when you want to know how this user's knowledge is organised. Rarely needed mid-conversation — search_knowledge and get_context work without it.

get_stats

Get knowledge base statistics — how many facts are currently true, how many are held in total including superseded history, entity and domain counts, how facts are distributed across domains, and how much raw log can be reclaimed. Call this when the user asks what you know or remember about them, how much you have stored, or whether their memory is working. This answers "how much do you know", not "what do you know" — use search_knowledge, get_entity or get_context for actual recall. `semantic` is present when this store is configured for meaning search. `semantic.stored` is how many cur…