md-first memory extraction framework for AI agents. Markdown is the single source of truth; SQLite holds state and LanceDB provides the rebuildable vector + BM25 + scalar index. The codebase follows a single-direction DDD layering (entrypoints -> service -> memory -> infra, with component / core / config cross-cutting) enforced by import-linter. Engineering surface: - Coding conventions in .claude/rules/ (path-scoped) and workflows in .claude/skills/ (/commit, /new-branch, /pr). - GitHub Actions CI runs make lint + test + integration; pre-commit mirrors the gates locally (ruff, hygiene hooks, gitlint commit-msg). - Commit messages follow Conventional Commits, enforced by gitlint. - make lint also enforces datetime two-zone discipline and OpenAPI drift.
32 lines
954 B
Python
32 lines
954 B
Python
"""Parsed-markdown data type.
|
|
|
|
The output shape of :class:`MarkdownReader` is held here, separate
|
|
from the reader implementation: callers that only consume parse
|
|
results don't need to import the reader machinery, and downstream
|
|
modules (writer, business readers) can produce :class:`ParsedMarkdown`
|
|
without going through ``MarkdownReader.read`` if they already hold
|
|
the pieces.
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
from dataclasses import dataclass, field
|
|
from typing import Any
|
|
|
|
from .entries import Entry
|
|
|
|
|
|
@dataclass(frozen=True)
|
|
class ParsedMarkdown:
|
|
"""A markdown document after parsing.
|
|
|
|
Attributes:
|
|
frontmatter: Parsed YAML mapping (empty dict if no frontmatter block).
|
|
body: Document text after the frontmatter block; not entry-stripped.
|
|
entries: Marker-delimited entries discovered inside ``body``.
|
|
"""
|
|
|
|
frontmatter: dict[str, Any]
|
|
body: str
|
|
entries: list[Entry] = field(default_factory=list)
|