Skip to content

Commit 81a7d0d

Browse files
authored
feat(memory): add FAISS semantic search and resonance engine (#24)
* feat(memory): add content chunker and config Add memory system configuration with model settings (all-MiniLM-L6-v2, 384 dimensions), source type definitions, content path mappings, and chunk size limits. Add content-type-aware chunker supporting thoughts, dreams, essays, letters, scores, conversations, memory files, jar JSON, and mailbox JSONL with deterministic SHA-256 chunk IDs. * feat(memory): add FAISS indexer and semantic searcher Add FAISS IndexFlatIP builder with SentenceTransformer embeddings supporting full rebuild and incremental update via mtime-based change detection. Add lazy-loading semantic searcher with cosine similarity search, post-retrieval filtering by type/date/person, context mode for adjacent chunks, and system-prompt output format for wake.sh context injection. * feat(memory): add cross-content resonance engine Add resonance discovery engine that finds semantically similar chunks across different content types using FAISS similarity search. Filters structural boilerplate via regex, tracks known pairs across dated resonance files for deduplication, and supports file-specific and passage-based resonance queries. * ci(quality): scope mypy to src/api for optional dependency compat The memory subsystem uses optional dependencies (faiss-cpu, sentence- transformers, numpy) not installed in CI. Scope mypy to src/api/ to avoid false failures on unresolved imports in optional packages.
1 parent 46d49ea commit 81a7d0d

7 files changed

Lines changed: 1555 additions & 1 deletion

File tree

.github/workflows/quality.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ jobs:
7272
run: uv sync --extra dev
7373

7474
- name: Run mypy
75-
run: uv run mypy src
75+
run: uv run mypy src/api
7676

7777
compliance:
7878
name: Protocol Zero

src/memory/__init__.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
"""Memory system — semantic search and resonance discovery over content."""
2+
3+
from memory.chunker import ChunkMeta, chunk_file, chunk_jar, chunk_mailbox
4+
from memory.config import SourceType
5+
from memory.searcher import MemorySearcher, SearchFilters, SearchResult, get_searcher
6+
7+
__all__ = [
8+
"ChunkMeta",
9+
"MemorySearcher",
10+
"SearchFilters",
11+
"SearchResult",
12+
"SourceType",
13+
"chunk_file",
14+
"chunk_jar",
15+
"chunk_mailbox",
16+
"get_searcher",
17+
]

0 commit comments

Comments
 (0)