Commit Graph
5 Commits
Author SHA1 Message Date
9eac8a6d3d feat(sdk): sync go/ts/python SDKs with server find/search, recall, an… (#3737)
* feat(sdk): sync go/ts/python SDKs with server find/search, recall, and admin changes

Server-side changes recently landed that the language SDKs had drifted from:

- find/search results now return `tags` and no longer return
  `category`/`match_reason`/`relations`/`overview` (#3730). Go's strict
  struct was the only one broken; update MatchedContext accordingly.
- new admin endpoints for agent-evolution and per-account settings (#3695).
- public `search/recall` endpoint was missing from all SDKs.

Changes:
- python: add `level`/`since`/`until`/`time_field` to find/search; add an
  `extra` escape hatch to find/search/add_resource/write/batch_write so new
  server fields can be passed without an SDK bump (only forwarded when set,
  preserving `level=0`); add `recall` and the four admin methods.
- go: fix MatchedContext (add Tags, drop removed fields), add Recall and the
  four admin methods.
- typescript: type MatchedContext/FindResult, add RecallOptions, add `recall`
  and the four admin methods.

Co-authored-by: TRAE CLI <noreply@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>

feat(sdk): unify options APIs and sync latest server interfaces

- migrate complex Python SDK calls to typed options dictionaries
- add dedicated context search and consistent extra-field handling
- align Go and TypeScript options with omission-aware serialization
- support session config, event tags, Agent Evolution date filters,
  OpenViking Assets, batch write, downloads, and create_parent
- refresh SDK tests and examples across all three languages

Co-authored-by: TRAE CLI <noreply@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>

fix(sdk): address options API review findings

- fix Go session extra merging and Python message precedence
- adapt LangChain calls to the Python options API
- migrate repository examples, tests, and documentation

Co-authored-by: TRAE CLI <noreply@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>

fix(sdk): complete options migration and message parity

- migrate remaining Python SDK benchmarks to options dictionaries
- normalize empty parts consistently for single and batch messages
- add regression guards for repository SDK call sites

Co-authored-by: TRAE CLI <noreply@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>

fix(sdk): align reindex options after main rebase

- preserve reindex tags in Python typed options
- add reindex extra support for Go and TypeScript
- reject official fields passed through extra across SDKs

Co-authored-by: TRAE CLI <noreply@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>

feat(sdk): support legacy keyword options

Co-authored-by: TRAE CLI <noreply@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>

docs(sdk): use explicit Python SDK arguments

Co-authored-by: TRAE CLI <noreply@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>

fix(sdk): support set tags extra options

Co-authored-by: TRAE CLI <noreply@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>

fix(sdk): expose Go add resource options

Expose AddType and ProcessingMode through Go AddResourceOptions and serialize them to the resources API. Add a regression test covering the resulting request payload.

Co-authored-by: TRAE CLI <noreply@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>

feat(sdk): flatten core Python client options

Co-authored-by: TRAE CLI <traecli@bytedance.com>

docs(sdk): align Python examples with flattened options

Co-authored-by: TRAE CLI <traecli@bytedance.com>

fix(sdk): preserve core API compatibility

Co-authored-by: TRAE CLI <traecli@bytedance.com>

refactor(python-sdk): move resource hints to options

Co-authored-by: TRAE CLI <traecli@bytedance.com>

fix(sdk): align resource option callers

Co-authored-by: TRAE CLI <traecli@bytedance.com>

test(sdk): cover recursive reindex forwarding

Co-authored-by: TRAE CLI <traecli@bytedance.com>

fix(sdk): preserve Go options compatibility

Co-authored-by: TRAE CLI <traecli@bytedance.com>

feat(python-sdk): expose message peer id

Co-authored-by: TRAE CLI <traecli@bytedance.com>

test(python-sdk): consolidate options coverage

Co-authored-by: TRAE CLI <traecli@bytedance.com>

feat(python-sdk): add parts and flatten image search

Co-authored-by: TRAE CLI <traecli@bytedance.com>

* docs(sdk): align Python call examples

Co-authored-by: TRAE CLI <traecli@bytedance.com>

---------

Co-authored-by: TRAE CLI <traecli@bytedance.com>
Co-authored-by: Qin Haojie <qinhaojie.exe@bytedance.com>
2026-08-24 14:09:11 +08:00
Qin Haojie 7abd6ab249 refactor(client): remove Python embedded mode (#3712)
* refactor(client): remove Python embedded mode

Consolidate Python consumers on the HTTP SDK while keeping shared server and storage capabilities unchanged.

* refactor(client): remove obsolete embedded leftovers
2026-08-10 18:00:00 +08:00
MaojiaSheng db7319f4a2 refactor: to accelerate cli launch speed, refactor openviking_cli dir (#150)
* fix: remove await asyncio and call agfs directly

* feat: mv cli out of openviking

* refactor: mv cli out of openviking

* refactor: mv cli out of openviking
2026-02-12 22:12:50 +08:00
Zayn Jarvis a5cf17b646 feat: in chatmem example, add /time and /add_resource command (#77)
* docs: add design for /time and /add_resource commands

Design document for two new chatmem features:
- /time command: display performance timing breakdown
- /add_resource command: add documents during chat sessions

Includes architecture, detailed implementation plan, and UX examples.

* feat: add resource manager shared module

- create_client(): initialize OpenViking client
- add_resource(): add files/URLs to database with progress
- Extracted from add.py for reusability

* refactor: simplify add.py using resource manager

- Use shared create_client() and add_resource()
- Reduces duplication, maintains same CLI behavior
- ~80 lines reduced to ~40 lines

* test: document manual testing results

* docs: document /time and /add_resource commands in README

* docs: add implementation plan for /time and /add_resource

* feat: add timing instrumentation to Recipe.query()

- Track search_time, llm_time, total_time with perf_counter
- Return timing data in result dict under 'timings' key
- No breaking changes to existing API

* feat: add /time command handler

- Parse /time <question> syntax
- Extract question and call ask_question with show_timing=True
- Show usage help if no question provided

* feat: add timing display to ask_question

- Accept show_timing parameter (default False)
- Display timing panel with search/LLM/total times
- Format times as seconds with 3 decimal places

* docs: update help text with /time and /add_resource commands

* feat: add /add_resource command handler

- Parse /add_resource <path> syntax
- Expand user paths (~/ notation)
- Use shared resource_manager module
- Show spinner during processing
- Immediate feedback when complete

* docs: implementation complete summary

* feat: support add resource and time command

* roll: some unexpected changes

* roll: some unexpected changes

* chore: remove chat since dups

* chore: help msg update

* feat: update README for chatmem

* feat: update diff lint

* fix: use original changed files

* fix: filter py files

* fix: remove deleted file
2026-02-06 19:20:30 +08:00
Liu Zhiheng 74ea0f95f6 feat: chat & chat w/ mem examples (#39)
* docs(chat): add OpenViking chat application design

- REPL-style chat interface with rich terminal UI
- Client-server architecture (port 8391)
- Automatic RAG for context-aware responses
- Auto-commit sessions on exit
- Modular structure for multi-agent development

chore: add .worktrees to gitignore

docs: add chat examples design document

- Phase 1: Multi-turn chat interface (no persistence)
- Phase 2: Chat with session memory using OpenViking Session API
- Detailed architecture, implementation plan, and testing strategy

* docs(chat): add detailed implementation plan for Phase 1

- 9 bite-sized tasks with exact code
- TDD approach with manual testing
- Frequent commits after each task
- Complete REPL implementation
- Handoff document for Phase 2

* feat(chat): create directory structure with symlinks to query example

* fix(chat): remove broken data symlink - data directory is runtime artifact

* feat(chat): implement ChatSession for in-memory history

* docs: add agent handoff document for continuing implementation

- Complete task specifications for Tasks 3-9
- Subagent-driven development instructions
- Current status summary (Tasks 1-2 complete)
- Code examples and test procedures
- Entry point for next agent

* feat(chat): add ChatREPL class skeleton with signal handling

* feat(chat): implement welcome banner, help, and command handling

* feat(chat): implement question/answer display with sources

* feat(chat): implement main REPL loop with readline support

* fix(chat): chat func declaration

* feat(chat): support multi-run chat and tested

* fix(chat): interupt, remove debug log, move doc

* docs(chatmem): add Phase 2 implementation plan

- 11 detailed tasks with exact code
- Session API integration steps
- Message recording and commit procedures
- Testing and verification checklist
- Comprehensive documentation plan
- Success criteria for completion

* feat(chatmem): create Phase 2 directory from chat example

- Copy examples/chat/ to examples/chatmem/
- Update pyproject.toml name to chatmem
- Base for Session API integration

* refactor(chatmem): remove ChatSession, add Session API imports

- Remove in-memory ChatSession class
- Add OpenViking Session API imports
- Prepare for Session integration

* feat(chatmem): initialize OpenViking client and Session

- Add session_id parameter to ChatREPL.__init
- Initialize SyncOpenViking client in run()
- Create/load Session with session_id
- Display session info if continuing from previous
- Keep Recipe initialization

* feat(chatmem): record user and assistant messages to Session

- Add user message before query
- Add assistant message after response
- Remove old in-memory add_turn() call
- Messages now persist in Session

* feat(chatmem): commit session on exit with memory extraction

- Update _signal_handler to commit on Ctrl-C
- Update run() finally block to commit on normal exit
- Display memory extraction count
- Handle commit errors gracefully
- Session persists to data/session/

* feat(chatmem): add --session-id command line argument

- Add --session-id flag to specify session
- Default: chat-interactive
- Update help text to mention persistent memory
- Pass session_id to ChatREPL

* docs(chatmem): add comprehensive README with memory features

- Document session persistence behavior
- Explain memory extraction process
- Show session management examples
- Compare with examples/chat/
- Add troubleshooting section
- Include architecture diagrams

* docs(chatmem): add detailed comparison with chat example

- Side-by-side feature comparison
- Use case recommendations
- Code differences
- Storage structure comparison
- Performance considerations
- Migration path examples

* test(chatmem): add comprehensive test results

- Session creation/loading verified
- Message recording tested
- Memory extraction confirmed
- Multiple sessions working
- Error handling tested
- All commands functional

* feat(chatmem): Phase 2 complete - persistent memory implementation

Complete Features:
- Session persistence using OpenViking Session API
- Automatic message recording (user + assistant)
- Session commit on exit with memory extraction
- Previous session loading on startup
- Multiple independent sessions (--session-id)
- Comprehensive documentation and testing

Architecture:
- OpenViking SyncClient for storage
- Session API for message management
- Memory extraction on commit
- Session storage in data/session/

Testing:
- All functionality verified
- Multiple sessions tested
- Error handling confirmed
- Memory extraction working

Ready for production use.

* fix(chatmem): session API

* fix(chatmem): retrieve memory from FindResult

* feat(chatmem): aggregate chatmem docs

* refactor: replace symlink with common pkg
2026-02-04 10:31:03 +08:00