Give with_openviking_context a deterministic lifecycle owner, reuse adapter clients without sharing invocation state, and preserve loop-scoped async behavior. Make component copies lifecycle-safe and reject post-close use before history access.
* fix(langchain): make async recording concurrency-safe
* fix(langchain): scope async state to each invocation
* fix(langchain): preserve cancellation progress on Python 3.10
* feat(grep): integrate VikingDB bm25 keyword search for grep engine
* fix(grep): address CI review feedback: max-size eviction to _count_cache, use Literal, Split regex alternation into individual keywords for bm25 (max 10)
* fix(schema): use dynamic __version__ for schema_version and handle dev suffixes in version comparison
* fix(schema): upsert data to vikingdb lack of content
* chore: add benchmark for retrieval
* fix(grep): vikingdb return 200 and no results means no matching content, not necessary to fallback to local fs
* fix(benchmark): sub uri args; add report
* refactor: code format by ruff
* optimize: move grep config (engine and switch_to_remote_threshold) to ov.conf
* optimize: auto adapt remote_return_limit by agg API; rm unnecessary params in keywords search
* fix: adjust benchmark scripts
* fix(grep): store full content for BM25; use PathScope depth; reduce redundant API calls
* refactor: new benchmark
* fix: step1 add resource by real code data
* feat(benchmark): split grep benchmark into effectiveness/performance suites with async reindex
* optimize (benchmark): adjust keywords and ground truth for testing
* fix: truncate 64KB for content field
* optimize: effectiveness add resource plainly
* optimize: change param use of SearchByKeywords from "keywords" to "query"
* optimize(benchmark): refactor effectiveness scripts
* optimize: ensure raw data for content field
* optimize: fulltext analyzer's stop-words only use symbols
* fix: adapt to new ov cli for benchmark
* optimize: reuse file content to avoid re-read AGFS file
* optimize: tune grep vikingdb defaults and refresh bm25 benchmark scripts
* optimize: benchmark client timeout
* update README
* fix: rm unused param
* fix: default values in docs
* optimize: increase truncate byte size to 1MB for content field for VikingDB
* fix(logger): harden queued stream logging (#2786)
* fix(logger): replace StreamHandler with QueueHandler+QueueListener to prevent thread deadlock
When log.output='stdout' (default) and the server is managed by systemd,
concurrent log writes can deadlock because logging.StreamHandler holds a
thread lock across stream.flush() which blocks on systemd-piped file I/O.
During session.commit() phase 2, multiple async coroutines (memory
extraction, summarization) concurrently call logger.info()/warning()
with large payloads. The first thread's flush() blocks on the pipe,
while all subsequent threads block on handler.acquire() forever.
This permanently silences the server log and prevents _write_done_file()
from executing, leaving phase 2 hanging without .done.
Fix: use QueueHandler + QueueListener from stdlib logging.handlers
(Python 3.2+). QueueHandler.emit() does queue.put(record) with no lock
or I/O, returning immediately. QueueListener has a dedicated single
thread as the sole consumer touching the real StreamHandler, making
lock contention impossible.
Changes in _create_log_handler(): stdout/stderr branches now create
a shared QueueListener with unbounded queue, returning QueueHandler
instances to callers. _build_standard_handler() delegates formatter
and filter setup to the real handler in the listener thread.
Closes: #2752
* fix(logger): harden queued stream logging
---------
Co-authored-by: njuboy11 <njuboy11@users.noreply.github.com>
---------
Co-authored-by: Qin Haojie <qinhaojie.exe@bytedance.com>
Co-authored-by: njuboy11 <njuboy11@users.noreply.github.com>
* feat(memory): rename agent_memory_enabled to disable_agent_memory with inverted default
Agent memory (trajectory/experience extraction) is now on by default.
Use `disable_agent_memory: true` in ov.conf to opt out.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(memory): add backward compat for deprecated agent_memory_enabled config field
Configs with agent_memory_enabled would fail validation due to extra="forbid".
Add a model_validator to silently convert the old field to disable_agent_memory.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* revert: remove unnecessary backward compat for agent_memory_enabled
No existing users, no migration needed.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* refactor(memory): keep agent_memory_enabled name, change default to true
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* chore: gitignore integration test tmp dirs
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* test: restore RUN_AGENT_MEMORY_TESTS guard for agent memory e2e
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Previously, experience files stored trajectory URIs in extra_fields["source_trajectories"],
a system-managed field capped at 5 entries. This duplicated the mem-link infrastructure
(StoredLink, merge_links, write_stored_links) introduced in #2010.
This change removes source_trajectories entirely and uses StoredLink as the canonical
representation: a single directed edge StoredLink(from=exp, to=traj, link_type="derived_from")
is written per trajectory. write_stored_links automatically propagates the forward link to
exp.links and the reverse reference to traj.backlinks, enabling navigation in both directions
without storing two separate edges.
Also applies experimentally validated prompt improvements (E1 avg +0.019 vs baseline):
- experiences.yaml: add EXECUTION-FIRST PRINCIPLE, CONDITIONAL BRANCH PRESERVATION,
and ATOMIC SCOPE rules (hard limit: Approach > 8 bullets → split)
- agent_experience_context_provider.py: replace "merge" bias with "split over merge",
reframe output as one entry per user intent, add final reminder in prefetch message
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
* auto-commit before eval 20260509_181850
* auto-commit before eval 20260509_192618
* update
* auto-commit before eval 20260510_005109
* auto-commit before eval 20260510_011832
* auto-commit before eval 20260510_014114
* auto-commit before eval 20260510_022835
* auto-commit before eval 20260510_025048
* auto-commit before eval 20260510_031034
* auto-commit before eval 20260510_143728
* auto-commit before eval 20260510_172705
* auto-commit before eval 20260510_220133
* auto-commit before eval 20260511_115905
* auto-commit before eval 20260511_121959
* auto-commit before eval 20260511_132120
* auto-commit before eval 20260511_161430
* auto-commit before eval 20260511_163606
* auto-commit before eval 20260511_173943
* auto-commit before eval 20260511_175657
* auto-commit before eval 20260511_224347
* auto-commit before eval 20260511_233109
* auto-commit before eval 20260512_104710
* auto-commit before eval 20260512_111256
* auto-commit before eval 20260512_181905
* auto-commit before eval 20260512_191540
* auto-commit before eval 20260512_192540
* auto-commit before eval 20260512_195710
* auto-commit before eval 20260513_000746
* auto-commit before eval 20260513_004221
* auto-commit before eval 20260513_004656
* refactor: migrate logger calls to tracer in extract_loop modules
Replace logger.warning/error/info with tracer.error/info in extract_loop
related modules for better observability (console + OpenTelemetry spans).
Modules updated:
- agent_experience_context_provider.py (5 replacements)
- extract_loop.py (4 replacements)
- memory_updater.py (9 replacements)
- session_extract_context_provider.py (4 replacements)
- utils/json_parser.py (7 replacements)
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* auto-commit before eval 20260513_123007
* auto-commit before eval 20260513_125305
* auto-commit before eval 20260513_135421
* auto-commit before eval 20260513_141013
* auto-commit before eval 20260513_143455
* auto-commit before eval 20260513_145401
* auto-commit before eval 20260513_163345
* auto-commit before eval 20260514_105906
* auto-commit before eval 20260514_112912
* auto-commit before eval 20260514_120308
* auto-commit before eval 20260514_122022
* auto-commit before eval 20260514_134800
* auto-commit before eval 20260514_135615
* auto-commit before eval 20260514_135818
* auto-commit before eval 20260514_142941
* auto-commit before eval 20260514_162401
* auto-commit before eval 20260514_231859
* auto-commit before eval 20260515_104122
* auto-commit before eval 20260515_122140
* auto-commit before eval 20260515_122942
* auto-commit before eval 20260515_144941
* auto-commit before eval 20260515_154736
* auto-commit before eval 20260515_181643
* auto-commit before eval 20260515_182727
* auto-commit before eval 20260515_183056
* auto-commit before eval 20260515_183652
* auto-commit before eval 20260515_183825
* auto-commit before eval 20260515_202731
* auto-commit before eval 20260516_001144
* auto-commit before eval 20260516_011749
* auto-commit before eval 20260516_015903
* auto-commit before eval 20260516_020505
* auto-commit before eval 20260516_130701
* auto-commit before eval 20260516_144342
* auto-commit before eval 20260516_151043
* Harden memory graph rendering and patch guidance.
Escape embedded graph data for script safety, add a vis-network load guard, tighten graph layout defaults, and clarify SEARCH guidance so patch content stays bound to the target file/page context.
🤖 Generated with [Aiden x Claude Code]
Co-Authored-By: Aiden
* auto-commit before eval 20260517_005258
* auto-commit before eval 20260517_012903
* auto-commit before eval 20260517_014036
* auto-commit before eval 20260517_015726
* auto-commit before eval 20260517_024952
* auto-commit before eval 20260517_032518
* auto-commit before eval 20260517_135114
* auto-commit before eval 20260517_143238
* auto-commit before eval 20260517_154858
* auto-commit before eval 20260517_200556
* auto-commit before eval 20260517_215025
* fix: keep memory storage plain and render graph links on display
Store memory bodies as plain text in VikingFS and move link rendering to graph display so repeated writes no longer persist nested markdown links. Also tighten link renderer path handling so cross-user relative paths are rejected and strip_links preserves viking and absolute targets.
🤖 Generated with [Aiden x Claude Code]
Co-Authored-By: Aiden
* auto-commit before eval 20260518_001945
* fix: invert selected graph node colors
Make the currently selected memory node use a light background with dark text so it stands out against the dark graph theme.
🤖 Generated with [Aiden x Claude Code]
Co-Authored-By: Aiden
* auto-commit before eval 20260518_011327
* update
* auto-commit before eval 20260518_161813
* auto-commit before eval 20260518_165104
* auto-commit before eval 20260518_174259
* update
* auto-commit before eval 20260518_224834
* auto-commit before eval 20260518_233319
* auto-commit before eval 20260518_235712
* auto-commit before eval 20260519_135952
* fix memory patch failure logging
Keep dry-run patch validation from emitting a misleading patch_handler warning, and record skipped field updates from MemoryUpdater where the failure is handled.
🤖 Generated with [Aiden x Claude Code]
Co-Authored-By: Aiden
* auto-commit before eval 20260519_213142
* fix(memory): fan out links for shared page ids
Expand _resolve_links so shared page ids resolve across every operation URI instead of collapsing to a single path. Align the page-id and extract-loop tests with the current API contract and the multi-URI link behavior.
🤖 Generated with [Aiden x Claude Code]
Co-Authored-By: Aiden
* auto-commit before eval 20260520_195141
* auto-commit before eval 20260520_215911
* auto-commit before eval 20260520_222335
* update
* style(memory): clean up formatter drift
Apply the remaining formatter-driven cleanup in the memory modules so the working tree stays clean before the next behavior changes. This keeps helper signatures and string literals aligned with current lint output.
🤖 Generated with [Aiden x Claude Code]
Co-Authored-By: Aiden
* auto-commit before eval 20260521_130517
---------
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
* chore(format): align python and c++ file formatting
* chore: update urllib3 to 2.7.0 and clean test imports
1. bump urllib3 dependency from 2.6.3 to 2.7.0
2. remove unused pytest import and RoleScope import from test file
* style: format list comprehensions and lambda function for readability
Adjust the line breaks in the list comprehension in the VikingSearchTool class to follow standard Python formatting conventions, and rewrap the lambda assignment in the test case to improve code readability without changing functionality.
* style: fix line wrapping and remove extra blank line
- remove stray blank line in ov_server.py
- wrap long logger.info line in memory.py for better readability
* style: fix targeted ruff lint violations
* chore: clean up unused imports and reorder code
This commit removes unused imports, reorders import statements for better consistency,
and simplifies some test file imports. Changes include:
- Remove redundant blank lines and unused imports across multiple test files and core modules
- Reorder imports in openviking hooks module to follow standard layout
- Fix import ordering in memory isolation handler
- Simplify php parser type imports
- Move volcengine mock import to correct position in test file
* refactor(uri utils): remove extra blank lines in uri.py
clean up redundant whitespace to improve code readability
* feat(memory): improve agent memory pipeline reliability
- Add ReplaceOp merge type for full-replace semantics (no StrPatch diff)
- Add supersedes field to experiences schema for name-based replacement;
system resolves old URI, deletes it, and inherits its source_trajectories
- Fix source_trajectories inheritance leaking to all experiences in a batch:
now only the superseding experience receives inherited trajectory URIs via
a per-URI inheritance map returned from _resolve_supersedes
- Preserve system-managed metadata (source_trajectories) during experience
Update so the field is not silently dropped on every edit
- Guard against same-URI upsert+delete in one batch (Replace-same-name case)
- Deduplicate LLM output by immutable key to prevent duplicate memory files
- Auto-exclude delete_uris from output schema for add_only schemas
- Simplify trajectory extraction prompt: hard one-per-conversation constraint
- Rewrite experience extraction prompt: supersedes-based design replaces the
previous 4-strategy (Update/Replace/Create/Skip) framework
- Run archive summary generation concurrently with memory extraction
- Add acquire_mixed_batch to LockManager for mixed point/subtree locking
- Add init_tracer_from_config helper for test environments
- Add e2e integration test for two-phase agent memory pipeline
* refactor(memory): remove redundant dedup in resolve_operations
* feat(ovpack): add v2 manifest and conflict policy
Add a portable OVPack manifest for scalar metadata and make imports validate scope, derived files, and conflicts before writing.
* fix(ovpack): remove import vectorize option
Make OVPack imports always rebuild vectors in the target environment, keep legacy packages compatible, and reject unsupported manifest versions before writing.
* fix(ovpack): remove force import alias
Use on_conflict as the single OVPack import conflict policy and reject removed force inputs.
* fix(ovpack): regenerate runtime vector metadata
Keep type portable but stop exporting or applying created_at, updated_at, and active_count from OVPack manifests.
* fix(ovpack): validate manifest contents
* fix(ovpack): require manifests for imports
* fix(ovpack): close manifest validation gaps
* fix(ovpack): defer parent creation until validation passes
* fix(ovpack): remove export size guard
* fix(ovpack): support session and scope-root restores
* docs(ovpack): document full backup migration
* feat(ovpack): add backup restore workflow
* fix(ovpack): validate import scope compatibility
* feat(memory): add agent trajectory and experience extraction
Add a two-phase agent memory pipeline with schema-driven trajectory and experience extraction, plus system-managed source trajectory tracking.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat(memory): wire agent memory extraction into session flow
Enable the agent memory pipeline behind config and invoke trajectory/experience extraction during session memory processing.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat(memory): agent memory pipeline — trajectory timestamps, experience merge, concurrent extraction
- Trajectory filenames now include a timestamp suffix (via _stamp_trajectory_names
in compressor_v2 before apply_operations), so trajectory_name in both the
filename and MEMORY_FIELDS carries the full timestamped name
- Experience extraction: add merge operation (write generalized + delete_uris),
fix delete lock conflict (pass lock_handle to viking_fs.rm), and inherit
source_trajectories from deleted experiences before merge
- Near-duplicate trajectory dedup removed from memory_updater; delete moved
before write to avoid AGFS sibling lock contention
- session.py: restore user memory extraction and run user + agent memory
concurrently via asyncio.gather (agent memory gated by agent_memory_enabled)
- directories.py: trajectories and experiences directories added to agent
memory preset with abstract/overview; cases and patterns removed
- Simplify trajectory/experience YAML descriptions and instructions
- extract_loop: skip refetch for add_only schemas; add logging for URI resolution
and operation dispatch to aid diagnosis of duplicate experience writes
- demo_agent_memory.py: replace three-round demo with two same-domain rounds
to specifically test the experience edit path
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat(memory): add agent_only flag to prevent user memory from processing trajectory/experience
- Add `agent_only: true` to trajectory.yaml and experience.yaml schemas
- Add `agent_only` field to `MemoryTypeSchema` dataclass
- Parse `agent_only` from YAML in `MemoryTypeRegistry._parse_memory_type`
- Filter out agent_only schemas in both `prefetch` and `get_memory_schemas`
in `SessionExtractContextProvider`, so trajectory/experience are only
processed by the agent memory extraction pipeline
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* test(memory): add e2e integration test for agent memory two-phase pipeline
- test_trajectory_and_experience_extraction: runs two same-domain sessions,
asserts Round 1 creates the experience and Round 2 edits it (no duplicate),
and verifies all trajectory filenames carry a timestamp suffix
- test_no_agent_only_schemas_in_user_memory: unit-level check that
trajectory/experience schemas are filtered out of SessionExtractContextProvider
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* chore: remove demo_agent_memory.py, replaced by integration test
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat(memory): agent memory two-phase pipeline — trajectory + experience extraction
Phase 1 (trajectory): extract execution summaries from conversation, one per business domain.
Phase 2 (experience): prefetch top-5 candidate experiences + source trajectories, single no-tool
LLM call to Update/Replace/Create/Skip.
Key changes:
- AgentExperienceContextProvider: rewrite as prefetch-all + single no-tool call; top-3 candidates
include source_trajectories for grounding; prefetched_uris tracked to skip refetch check
- AgentTrajectoryContextProvider: remove read tool (was causing hallucination); tighten instruction
- ExtractLoop: fix prefetch URI tracking (old format was broken); guard tool_choice on empty tools
- compressor_v2: deserialize trajectory content before passing to experience phase; restore
user/agent memory concurrent execution in session.py
- memory_updater: downgrade diff_match_patch ImportError from tracer.error to tracer.info
- volcengine_vlm: trace tool calls and response content separately
- experience/trajectory yaml: refine field descriptions and Reflect section wording
- e2e test: add skipif guard, tracer init, two-iteration loop, persistent demo dir
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* chore(memory): remove unused source trajectory tool and noisy prints
Drop the unused get_source_trajectories memory tool after phase-2 moved to
prefetch-only context, and replace source_trajectory debug prints with tracer logs.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat(client): support explicit embedded user for agent memory tests
Allow LocalClient to accept an explicit UserIdentifier and add an integration test covering user+agent agent-memory isolation in embedded mode.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat:test
* feat(agent-memory): prefetch experience files into read_file_contents + cap source_trajectories
- AgentExperienceContextProvider.prefetch now populates _read_file_contents for
each candidate experience, fixing two issues on the Replace path:
1. resolve_operations could never find delete_file_contents → old file was never deleted
2. inherited_traj_uris was always empty → source_trajectories not inherited
On the Update path this also eliminates the extra _check_unread_existing_files
LLM round-trip that was previously triggered for every edit.
- Move deserialize_content/deserialize_metadata imports from inline to module top.
- AgentTrajectoryContextProvider.prefetch signature simplified (no unused args).
- _append_trajectories_to_experiences: cap source_trajectories at 5 most recent URIs
to prevent unbounded growth over many sessions (MAX_SOURCE_TRAJECTORIES = 5).
- e2e test cleaned up: single focused test, remove redundant Replace-path tests,
filter .abstract.md in _list_non_overview_entries.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat(agent-memory): update experience and trajectory memory schema prompts
- experience.yaml: restructure content format from 4-section to 3-section
(Situation / Approach / Reflect), rewrite rules to emphasize machine
readability, mutual exclusivity between Approach and Reflect, and
abstraction mandate for generalization.
- trajectory.yaml: extend content format with explicit Trajectory steps
(intent + actions + progress) and Fail reason field; add exhaustive
tracking and tool-call formatting rules.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(agent-memory): harden memory pipeline robustness
- session.py: use gather(return_exceptions=True) so user and agent
memory tasks fail independently; each side logs its own error and
falls back to [] instead of losing the other side's results
- compressor_v2: remove redundant rm before write_file in
_append_trajectories_to_experiences — agfs PUT is atomic overwrite,
so the prior delete only added a data-loss window; also drop the
duplicate ExtractContext/MemoryIsolationHandler construction in
_run_extract_phase and fix its outdated docstring
- extract_loop: remove stray blank line after prefetch tracking block
- memory_updater: remove extra blank line inside class body
- experience.yaml / trajectory.yaml: add missing trailing newlines
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat:fix agent memory test
* chore(memory): rename experience.yaml→experiences.yaml, trajectory.yaml→trajectories.yaml
* chore(memory): rename memory_type experience→experiences, trajectory→trajectories
* chore(memory): remove dead _read_files tracking in extract_loop
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat(session): add account namespace policy and shared sessions
Unify namespace resolution across filesystem, indexing, and session storage.
Add account-shared session paths, role_id auth semantics, and an HTTP demo
script for the four namespace-policy combinations.
* space
* fix(pack): skip derived semantic files in ovpack transfer
Keep ovpack imports resilient to stale sidecars and rebuild semantics through the normal queue instead of restoring derived files verbatim.
* Revert "fix(pack): skip derived semantic files in ovpack transfer"
This reverts commit f4e4db8401.
* fix(namespace): default legacy accounts to agent-shared policy
Clarify that memory.agent_scope_mode is deprecated and document the supported agent memory migration paths.
* refactor: all env are listed in openviking_cli/utils/config/consts.py
* refactor: all env are listed in openviking_cli/utils/config/consts.py
* refactor: all env are listed in openviking_cli/utils/config/consts.py
* refactor: all env are listed in openviking_cli/utils/config/consts.py
* refactor: all env are listed in openviking_cli/utils/config/consts.py
---------
Co-authored-by: openviking <openviking@example.com>
* feat(examples): add Codex memory plugin example
* fix(codex-memory-plugin): wait for delete consistency
Wait for memory_forget deletions to settle before reporting success so the Codex adapter does not claim a delete while content/read can still see the memory in the same context.
* docs(examples): add Codex plugin QA evidence
* feat(examples): make Codex memory plugin hook-first
* fix(api): harden filesystem content checks
* fix(tests): use concrete fake embedder in quick start lite
* refactor(examples): simplify codex memory plugin
* fix(examples): tighten Codex MCP config
* test(examples): guard fake embedder dimensions
* fix(examples): route Codex memory MCP by configured user
* docs: fix docker deployment
* reorg: remove third_party/agfs
* feat(s3fs): add disable_batch_delete option for OSS compatibility
Port of PR #1333 from Go version to Rust:
- Add disable_batch_delete config option to S3Client
- When enabled, use sequential single-object deletes instead of DeleteObjects
- This is for S3-compatible services like Alibaba Cloud OSS that require
Content-MD5 for DeleteObjects but AWS SDK v2 does not send it by default
- Add documentation and config example for OSS
* fix(s3fs): pass disable_batch_delete config from Python to Rust
Add disable_batch_delete to the s3_plugin_config dict in _generate_plugin_config
so that the Python config can properly control the Rust S3FS plugin's behavior.
* reorg: remove third_party/agfs
* reorg: remove third_party/agfs
* change some docs
* change some docs
---------
Co-authored-by: openviking <openviking@example.com>
Update docs, tests, and example integrations to reflect accepted + task_id
session commits with task polling for completed results.
Also fix the local PR-Agent model provider prefix in .pr_agent.toml.
* refactor(model): unify config-driven retry across VLM and embedding
Move retry behavior into shared model-call utilities and config defaults so VLM and embedding providers handle transient failures consistently.
Co-Authored-By: Claude Opus 4.6
* fix
* docs(config): document model retry settings
* lisence: change the main lisence from Apache-2.0 to AGPL-v3
* lisence: change the main lisence from Apache-2.0 to AGPL-v3
* lisence: change the main lisence from Apache-2.0 to AGPL-v3
---------
Co-authored-by: openviking <openviking@example.com>
* docs: add memory extractor templating and update mechanism optimization design document
- Add bilingual (English/Chinese) design document for memory templating system
- Include YAML-based MemoryTypeRegistry with 8 built-in types
- Detail ReAct 3+1 phase flow with pre-fetch optimization
- Describe 3-operation Schema: write/edit/delete
- Document RoocodePatch SEARCH/REPLACE format
- Explain dual-mode design: simple mode vs template mode
- Cover pre-fetch optimization: ls directories + read .abstract.md/.overview.md + search once
- Include merge operations: patch, sum, avg, immutable
- Address #578: allow custom prompt template addition and specification
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* feat: add memory templating system with ReAct orchestrator
- Add YAML-configurable memory schemas (cards, events, entities, etc.)
- Implement MemoryReAct with tool use (read/find/ls)
- Add schema-driven memory operations (write_uris/edit_uris/delete_uris)
- Implement memory patch handler for incremental updates
- Add comprehensive test suite
* refactor: memory extractor templating system with ReAct orchestrator
## Summary
Implement memory templating system (GitHub Issue #578) - a complete
rewrite of the memory extractor subsystem to support YAML-configurable
memory types instead of hardcoded categories.
## Key Changes
### Architecture
- Replace hardcoded 8 memory types with YAML-configurable schema system
- Add MemoryTypeRegistry to load memory type definitions from YAML files
- Dynamic Pydantic model generation from schema for type safety
- Field-level merge operations: PATCH, SUM, IMMUTABLE
### Memory Extraction Flow
- Implement ReAct orchestrator for single-pass memory updates
- MemoryUpdater for applying operations to storage
- Memory tools (read, search, ls) for ReAct loop
- Stable JSON parser with 5-layer fault tolerance
### File Naming & Storage
- Semantic filenames from template ({topic}.md instead of random IDs)
- Two memory modes: simple mode and template mode
- MEMORY_FIELDS HTML comment for structured metadata
### Configuration
- 9 YAML templates in openviking/prompts/templates/memory/
- memory_config.py for memory system configuration
- Dual-threshold compact upload mechanism in design doc
### Deletions
- Remove old memory_content.py, memory_data.py, memory_operations.py
- Remove memory_types.py, memory_utils.py, memory_patch.py
- Remove corresponding old test files
### Updated Components
- VLM backends (litellm, openai, volcengine) for new interfaces
- Session and service core integration
- Test suite for new architecture
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: pass ctx/user/session_id in commit_async for memory extraction
## Summary
Fix missing parameters in commit_async() when calling extract_long_term_memories().
The synchronous commit() method correctly passes these parameters, but the async
version was missing them, causing memory extraction to be skipped.
## Changes
- Pass user=self.user, session_id=self.session_id, ctx=self.ctx
in commit_async() when calling extract_long_term_memories()
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: convert FindResult to dict before returning from search tool
## Summary
Fix JSON serialization error by converting FindResult object to dict
using its to_dict() method before returning from MemorySearchTool.
## Changes
- In MemorySearchTool.execute(), return search_result.to_dict()
instead of search_result directly
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: swap None check before accessing final_operations in memory_react
Also rename schema_models.py to schema_model_generator.py for clarity.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* feat: add edit_overview support and optimize memory registry initialization
- Add edit_overview_operations to MemoryUpdater for updating .overview.md files
- Optimize MemoryTypeRegistry initialization in SessionCompressorV2 (load once)
- Various memory templating system improvements
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: remove unnecessary indent in JSON schema output
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* docs: add markdown link format hint to overview field description
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* feat: add pre-fetch search based on user messages in conversation
Also fix duplicate line in system prompt.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* rebase
* feat: add vectorization for memory files and overview format
- MemoryUpdater now vectorizes written/edited memory files after apply_operations
- MemoryReAct generates overview following semantic.overview_generation.yaml format
- Auto-extract and write .abstract.md from overview in memory_updater
- Fix import: VikingURI is from openviking_cli.utils.uri
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* docs: update bot README to use openviking-server --with-bot and ov chat
- Change vikingbot gateway to openviking-server --with-bot
- Change vikingbot chat to ov chat
- Update --no-markdown to --no-format
- Remove --logs flag (not available)
- Simplify CLI Reference table
- Also update Chinese README_CN.md
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* test: rewrite xiaomei memory demo as standalone script
Convert from pytest to standalone script with:
- SyncHTTPClient instead of AsyncHTTPClient
- Rich for pretty console output
- Phase control (ingest/verify/all)
- Better error handling and progress display
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* refactor: use markdown links in overview instead of numeric references
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: remove duplicate code from copy-paste residue
- Remove duplicate logger and create_session_compressor in session/__init__.py
- Remove duplicate MemoryConfig import in open_viking_config.py
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
* docs: add memory extractor templating and update mechanism optimization design document
- Add bilingual (English/Chinese) design document for memory templating system
- Include YAML-based MemoryTypeRegistry with 8 built-in types
- Detail ReAct 3+1 phase flow with pre-fetch optimization
- Describe 3-operation Schema: write/edit/delete
- Document RoocodePatch SEARCH/REPLACE format
- Explain dual-mode design: simple mode vs template mode
- Cover pre-fetch optimization: ls directories + read .abstract.md/.overview.md + search once
- Include merge operations: patch, sum, avg, immutable
- Address #578: allow custom prompt template addition and specification
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* feat: add memory templating system with ReAct orchestrator
- Add YAML-configurable memory schemas (cards, events, entities, etc.)
- Implement MemoryReAct with tool use (read/find/ls)
- Add schema-driven memory operations (write_uris/edit_uris/delete_uris)
- Implement memory patch handler for incremental updates
- Add comprehensive test suite
* refactor: memory extractor templating system with ReAct orchestrator
## Summary
Implement memory templating system (GitHub Issue #578) - a complete
rewrite of the memory extractor subsystem to support YAML-configurable
memory types instead of hardcoded categories.
## Key Changes
### Architecture
- Replace hardcoded 8 memory types with YAML-configurable schema system
- Add MemoryTypeRegistry to load memory type definitions from YAML files
- Dynamic Pydantic model generation from schema for type safety
- Field-level merge operations: PATCH, SUM, IMMUTABLE
### Memory Extraction Flow
- Implement ReAct orchestrator for single-pass memory updates
- MemoryUpdater for applying operations to storage
- Memory tools (read, search, ls) for ReAct loop
- Stable JSON parser with 5-layer fault tolerance
### File Naming & Storage
- Semantic filenames from template ({topic}.md instead of random IDs)
- Two memory modes: simple mode and template mode
- MEMORY_FIELDS HTML comment for structured metadata
### Configuration
- 9 YAML templates in openviking/prompts/templates/memory/
- memory_config.py for memory system configuration
- Dual-threshold compact upload mechanism in design doc
### Deletions
- Remove old memory_content.py, memory_data.py, memory_operations.py
- Remove memory_types.py, memory_utils.py, memory_patch.py
- Remove corresponding old test files
### Updated Components
- VLM backends (litellm, openai, volcengine) for new interfaces
- Session and service core integration
- Test suite for new architecture
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: pass ctx/user/session_id in commit_async for memory extraction
## Summary
Fix missing parameters in commit_async() when calling extract_long_term_memories().
The synchronous commit() method correctly passes these parameters, but the async
version was missing them, causing memory extraction to be skipped.
## Changes
- Pass user=self.user, session_id=self.session_id, ctx=self.ctx
in commit_async() when calling extract_long_term_memories()
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: convert FindResult to dict before returning from search tool
## Summary
Fix JSON serialization error by converting FindResult object to dict
using its to_dict() method before returning from MemorySearchTool.
## Changes
- In MemorySearchTool.execute(), return search_result.to_dict()
instead of search_result directly
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: swap None check before accessing final_operations in memory_react
Also rename schema_models.py to schema_model_generator.py for clarity.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* feat: add edit_overview support and optimize memory registry initialization
- Add edit_overview_operations to MemoryUpdater for updating .overview.md files
- Optimize MemoryTypeRegistry initialization in SessionCompressorV2 (load once)
- Various memory templating system improvements
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix: remove unnecessary indent in JSON schema output
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* docs: add markdown link format hint to overview field description
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* feat: add pre-fetch search based on user messages in conversation
Also fix duplicate line in system prompt.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* rebase
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>