This repository contains sample code demonstrating how to use AWS Bedrock and Strands with WRITER's Palmyra family of models.
- Bedrock examples: Examples of using WRITER's Palmyra X4 and X5 models with AWS Bedrock.
- WRITER Strands examples: Examples of using WRITER's family of Palmyra models via direct integration.
- Bedrock Strands examples: Examples showcasing how to use WRITER’s Palmyra X4 and X5 models on Amazon Bedrock through the Strands Agents SDK.
Before you begin, ensure you have the following:
- Python 3.10 or higher installed.
-
Clone the repository
git clone https://github.com/writer/aws-examples.git cd aws-examples
-
Create and activate a virtual environment:
python -m venv my_env source my_env/bin/activate # On Windows, use `my_env\Scripts\activate`
-
Set up environment variables
Copy the
.env.template
file to a.env
file in the project root with your credentials:cp .env.template .env
Only fill this out if you're testing WRITER Strands examples.
WRITER_API_KEY=your WRITER API key
Only fill this out if you're testing Bedrock-powered examples.
AWS_REGION_NAME=your AWS region AWS_BEDROCK_MODEL_ID=Bedrock model ID you want to use AWS_ACCESS_KEY_ID=your AWS access key AWS_SECRET_ACCESS_KEY=your AWS secret key AWS_SESSION_TOKEN=your AWS session token
Note: You can find more information on how to set up these credentials in the Bedrock or Strands examples README.
Examples demonstrating how to use WRITER's Palmyra models with AWS Bedrock:
- Transcript analyzer: Analyze meeting transcripts and extract summaries and action items.
- Web search agent: Intelligent agent that can search the web and process information.
Examples demonstrating how to use WRITER's models with AWS Strands via direct integration:
- Financial analysis: Analyze financial data and generate insights.
- Vision image analysis: Analyze images and extract information.
- Structured output: Generate structured data from unstructured text.
- Long context: Handle long-form content and documents.
- Enterprise workflow automation: Automate enterprise workflows and processes.
- Memory agent: Agent with memory capabilities for conversation context.
- Multi-agent examples: Collection of specialized AI assistants using direct WRITER integration, each optimized for specific domains like creative writing, financial analysis, medical information, and knowledge management.
Examples demonstrating how to use WRITER's models with AWS Strands via Bedrock integration:
- Agents workflow: Multi-agent workflow orchestration and coordination.
- File operations: File system operations and document processing.
- Knowledge base agent: Intelligent knowledge base querying and retrieval.
- MCP calculator: Mathematical computation and calculation tools.
- Memory agent: Agent with persistent memory capabilities.
- Meta tooling: Advanced tool management and orchestration.
- Structured output: Generate structured data from unstructured text.
- Weather forecaster: Weather data analysis and forecasting.
- Multi-agent examples: Educational multi-agent system with specialized assistants for computer science, english, language learning, and mathematics, coordinated by a teacher's assistant orchestrator that routes student queries to the most appropriate subject-matter expert.
- Hybrid multi-agent example: Advanced multi-agent system with a central orchestrator using AWS Bedrock for routing queries to specialized sub-agents that use direct WRITER API integration for domain-specific expertise in creative, financial, and medical domains.
The resources/
directory contains sample data and files used by the examples:
- Meeting transcript: Sample meeting transcript for testing the transcript analyzer.
- The Ninth Wave: Sample image for testing vision analysis capabilities.
- Financial data: Sample enterprise financial dataset for testing database querying capabilities.
WRITER is the full-stack generative AI platform for enterprises. Quickly and easily build and deploy AI apps with a suite of developer tools fully integrated with our LLMs, graph-based RAG, AI guardrails, and more. To learn more, visit our website.
If you encounter any issues or have questions, please file an issue on this repository.