Skip to content

Commit 9d023ca

Browse files
committed
Adds navigator assistant
- updates to workbench-service and ConversationContext to allow assistants to query the available assistant services - assistant services advertise their descriptions for the navigator service, by providing a special key in their metadata - the descriptions for the project-assistant, codespace-assistant, and document-assistant have been created and are advertised by the respective services Additionally: - includes the full message object in the debug panel, in addition to the debug data (so you can see the message type and other metadata)
1 parent 35b86ff commit 9d023ca

53 files changed

Lines changed: 5092 additions & 52 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: navigator-assistant continuous integration
2+
3+
on:
4+
pull_request:
5+
branches: ["main"]
6+
paths:
7+
- "assistants/navigator-assistant/**"
8+
- "libraries/python/**"
9+
- "tools/docker/**"
10+
- ".github/workflows/assistants-navigator-assistant.yml"
11+
12+
push:
13+
branches: ["main"]
14+
paths:
15+
- "assistants/navigator-assistant/**"
16+
- "libraries/python/**"
17+
- "tools/docker/**"
18+
- ".github/workflows/assistants-navigator-assistant.yml"
19+
20+
workflow_dispatch:
21+
22+
defaults:
23+
run:
24+
working-directory: assistants/navigator-assistant
25+
26+
jobs:
27+
test:
28+
runs-on: ubuntu-latest
29+
steps:
30+
- uses: actions/checkout@v4
31+
32+
- name: Install uv
33+
uses: astral-sh/setup-uv@v3
34+
35+
- name: Set up Python 3.11
36+
run: uv python install 3.11
37+
38+
- name: test
39+
run: |
40+
make test
41+
42+
build:
43+
runs-on: ubuntu-latest
44+
steps:
45+
- uses: actions/checkout@v4
46+
47+
- name: docker-build
48+
run: |
49+
make docker-build
50+
51+
deploy:
52+
runs-on: ubuntu-latest
53+
environment: production
54+
permissions:
55+
id-token: write # for OIDC login
56+
contents: read
57+
concurrency:
58+
group: ${{ github.workflow }}-${{ github.ref }}
59+
needs: [build, test]
60+
if: ${{ (github.event_name == 'push' || github.event_name == 'workflow_dispatch') && github.ref == 'refs/heads/main' && vars.DEPLOYMENT_ENABLED == 'true' }}
61+
env:
62+
DOCKER_IMAGE_TAG: ${{ github.sha }}
63+
DOCKER_REGISTRY_NAME: ${{ secrets.AZURE_CONTAINER_REGISTRY_NAME }}
64+
AZURE_WEBSITE_RESOURCE_GROUP: ${{ secrets.AZURE_WEBSITE_RESOURCE_GROUP }}
65+
AZURE_WEBSITE_SUBSCRIPTION: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
66+
67+
steps:
68+
- uses: actions/checkout@v4
69+
70+
- uses: azure/login@v2
71+
with:
72+
client-id: ${{ secrets.AZURE_CLIENT_ID }}
73+
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
74+
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
75+
76+
- name: docker-push
77+
run: |
78+
make docker-push
79+
80+
- name: docker-deploy
81+
run: |
82+
make docker-deploy

assistants/codespace-assistant/assistant/chat.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from typing import Any
1111

1212
import deepmerge
13-
from assistant_extensions import attachments, dashboard_card, document_editor, mcp
13+
from assistant_extensions import attachments, dashboard_card, document_editor, mcp, navigator
1414
from content_safety.evaluators import CombinedContentSafetyEvaluator
1515
from semantic_workbench_api_model.workbench_model import (
1616
ConversationEvent,
@@ -103,6 +103,10 @@ async def content_evaluator_factory(context: ConversationContext) -> ContentSafe
103103
),
104104
),
105105
),
106+
**navigator.metadata_for_assistant_navigator({
107+
"default": helpers.load_text_include("codespace_assistant_info.md"),
108+
"context_transfer": helpers.load_text_include("context_transfer_assistant_info.md"),
109+
}),
106110
},
107111
)
108112

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# Codespace Assistant
2+
3+
## Overview
4+
5+
The Codespace Assistant is an AI-powered coding companion designed to help developers work effectively within development environments. It provides intelligent code assistance, project guidance, and insights about your codespace to accelerate development tasks and enhance productivity.
6+
7+
## Key Features
8+
9+
- **Contextual code understanding**: Analyzes your codebase to provide relevant suggestions and answers.
10+
- **Code generation and recommendations**: Helps write, modify, and refactor code across multiple files.
11+
- **Project navigation**: Assists with exploring repositories and finding relevant files.
12+
- **Development workflow guidance**: Suggests approaches for common development tasks like building, testing, and debugging.
13+
- **Multi-language support**: Works across various programming languages and frameworks.
14+
- **VS Code integration**: Provides suggestions related to VS Code extensions and tools.
15+
16+
## How to Use the Codespace Assistant
17+
18+
### Getting Started
19+
20+
1. **Start a conversation**: Create a new conversation and add the Codespace Assistant.
21+
2. **Describe your project**: Tell the assistant about what you're working on to get contextual help.
22+
3. **Ask development questions**: Get information about code, architecture, or development practices.
23+
4. **Request coding assistance**: Ask for help with writing code, fixing bugs, or implementing features.
24+
25+
### Project Exploration
26+
27+
- **Code search**: Ask the assistant to find specific code patterns or functionality in your project.
28+
- **Repository understanding**: Request explanations of project structure, dependencies, or configuration.
29+
- **File navigation**: Get help locating relevant files for specific features or components.
30+
- **Dependency analysis**: Understand package dependencies and version requirements.
31+
32+
### Coding Support
33+
34+
- **Code generation**: Request new code to implement specific functionality.
35+
- **Bug fixing**: Get help identifying and fixing issues in your code.
36+
- **Refactoring assistance**: Improve code structure and quality with guided refactoring.
37+
- **Code reviews**: Get feedback on your implementation approaches.
38+
- **Testing support**: Generate unit tests and validate code functionality.
39+
40+
### Development Guidance
41+
42+
- **Build process recommendations**: Get guidance on compiling, building, or packaging your code.
43+
- **Application configuration**: Receive help with configuring and understanding applications.
44+
- **Environment setup advice**: Get suggestions for development environments and tools.
45+
- **Debugging guidance**: Troubleshoot issues and interpret error messages.
46+
47+
## Workflow Integration
48+
49+
- **Work alongside your normal development**: The assistant complements your existing development workflow rather than replacing it.
50+
- **Interactive help**: Ask specific questions when you get stuck rather than spending time searching for answers.
51+
- **Contextual awareness**: The assistant understands your project context and provides relevant suggestions.
52+
- **Continuous learning**: As you interact with the assistant, it better understands your project and preferences.
53+
54+
## Common Use Cases
55+
56+
- **New project exploration**: Quickly understand unfamiliar codebases and architecture.
57+
- **Feature implementation**: Get help implementing specific functionality in your codebase.
58+
- **Bug investigation**: Identify and fix issues more efficiently with guided troubleshooting.
59+
- **Development setup**: Configure development environments and toolchains.
60+
- **Learning new technologies**: Get explanations and examples for frameworks or languages you're learning.
61+
62+
The Codespace Assistant is designed to be a responsive partner in your development process, adapting to your needs and helping you work more efficiently in your coding environment.
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# Context Transfer Assistant
2+
3+
## Overview
4+
5+
The Context Transfer Assistant specializes in capturing, organizing, and sharing knowledge between users. It helps document and transfer complex information about any subject matter, making it easier to onboard team members, share expertise, or provide detailed guidance across various domains.
6+
7+
## Key Features
8+
9+
- **Knowledge capture and organization**: Records and structures detailed information about any topic or subject area.
10+
- **Contextual understanding**: Analyzes shared files, documents, and conversations to build comprehensive knowledge representation.
11+
- **Guided context sharing**: Helps structure information to make it accessible and actionable for recipients.
12+
- **Domain-aware explanations**: Provides explanations grounded in the specific context being discussed.
13+
- **Interactive guidance**: Adapts explanations based on the recipient's questions and expertise level.
14+
- **Visual representation**: Creates diagrams and visual aids to explain complex concepts when helpful.
15+
- **Knowledge persistence**: Maintains shared knowledge through a centralized whiteboard that all participants can access, ensuring consistent information across team conversations.
16+
17+
## How to Use the Context Transfer Assistant
18+
19+
### For Context Owners (Sharers)
20+
21+
1. **Start by defining the context**: Explain what information you want to share and who will be using it.
22+
2. **Share relevant artifacts**: Upload or reference key documents, files, or resources.
23+
3. **Provide structural overview**: Describe the system, domain, or topic structure and key components.
24+
4. **Define processes**: Explain important workflows, procedures, or methodologies.
25+
5. **Refine knowledge representation**: Answer the assistant's questions to clarify details.
26+
27+
### For Context Recipients
28+
29+
1. **Review shared context**: Explore the information that has been shared with you.
30+
2. **Ask clarifying questions**: Request more details about specific aspects of the topic or materials.
31+
3. **Request practical examples**: Ask for concrete examples of concepts or procedures.
32+
4. **Apply knowledge assistance**: Get help applying the shared knowledge to specific tasks.
33+
5. **Seek procedural guidance**: Get step-by-step instructions for workflows or processes.
34+
35+
## Knowledge Transfer Process
36+
37+
1. **Context Definition**:
38+
39+
- Define the domain or subject matter to be shared
40+
- Establish the recipient's background and expertise level
41+
- Determine the goals of the knowledge transfer
42+
43+
2. **Knowledge Capture**:
44+
45+
- Share relevant documents and resources
46+
- Provide structural and organizational descriptions
47+
- Explain key concepts and relationships
48+
- Document important processes and procedures
49+
50+
3. **Context Organization**:
51+
52+
- The assistant structures the information for clarity
53+
- Complex concepts are broken down into digestible components
54+
- Visual diagrams may be created for conceptual understanding
55+
- Information is organized within the conversation history for reference
56+
57+
4. **Interactive Knowledge Sharing**:
58+
- Recipients explore the shared context
59+
- The assistant answers questions based on the captured knowledge
60+
- Explanations are adapted to the recipient's understanding
61+
- Additional context is gathered when knowledge gaps are identified
62+
63+
## Common Use Cases
64+
65+
- **Team member onboarding**: Transfer comprehensive knowledge to new members.
66+
- **Knowledge handover**: Document complex systems or processes when transitioning between teams.
67+
- **Expert consultation**: Preserve and share the knowledge of subject matter experts.
68+
- **Cross-team collaboration**: Share context between teams working on different aspects of a project.
69+
- **Process documentation**: Guide others through setting up or following specific procedures.
70+
71+
The Context Transfer Assistant bridges the gap between experts and knowledge recipients, making complex information more accessible, organized, and actionable across teams and individuals.

assistants/document-assistant/assistant/chat.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
from typing import Any
1212

1313
import deepmerge
14-
from assistant_extensions import dashboard_card
14+
from assistant_extensions import dashboard_card, navigator
1515
from assistant_extensions.mcp import MCPServerConfig
1616
from content_safety.evaluators import CombinedContentSafetyEvaluator
1717
from semantic_workbench_api_model.workbench_model import (
@@ -90,6 +90,11 @@ async def content_evaluator_factory(context: ConversationContext) -> ContentSafe
9090
),
9191
)
9292
),
93+
**navigator.metadata_for_assistant_navigator({
94+
"default": (pathlib.Path(__file__).parent / "text_includes" / "document_assistant_info.md").read_text(
95+
"utf-8"
96+
),
97+
}),
9398
},
9499
)
95100

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Document Assistant
2+
3+
## Overview
4+
5+
The Document Assistant is an AI assistant focused on document creation and editing within the Semantic Workbench. It provides a seamless environment for creating, editing, and managing Markdown documents with side-by-side editing capabilities, guided assistance, and integration with external tools.
6+
7+
## Key Features
8+
9+
- **Side-by-side document editing**: Work on your documents with a split view showing both the editor and conversation, enabling real-time collaboration and feedback.
10+
- **Document management**: Create, view, and edit multiple Markdown documents within the same workspace.
11+
- **Generated UI elements**: Get visual guidance through dynamically generated UI components that help organize your document workflow.
12+
- **Autonomous tool execution**: The assistant can perform document-related tasks on your behalf, freeing you to focus on content creation.
13+
- **MCP server integration**: Connects with Model Context Protocol (MCP) servers for extended functionality, particularly the filesystem and filesystem-edit servers.
14+
- **Local-only Office integration**: Optional integration with Microsoft Office applications through MCP (when enabled).
15+
16+
## How to Use the Document Assistant
17+
18+
### Getting Started
19+
20+
1. **Create a new conversation** in the Semantic Workbench and add the Document Assistant.
21+
2. **Create a new document** by asking the assistant to create one for you. Example: "Create a new document about project requirements."
22+
3. **Edit existing documents** by mentioning the document you want to work on. The document will appear in the side panel editor.
23+
24+
### Document Management
25+
26+
- **Switch between documents**: Use the Documents tab in the inspector panel to see all available documents and switch between them.
27+
- **Edit document content**: Make changes directly in the document editor panel, or ask the assistant to make specific edits for you.
28+
- **Upload files**: Upload Markdown files to add them to your workspace, making them available for editing.
29+
30+
### Advanced Features
31+
32+
- **Format documents**: Ask the assistant to format your document, create sections, add lists, tables, or other Markdown elements.
33+
- **Collaborative editing**: The document locking mechanism ensures that only one editing operation happens at a time, preventing conflicts.
34+
- **Document transformations**: Request content transformations like summarization, expansion, or style changes.
35+
36+
## Integration with Other Tools
37+
38+
When configured, the Document Assistant can work with:
39+
40+
- **MCP filesystem server**: For reading and writing files in the workspace.
41+
- **MCP filesystem-edit server**: For advanced document editing capabilities.
42+
- **Office integration**: When enabled, allows working with Microsoft Office documents.
43+
- **Additional MCP servers**: Can be enabled for search, research, and other extended features.
44+
45+
## Tips for Effective Use
46+
47+
1. **Be specific in your requests**: Clearly state what changes you want to make to documents.
48+
2. **Use the document editor for quick edits**: Make direct changes in the editor for smaller modifications.
49+
3. **Ask the assistant for complex transformations**: Let the AI handle more complex document restructuring or content generation.
50+
4. **Switch between documents as needed**: Use the Documents tab to manage multiple files in your workspace.
51+
5. **Save often**: While documents are automatically saved, it's a good practice to confirm important changes.
52+
53+
## Common Use Cases
54+
55+
- Creating technical documentation and reports
56+
- Drafting and editing business documents
57+
- Organizing research notes and findings
58+
- Creating structured content like tutorials or guides
59+
- Collaborative document editing and review
60+
61+
The Document Assistant is designed to be intuitive and helpful for all users, making document creation and editing a more efficient and guided experience.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Description: Example of .env file
2+
# Usage: Copy this file to .env and set the values
3+
4+
# NOTE:
5+
# - Environment variables in the host environment will take precedence over values in this file.
6+
# - When running with VS Code, you must 'stop' and 'start' the process for changes to take effect.
7+
# It is not enough to just use the VS Code 'restart' button
8+
9+
# Assistant Service
10+
ASSISTANT__AZURE_OPENAI_ENDPOINT=https://<YOUR-RESOURCE-NAME>.openai.azure.com/
11+
ASSISTANT__AZURE_CONTENT_SAFETY_ENDPOINT=https://<YOUR-RESOURCE-NAME>.cognitiveservices.azure.com/
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"type": "debugpy",
6+
"request": "launch",
7+
"name": "assistants: navigator-assistant",
8+
"cwd": "${workspaceFolder}",
9+
"module": "semantic_workbench_assistant.start",
10+
"consoleTitle": "${workspaceFolderBasename}",
11+
"justMyCode": false // Set to false to debug external libraries
12+
}
13+
]
14+
}

0 commit comments

Comments
 (0)