Self-evolving Context Database for AI Agents. Unify Agent Memory, Knowledge RAG and Skills.
Python agent-contextagent-memoryagent-pluginsagentic-ragcontext-databasedsh-pluginknowledge-basememorymemory-managementself-evolvingvector-database
memory_type: events
description: |
# Guidelines
- Each event must be atomic: capture exactly one real-world occurrence, decision, commitment, arrangement, proposal, progress update, or result.
- Prefer precise, small events over comprehensive narratives. Do not merge independent sub-events just because they appear in the same chat.
- The summary must include the key fact that makes the event worth remembering, especially commitments, agreements, proposals, confirmations, schedule changes, ownership assignments, and outcomes that may be referenced later.
- If there is a time expression (such as "yesterday"), convert it to a specific year-month-day date based on when the event occurred.
- Convert dialogue into indirect speech and preserve the concrete facts, who said/did what, and the outcome.
- Use a third-person perspective.
- Record content that mentions time.
- Each event should represent a REAL-WORLD occurrence discussed in the conversation (e.g., a pottery class, a road trip, a meteor shower), NOT the conversation itself. A conversation is the medium, not the event.
- Split multi-topic conversations into separate events by topic.
- Even within one continuous topic, create separate events when ANY of the following changes:
- the main goal or subject
- the time anchor
- the decision, proposal, or commitment
- the responsible person or participants
- the outcome or status
- It is allowed and encouraged to extract multiple events from one continuous block of messages when that block contains multiple independent decisions, commitments, plans, or results.
- Do NOT name events after who was chatting. Name them after what specifically happened.
- Avoid broad umbrella events such as "team arrangement", "project discussion", "weekend plan", or "meeting chat" when the conversation actually contains multiple smaller actionable sub-events.
# Granularity Examples
## Bad Example
Conversation facts:
- They proposed having dinner on Friday.
- They confirmed a meeting for next Monday.
- Xiaoming promised to bring the projector.
Bad extraction:
- event_name: 团队安排
summary: They discussed team arrangements, including dinner, next week's meeting, and equipment preparation.
Why bad:
- It merges a proposal, a schedule confirmation, and a commitment into one coarse event.
## Good Example
Good extraction:
- event_name: 周五聚餐提议
summary: A Friday dinner was proposed.
- event_name: 下周一会议确认
summary: A meeting for next Monday was confirmed.
- event_name: 投影仪携带承诺
summary: Xiaoming committed to bring the projector.
Why good:
- Each event contains one decision/proposal/commitment only.
## Bad Example
Conversation facts:
- The launch was postponed to June 3.
- Lina became the owner of the release checklist.
Bad extraction:
- event_name: 发布调整
summary: They adjusted the release plan, including postponement and ownership changes.
Why bad:
- It merges a schedule change and an ownership assignment.
## Good Example
Good extraction:
- event_name: 上线延期确认
summary: The launch was postponed to 2026-06-03.
- event_name: 清单负责人确认
summary: Lina was assigned as the owner of the release checklist.
Why good:
- The time change and the owner assignment are stored as separate atomic events.
## Bad Example
Conversation facts:
- The team started implementation of the sync feature.
- Work was blocked by a dependency issue.
- The work resumed after the dependency was fixed.
- The rollout was completed later that week.
Bad extraction:
- event_name: sync_feature_progress
summary: The sync feature moved forward from implementation to blockage, recovery, and completion.
Why bad:
- It compresses a multi-stage timeline into one coarse event.
## Good Example
Good extraction:
- event_name: sync_feature_started
summary: The team started implementation of the sync feature.
- event_name: dependency_blocker_hit
summary: Work on the sync feature was blocked by a dependency issue.
- event_name: sync_work_resumed
summary: Work on the sync feature resumed after the dependency was fixed.
- event_name: rollout_completed
summary: The rollout of the sync feature was completed later that week.
Why good:
- A start, a blocker, a resumption, and a completion are four separate status changes and should be stored as four atomic events.
directory: "viking://user/{{ user_space }}/memories/events"
filename_template: "{{ extract_context.get_year(ranges) }}/{{ extract_context.get_month(ranges) }}/{{ extract_context.get_day(ranges) }}/{{ event_name }}.md"
enabled: true
# 操作模式:add_only 表示只新增记忆,不需要查看之前的记忆列表
# upsert 表示新增或更新(默认行为)
operation_mode: "add_only"
content_template: |
{% set resource_event_content = extract_context.get_resource_event_content(ranges, summary) %}
{% if resource_event_content %}
{{ resource_event_content }}
{% else %}
# Summary
{{ summary }}
# {{extract_context.get_first_message_time_with_weekday_from_ranges(ranges|default(''))|default('N/A')}} ChatLog:
{{ extract_context.get_event_content(ranges, summary, 0) }}
{% endif %}
embedding_template: |-
EventName: {{ event_name }}
Goal: {{ goal }}
{{ content }}
overview_template: |-
# Events Overview
{% for item in items %}
- [{{ item.file_content.summary|default(item.file_name, true) }}](./{{ item.file_name }})
{% endfor %}
fields:
- name: event_name
type: string
description: |
Output a concise name for exactly one atomic real-world event.
Rules:
1. Must be written in {{ language }};
2. {% if language == 'en' %}Use lowercase with underscores instead of spaces, maximum 3 words;{% else %}Keep it concise and natural in {{ language }};{% endif %}
3. Never include any date, time, year or number;
4. Must name one specific proposal, decision, commitment, arrangement, progress update, or result — not a broad topic bucket;
5. Names ending with _chat, _talk, _conversation, _catchup, _discussion are forbidden;
6. Patterns like "person_chat", "chat_about_xxx", "daily_talk" are forbidden;
7. Broad names like "team arrangement", "project discussion", "weekend plan", "meeting topic" are forbidden if the source actually contains smaller sub-events;
8. Output only the event name, no extra explanation.
merge_op: immutable
- name: goal
type: string
description: |
Summarize the purpose of the content in 5 words or less
- name: summary
type: string
description: |
Based on the content of the above fields, compile a description to outline the complete Fact content.
Use specific year-month-day dates instead of vague terms such as yesterday, last week, and tomorrow.
- name: ranges
type: string
description: |
Conversation message index ranges to extract. Supports:
- Range: "start-end" (e.g., "0-3" means messages 0 to 3)
- Single index: "N" (e.g., "7" means only message 7)
- Mixed: "0-3,7,15-20" (ranges and single indices combined)
For events, ranges MUST include at least one user-role message that states or supports the event.
If an assistant message confirms, normalizes, or completes the event, include both the originating user message and the assistant message.
Never output assistant-only ranges for events.
merge_op: immutable