feat: add workspace foundation and RAG design spec#1324
Closed
teknium1 wants to merge 8 commits into
Closed
Conversation
teknium1
added a commit
that referenced
this pull request
Apr 6, 2026
Port and modernize PR #1324 onto current main with full profile/HERMES_HOME awareness. New files: - agent/workspace.py: Core workspace engine — path resolution, manifest generation, structural chunking (markdown heading-aware, code symbol-aware), chunk indexing into SQLite, hybrid retrieval (FTS5 sparse + dense embeddings via RRF), optional reranking (local cross-encoder, Cohere, Voyage, heuristic fallback), workspace roots management, turn-scoped context injection - tools/workspace_tool.py: Model-facing workspace tool (status/index/list/search/retrieve) - hermes_cli/workspace.py: CLI subcommands and /workspace slash command handler Integration points: - config.py: workspace and knowledgebase sections in DEFAULT_CONFIG, workspace/ knowledgebase dirs in ensure_hermes_home(), config version bump to 13 - toolsets.py: workspace tool added to _HERMES_CORE_TOOLS - model_tools.py: workspace_tool added to _discover_tools() - commands.py: /workspace CommandDef with subcommands - cli.py: /workspace slash command dispatch - run_agent.py: turn-scoped workspace RAG context injection (cache-safe — appended to current-turn user message only, never touches system prompt) - hermes_cli/main.py: hermes workspace subcommand tree (status/index/list/search/retrieve/roots) - hermes_cli/banner.py: workspace roots visibility in welcome banner - pyproject.toml: workspace-rag optional dependency group Profile-aware: all paths use get_hermes_home() from hermes_constants, never hardcoded ~/.hermes. Each profile gets its own workspace/ and knowledgebase/ directories. Retrieval modes: off (default), gated (heuristic trigger), always. Embedding: local SentenceTransformers when installed, hash fallback otherwise. Dense search: sqlite-vec acceleration when installed, Python cosine fallback. Tests: 18 new workspace-specific tests, all passing. Original PR: #1324 by @teknium1
kshitijk4poor
pushed a commit
to kshitijk4poor/hermes-agent
that referenced
this pull request
Apr 7, 2026
Port and modernize PR NousResearch#1324 onto current main with full profile/HERMES_HOME awareness. New files: - agent/workspace.py: Core workspace engine — path resolution, manifest generation, structural chunking (markdown heading-aware, code symbol-aware), chunk indexing into SQLite, hybrid retrieval (FTS5 sparse + dense embeddings via RRF), optional reranking (local cross-encoder, Cohere, Voyage, heuristic fallback), workspace roots management, turn-scoped context injection - tools/workspace_tool.py: Model-facing workspace tool (status/index/list/search/retrieve) - hermes_cli/workspace.py: CLI subcommands and /workspace slash command handler Integration points: - config.py: workspace and knowledgebase sections in DEFAULT_CONFIG, workspace/ knowledgebase dirs in ensure_hermes_home(), config version bump to 13 - toolsets.py: workspace tool added to _HERMES_CORE_TOOLS - model_tools.py: workspace_tool added to _discover_tools() - commands.py: /workspace CommandDef with subcommands - cli.py: /workspace slash command dispatch - run_agent.py: turn-scoped workspace RAG context injection (cache-safe — appended to current-turn user message only, never touches system prompt) - hermes_cli/main.py: hermes workspace subcommand tree (status/index/list/search/retrieve/roots) - hermes_cli/banner.py: workspace roots visibility in welcome banner - pyproject.toml: workspace-rag optional dependency group Profile-aware: all paths use get_hermes_home() from hermes_constants, never hardcoded ~/.hermes. Each profile gets its own workspace/ and knowledgebase/ directories. Retrieval modes: off (default), gated (heuristic trigger), always. Embedding: local SentenceTransformers when installed, hash fallback otherwise. Dense search: sqlite-vec acceleration when installed, Python cosine fallback. Tests: 18 new workspace-specific tests, all passing. Original PR: NousResearch#1324 by @teknium1
|
this feature is the missing piece for creating a usable knowledge base with obsidian wiki (llm-wiki & obsidian build in skills) making the agent more powerful combine with memory for high signal to use the knowledge base within a workspace, a reusable skills for procedural and creating a living knowledge system 🎉✨ |
19 tasks
Contributor
Author
|
Closing during PR triage — not pursuing this approach. |
angelburgosrosado
pushed a commit
to angelburgosrosado/hermes-agent
that referenced
this pull request
Apr 28, 2026
Port and modernize PR NousResearch#1324 onto current main with full profile/HERMES_HOME awareness. New files: - agent/workspace.py: Core workspace engine — path resolution, manifest generation, structural chunking (markdown heading-aware, code symbol-aware), chunk indexing into SQLite, hybrid retrieval (FTS5 sparse + dense embeddings via RRF), optional reranking (local cross-encoder, Cohere, Voyage, heuristic fallback), workspace roots management, turn-scoped context injection - tools/workspace_tool.py: Model-facing workspace tool (status/index/list/search/retrieve) - hermes_cli/workspace.py: CLI subcommands and /workspace slash command handler Integration points: - config.py: workspace and knowledgebase sections in DEFAULT_CONFIG, workspace/ knowledgebase dirs in ensure_hermes_home(), config version bump to 13 - toolsets.py: workspace tool added to _HERMES_CORE_TOOLS - model_tools.py: workspace_tool added to _discover_tools() - commands.py: /workspace CommandDef with subcommands - cli.py: /workspace slash command dispatch - run_agent.py: turn-scoped workspace RAG context injection (cache-safe — appended to current-turn user message only, never touches system prompt) - hermes_cli/main.py: hermes workspace subcommand tree (status/index/list/search/retrieve/roots) - hermes_cli/banner.py: workspace roots visibility in welcome banner - pyproject.toml: workspace-rag optional dependency group Profile-aware: all paths use get_hermes_home() from hermes_constants, never hardcoded ~/.hermes. Each profile gets its own workspace/ and knowledgebase/ directories. Retrieval modes: off (default), gated (heuristic trigger), always. Embedding: local SentenceTransformers when installed, hash fallback otherwise. Dense search: sqlite-vec acceleration when installed, Python cosine fallback. Tests: 18 new workspace-specific tests, all passing. Original PR: NousResearch#1324 by @teknium1
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
workspacetoolhermes setup workspaceWhat this PR does
workspaceandknowledgebaseconfig sectionsworkspace/andknowledgebase/directories underHERMES_HOMEagent/workspace.pyfor:tools/workspace_tool.pyand includes it in Hermes core toolsetshermes workspace statushermes workspace indexhermes workspace listhermes workspace searchhermes workspace retrievehermes workspace roots listhermes workspace roots add <path> [--recursive]hermes workspace roots remove <path-or-label>/workspacerun_agent.pyusing the same cache-safe pattern as Honcho: retrieval is appended to the current-turn user message only, never to the cached system prompthermes setup workspacehermes-agent[workspace-rag]hermes-agent[workspace-rag][Source: relative/path]Activated Workspace(s): workspace, notes, ...UX notes
~/.hermes/workspace--recursiveRetrieval implementation notes
sentence-transformerswhen availablesentence-transformersWhy this scope
This gets the workspace RAG system into a genuinely usable and installable state without violating Hermes' caching/message invariants:
Test plan
source /home/teknium/.hermes/hermes-agent/.venv/bin/activate && python -m pytest tests/ -n0 -qsource /home/teknium/.hermes/hermes-agent/.venv/bin/activate && python -m pytest tests/hermes_cli/test_setup_workspace_rag.py tests/hermes_cli/test_banner_workspace.py tests/hermes_cli/test_workspace_roots.py tests/agent/test_workspace.py tests/test_run_agent.py -n0 -qsource /home/teknium/.hermes/hermes-agent/.venv/bin/activate && TMP_HOME=$(mktemp -d) && export HERMES_HOME="$TMP_HOME" && python -m hermes_cli.main workspace roots list && mkdir -p "$TMP_HOME/notes/nested" && printf 'top level note\n' > "$TMP_HOME/notes/top.txt" && printf 'deep note\n' > "$TMP_HOME/notes/nested/deep.txt" && python -m hermes_cli.main workspace roots add "$TMP_HOME/notes" && python -m hermes_cli.main workspace index && python -m hermes_cli.main workspace search note && python -m hermes_cli.main workspace roots remove "$TMP_HOME/notes"