Skip to content

Self-evolving Context Database for AI Agents. Unify Agent Memory, Knowledge RAG and Skills.

981 B
Raw Blame
# Copyright (c) 2026 Beijing Volcano Engine Technology Co., Ltd.
# SPDX-License-Identifier: AGPL-3.0

from pathlib import Path

import pytest
import yaml
from jinja2 import Template


@pytest.mark.parametrize(
    "schema_path",
    [
        "openviking/system_assets/memory/memory_templates/builtin/entities.yaml",
        "openviking/system_assets/memory/memory_templates/builtin/experimental_memory/entities.yaml",
    ],
)
def test_entity_filename_is_case_insensitive(schema_path):
    schema = yaml.safe_load(Path(schema_path).read_text(encoding="utf-8"))
    template = Template(schema["filename_template"])

    lower_path = template.render(category="concept", name="smart")
    upper_path = template.render(category="CONCEPT", name="SMART")

    assert lower_path == upper_path == "concept/smart.md"
    fields = {field["name"]: field for field in schema["fields"]}
    assert fields["category"]["merge_op"] == "replace"
    assert fields["name"]["merge_op"] == "replace"