Repository navigation
Closed
Labels
enhancementNew feature or requestepic:memory-engineEpic: Memory engine core capabilitiespriority:mediumFix soonscope:cliCLI and UXscope:coreCore engine worktype:featureNew feature
Milestone
Description
Motivation
GBrain enforces inline [Source: ...] citations on every fact written, with a dedicated skill (citation-fixer) that audits and fixes broken citations. This creates traceable, trustworthy memory.
Uteke memories currently have no provenance tracking — you can't tell where a memory came from (user input? imported? derived from another memory?).
Proposal
Add source metadata to every memory, with audit capabilities — all local, zero LLM.
Source Field (schema addition)
Add source and source_type columns to existing memories table:
ALTER TABLE memories ADD COLUMN source TEXT; -- free-form: URL, file path, "user", "import"
ALTER TABLE memories ADD COLUMN source_type TEXT; -- enum: user, url, file, import, derived, unknownSource Types (enum)
pub enum SourceType {
User, // directly from user input
Url, // extracted from a web page
File, // from a local file
Import, // bulk imported (JSONL)
Derived, // synthesized from other memories (consolidation)
System, // system-generated (migration, backfill)
Unknown, // legacy data without source
}CLI Usage
# Remember with source
uteke remember "Rust 1.85 stabilized async traits" --source "https://blog.rust-lang.org/2025..." --source-type url
# Audit: find memories without sources
uteke audit sources --missing
# Audit: breakdown by source type
uteke audit sources --statsRecall Display
When displaying recall results, show source inline:
[0.89] Rust 1.85 stabilized async traits
Source: https://blog.rust-lang.org/... | Type: url | Created: 2026-06-14
Auto-Attribution Rules
| Operation | Default Source |
|---|---|
uteke remember (CLI) |
user |
uteke import |
import:<filename> |
| Consolidation | derived:<source_ids> |
| Shell hook | shell |
MCP remember |
mcp:<client> |
User can override with --source flag.
Scope
- Add
source+source_typecolumns + migration - Add
--sourceand--source-typeCLI flags toremember - Auto-attribute source in all write paths
- Add
uteke audit sourcessubcommand (missing report, breakdown) - Display source in recall/list output
- Include source in JSONL export
- Backfill: set
source_type = unknownfor existing memories - Tests: attribution rules, audit, export roundtrip
Non-Goals
- LLM-based citation verification (out of scope)
- Web scraping to verify URL sources (external dependency)
- Citation format standardization (just track the source string)
References
- GBrain:
skills/citation-fixer/SKILL.md— citation audit + fix workflow - GBrain convention:
skills/conventions/quality.md— Iron Law back-linking
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestepic:memory-engineEpic: Memory engine core capabilitiespriority:mediumFix soonscope:cliCLI and UXscope:coreCore engine worktype:featureNew feature
Activity
fix(#348): use stored ID for set_source, not latest-memory lookup
fix(#348): propagate set_source errors instead of ignoring
feat(#348): citation & source attribution system (#396)
feat(#348): citation & source attribution system (#396)