feat: v0.17.0 Agent Memory vector storage + embedding externalization - #30
Merged
Merged
Conversation
…ector UDF - Remove 'embedding' from default Cargo features (Candle/Ollama now opt-in) - Schema v34: agent_memories.embedding BLOB + embedding_model + indexed_at - Add cosine_similarity SQLite UDF (little-endian f32 BLOB) - Add search_memories_semantic() — pure SQL vector search, no LLM runtime - New MCP tools: devkit_session_recall, devkit_session_index (60 total) - AgentMemory struct expanded with optional embedding fields - insert_memory signature updated with optional embedding/model args - test_helpers.rs SCHEMA_DDL synced to v34 - RFC: docs/RFC/agent-memory-vector-storage.md Refs: v0.17.0 design — devbase acts as vector database layer only, never generates embeddings. External providers (Ollama/OpenAI) produce vectors; devbase stores, indexes, and searches them.
… + keyword fallback - Replace naive 'list all memories' injection with tiered recall strategy - Tier 1: semantic recall via cosine_similarity UDF when embedding available - embedding feature enabled: use local Candle/Ollama - embedding feature disabled: call external endpoint (Ollama API format) - Tier 2: keyword fallback (LIKE search) when semantic unavailable - New env vars injected into skill runtime: - DEVBASE_CONTEXT_MEMORIES (now top-k relevant only, with score + model) - DEVBASE_CONTEXT_MEMORY_COUNT - DEVBASE_CONTEXT_RECALL_METHOD (semantic | keyword) - build_recall_query: skill_id + args concatenation as query text - call_external_embedding_endpoint: reqwest::blocking POST to /api/embeddings Refs: RFC docs/RFC/agent-memory-vector-storage.md §5.3
…eritance - Root Cargo.toml: 0.15.0 → 0.17.0-dev - 13 workspace crates: hardcoded version → version.workspace = true - CHANGELOG: add v0.17.0-dev, v0.16.1, v0.16.0 sections - End-to-end tests: mock Ollama /api/embeddings endpoint (2 cases)
- MainView: add Session variant (3-state cycle: Repo → Vault → Session) - render/session.rs: left panel context list (status icon + id + name) - render/session.rs: right panel memory detail (type icon + model + indexed tag) - state/mod.rs: load_sessions() + load_session_memories() on navigation - state/navigation.rs: next/previous/jump_to_top/jump_to_bottom for Session - event.rs: Enter refreshes selected session memories - render/mod.rs: Session detail rendered directly in ui() dispatcher - render/list.rs: delegate Session to session::render_session_list - render/detail.rs: Session branch (no-op, detail rendered at top level) - Fix test_main_view_toggle for 3-state cycle Refs: RFC docs/RFC/agent-memory-vector-storage.md §8 task list
…egration - Ollama installation (Windows/macOS/Linux) - Model pull instructions (nomic-embed-text / all-minilm) - config.toml [embedding] configuration examples - Verification steps: curl test + devbase session workflow - OpenAI API alternative (with compatibility notes) - Backward compatibility: --features embedding - Troubleshooting section for common errors Refs: RFC §8 external provider configuration documentation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
v0.17.0 核心架构迁移:devbase 从 LLM Runtime 退化为向量数据库层。Embedding 生成完全外置,devbase 仅负责存储、索引和相似性查询执行。
Changes
agent_memories新增embedding BLOB,embedding_model TEXT,indexed_at DATETIMEembedding从 default 移除;Candle/Ollama 降级为 opt-in--features embeddingcosine_similarity(blob, blob) -> real— 纯 SQL 向量搜索,零外部依赖devkit_session_recall,devkit_session_index(60 total)DEVBASE_CONTEXT_MEMORIES改为注入 top-k 相关 memories(含 score + model)Testing
cargo test --lib: 442 passed / 0 failed / 3 ignoredcargo check --all-targets: 0 errors / 0 warningsRFC
docs/RFC/agent-memory-vector-storage.mdBreaking Changes
--features embeddinginsert_memory签名扩展:新增可选embedding: Option<&[f32]>和embedding_model: Option<&str>