Skip to content

EPIC: First-Class Person Entity with SQLite Registry #92

@krisoye

Description

@krisoye

Overview

Add a first-class Person entity to the Knowledge Bank, enabling person profiles with aggregated credibility, alias management, source attachment, and merge/dedup capabilities. Persons are stored in a SQLite registry alongside ChromaDB sources.

Architecture

Storage:

  • SQLite database at /var/lib/knowledge-bank-tools/persons.db (managed via StateDirectory)
  • Three tables: persons, person_aliases, person_sources
  • ChromaDB sources gain person_ids_str field for filtering

Schema:

CREATE TABLE persons (
    id TEXT PRIMARY KEY,
    canonical_name TEXT NOT NULL,
    bio TEXT,
    date_created TEXT NOT NULL,
    date_updated TEXT NOT NULL
);

CREATE TABLE person_aliases (
    person_id TEXT NOT NULL REFERENCES persons(id) ON DELETE CASCADE,
    alias TEXT NOT NULL,
    PRIMARY KEY (person_id, alias)
);

CREATE TABLE person_sources (
    person_id TEXT NOT NULL REFERENCES persons(id) ON DELETE CASCADE,
    source_id TEXT NOT NULL,
    role TEXT NOT NULL DEFAULT 'contributor',
    PRIMARY KEY (person_id, source_id)
);

Credibility: Weighted average across attached sources. Weights: expert=4, practitioner=3, general=2, unverified=1. Thresholds: >=3.5=expert, >=2.5=practitioner, >=1.5=general, else unverified.

Auto-resolution at ingest: When a source with person_entity is ingested, exact match → auto-attach. Fuzzy match (Levenshtein ratio >= 0.9) → auto-attach. No match → create new person record.

Sub-Issues

  1. Add PersonRegistry SQLite class for person CRUD, merge, and credibility #93 — PersonRegistry SQLite class (knowledge-bank-tools)
  2. Add Person REST API endpoints to KB server #95 — Person REST API endpoints (knowledge-bank-tools)
  3. Auto-resolve person entities during source ingestion #96 — Auto-resolve persons at ingest (knowledge-bank-tools)
  4. Fix person_name → person_entity field name in vocabulary extraction #94 — Fix vocabulary extraction person_name bug (knowledge-bank-tools)
  5. Add Person management MCP tools #97 — Person MCP tools (knowledge-bank-tools)
  6. krisoye/admin-dashboard#47 — People admin pages (admin-dashboard)
  7. krisoye/admin-dashboard#48 — Person attach/detach on source detail pages (admin-dashboard)

Acceptance Criteria

  • Persons have canonical names, aliases, and source attachments
  • Credibility is computed as weighted average across attached sources
  • Ingesting new sources auto-attaches or creates persons
  • Admin dashboard has a People section for browsing, merging, and managing persons
  • Source detail pages show attached persons with attach/detach controls
  • Vocabulary extraction correctly uses person_entity field

Auto-Close: PR should include Closes krisoye/knowledge-bank-tools#92 in description.

Metadata

Metadata

Assignees

No one assigned

    Labels

    epicLarge multi-issue initiative

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions