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.
39 lines
1.3 KiB
Python
39 lines
1.3 KiB
Python
"""AtomicFact frontmatter — daily-log markdown for user-scoped atomic facts.
|
|
|
|
Path: ``users/<scope_id>/.atomic_facts/atomic_fact-<YYYY-MM-DD>.md``.
|
|
|
|
The directory is dot-prefixed so it is hidden from end users (same
|
|
convention as ``.index``); atomic facts are framework-internal derived md,
|
|
not material the user is expected to read by hand.
|
|
|
|
Each entry carries one atomic fact extracted by the algo layer; the fact
|
|
always hangs off the source MemCell (see ``parent_type`` in each entry's
|
|
inline fields — handled at the StructuredEntry layer, not on the
|
|
file-level frontmatter).
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
import datetime as _dt
|
|
from typing import ClassVar, Literal
|
|
|
|
from everos.core.persistence.markdown import (
|
|
DailyLogPathMixin,
|
|
UserScopedFrontmatter,
|
|
)
|
|
|
|
|
|
class AtomicFactDailyFrontmatter(DailyLogPathMixin, UserScopedFrontmatter):
|
|
"""Frontmatter for ``users/<scope>/.atomic_facts/atomic_fact-<YYYY-MM-DD>.md``."""
|
|
|
|
ENTRY_ID_PREFIX: ClassVar[str] = "af"
|
|
DIR_NAME: ClassVar[str] = ".atomic_facts"
|
|
FILE_PREFIX: ClassVar[str] = "atomic_fact"
|
|
|
|
type: Literal["atomic_fact_daily"] = "atomic_fact_daily"
|
|
file_type: Literal["atomic_fact_daily"] = "atomic_fact_daily"
|
|
date: _dt.date
|
|
entry_count: int = 0
|
|
created_at: _dt.datetime | None = None
|
|
last_appended_at: _dt.datetime | None = None
|