-
Notifications
You must be signed in to change notification settings - Fork 750
Fix/bot Fix Memory Consolidation Issues and Integrate Vikingbot as OpenViking Optional Dependency #492
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Fix/bot Fix Memory Consolidation Issues and Integrate Vikingbot as OpenViking Optional Dependency #492
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
972adf7
fix
chenjw 5bc2f79
add log
yeshion23333 7f77c70
add log
yeshion23333 2a0c34d
update
chenjw 4f77268
update
chenjw 1fbf352
update
chenjw 15ef853
Opt memory
yeshion23333 bb9d1a0
Merge branch 'fix/bot_fix' of github.com:volcengine/OpenViking into f…
yeshion23333 6f27443
Opt memory
yeshion23333 71654e9
Opt memory
yeshion23333 6c7e834
Opt memory
yeshion23333 b590ff8
Fix memory consolidation issues: duplicate session write, hook error,…
chenjw 4c6f2b0
Integrate vikingbot as openviking optional dependency
chenjw b407921
Remove bot/pyproject.toml
chenjw 104e73d
Update vikingbot installation instructions in root READMEs
chenjw a2bb17f
update
chenjw 616c492
rebase
chenjw c994030
Use singleton pattern for VikingClient in hooks
chenjw 4eab23f
Use global singleton for VikingClient instead of per-workspace cache
chenjw 5eab8eb
解决冲突
chenjw 433fd1f
uv run ruff format
chenjw File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
This file was deleted.
Oops, something went wrong.
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| import openviking as ov | ||
|
|
||
| # Initialize OpenViking client with data directory | ||
| client = ov.SyncOpenViking(path="./data") | ||
|
|
||
| try: | ||
| # Initialize the client | ||
| client.initialize() | ||
|
|
||
| # Add resource (supports URL, file, or directory) | ||
| add_result = client.add_resource( | ||
| path="/Users/bytedance/Downloads/exp/experience_data_mini.json", | ||
| resource_type="json", # 明确指定类型 | ||
| tags=["large_data", "agent_context", "structured"], | ||
| ) | ||
| root_uri = add_result["root_uri"] | ||
|
|
||
| # Explore the resource tree structure | ||
| ls_result = client.ls(root_uri) | ||
| print(f"Directory structure:\n{ls_result}\n") | ||
|
|
||
| # Use glob to find markdown files | ||
| glob_result = client.glob(pattern="**/*.md", uri=root_uri) | ||
| if glob_result["matches"]: | ||
| content = client.read(glob_result["matches"][0]) | ||
| print(f"Content preview: {content[:200]}...\n") | ||
|
|
||
| # Wait for semantic processing to complete | ||
| print("Wait for semantic processing...") | ||
| client.wait_processed() | ||
|
|
||
| # Get abstract and overview of the resource | ||
| abstract = client.abstract(root_uri) | ||
| overview = client.overview(root_uri) | ||
| print(f"Abstract:\n{abstract}\n\nOverview:\n{overview}\n") | ||
|
|
||
| # Perform semantic search | ||
| results = client.find("what is openviking", target_uri=root_uri) | ||
| print("Search results:") | ||
| for r in results.resources: | ||
| print(f" {r.uri} (score: {r.score:.4f})") | ||
|
|
||
| # Close the client | ||
| client.close() | ||
|
|
||
| except Exception as e: | ||
| print(f"Error: {e}") | ||
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.