Skip to content

Fact System

The Fact System is Swisper's long-term memory — it automatically extracts, stores, and retrieves personal facts, entity relationships, and communication preferences from every conversation. This enables truly personalized responses: Swisper remembers allergies, birthdays, travel plans, and family relationships without users needing to explicitly save anything.

The system uses a combination of LLM-based extraction, semantic deduplication, and vector-based retrieval (PostgreSQL with pgvector) to build and query a comprehensive user knowledge base.

Key Components

Component Purpose
Fact Extraction Node Extracts persistent facts from conversation using an LLM with a persistence test filter
Entity Resolution Node Resolves people mentioned in conversation against the user's contact database with semantic deduplication
Extraction Merge Node Links facts to resolved entities, detects conflicts, and persists to database
Fact Conflict Resolution Routes conflicting facts through HITL for user confirmation before overwriting
Semantic Retrieval Vector similarity search to find relevant facts for the current conversation
Temporal Retrieval Time-based fact retrieval for date-anchored queries (birthdays, events, travel)
Fact Persistence Service Stores facts with embeddings, deduplication, and confidence scoring
Preference Extraction Captures communication style preferences (tone, verbosity, formatting) from conversation

Documentation Sections

  • Overview — What this module does and who it serves
  • Architecture — System design, components, and trade-offs