feat: add Ollama and AWS Bedrock AI assistants - #1729
Open
singhankur wants to merge 1 commit into
Open
Conversation
Add two new AI assistant implementations: - OllamaAIAssistant: integrates with locally hosted Ollama models via langchain-ollama. Configured via OLLAMA_BASE_URL env var or base_url in model_args. Defaults to llama3.2. - BedrockAIAssistant: integrates with AWS Bedrock via langchain-aws (ChatBedrock). Uses standard boto3 credential chain — no custom proxy or auth headers required. Defaults to claude-3-5-haiku. Both assistants follow the existing plugin pattern and are registered as examples in plugins/ai_assistant_plugin/__init__.py. Adds langchain-ollama and langchain-aws to requirements/ai/langchain.txt.
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
This PR adds two new AI assistant implementations to complement the existing OpenAI assistant:
langchain-ollama. Useful for air-gapped or on-prem deployments that can't use cloud APIs.langchain-aws(ChatBedrock). Uses the standard boto3 credential chain (IAM roles, environment variables,~/.aws/credentials) — no custom proxy or auth headers needed.Both follow the existing plugin pattern: drop in the class and register it in
plugins/ai_assistant_plugin/__init__.py.Files changed
querybook/server/lib/ai_assistant/assistants/ollama_assistant.pyOllamaAIAssistantclassquerybook/server/lib/ai_assistant/assistants/bedrock_assistant.pyBedrockAIAssistantclassplugins/ai_assistant_plugin/__init__.pyrequirements/ai/langchain.txtlangchain-ollamaandlangchain-awsConfiguration
Ollama
Set the
OLLAMA_BASE_URLenvironment variable (defaults tohttp://localhost:11434) and enable the assistant in your plugin:Config example (in Querybook admin settings):
{ "default": { "model_args": { "model_name": "llama3.2" } } }AWS Bedrock
Requires valid boto3 credentials (IAM role or
~/.aws/credentials):Config example:
{ "default": { "model_args": { "model_id": "anthropic.claude-3-5-haiku-20241022-v1:0", "region_name": "us-east-1" } } }Supported models include Amazon Nova, Anthropic Claude 3.x, Meta Llama 3, and Mistral families.
Test plan
langchain-ollamaandlangchain-awsinstall cleanly alongside existing deps