forked from cardosofelipe/fast-next-template
Implements semantic memory with fact storage, retrieval, and verification: Core functionality: - SemanticMemory class for fact storage/retrieval - Fact storage as subject-predicate-object triples - Duplicate detection with reinforcement - Semantic search with text-based fallback - Entity-based retrieval - Confidence scoring and decay - Conflict resolution Supporting modules: - FactExtractor: Pattern-based fact extraction from episodes - FactVerifier: Contradiction detection and reliability scoring Test coverage: - 47 unit tests covering all modules - extraction.py: 99% coverage - verification.py: 95% coverage - memory.py: 78% coverage 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
28 lines
581 B
Python
28 lines
581 B
Python
# app/services/memory/semantic/__init__.py
|
|
"""
|
|
Semantic Memory
|
|
|
|
Fact storage with triple format (subject, predicate, object)
|
|
and semantic search capabilities.
|
|
"""
|
|
|
|
from .extraction import (
|
|
ExtractedFact,
|
|
ExtractionContext,
|
|
FactExtractor,
|
|
get_fact_extractor,
|
|
)
|
|
from .memory import SemanticMemory
|
|
from .verification import FactConflict, FactVerifier, VerificationResult
|
|
|
|
__all__ = [
|
|
"ExtractedFact",
|
|
"ExtractionContext",
|
|
"FactConflict",
|
|
"FactExtractor",
|
|
"FactVerifier",
|
|
"SemanticMemory",
|
|
"VerificationResult",
|
|
"get_fact_extractor",
|
|
]
|