Skip to content

windson/strands-mcp-q-index-perplexity

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Agentic RAG for JIRA Case Management using Strands Agents with MCPs Clients for Amazon Q Index & Perplexity

This solution uses Strands Agents with MCP Tools powered by Amazon Q Business Cross App index and Perplexity Ask

image

Set up

Perform the steps for setting up MCP powered using Q Index based RAG by visiting the q_index_mcp/README.md

Configuration

Create .env file in the root of this module.

touch .env

The application uses environment variables for configuration. You can modify these in the .env file:

REGION=us-east-1
Q_BUSINESS_APP_NAME=REPLACE_WITH_YOUR_Q_BUSINESS_APP_NAME
PERPLEXITY_API_KEY=PERPLEXITY_API_KEY

For PERPLEXITY_API_KEY, visit Generating an API Key

Setup and Running with UV

This project uses uv for dependency management instead of traditional Python venv.

For Mac, you MUST run brew install uv for smooth MCP experience. Otherwise you may run into ENOENT challenges

brew install uv

Running the Server

You can run the server using the provided script:

./run_with_uv.sh

This script will:

  1. Create a uv environment if it doesn't exist
  2. Install the required dependencies
  3. Spins up the bot that runs strands agent powered up by MCP servers.

Manual Setup

If you prefer to set up manually:

# Create and activate uv environment
uv venv .uv
source .uv/bin/activate

# Install dependencies
uv pip install boto3 "mcp[cli]" requests fastmcp httpx python-dotenv strands-agents strands-agents-tools

# Run strands agent
uv run main.py

Required Packages

  • boto3
  • mcp[cli]
  • requests
  • fastmcp
  • httpx
  • python-dotenv
  • strands-agents
  • strands-agents-tools

Test Q Index MCP Server

cd q_index_mcp/ && uv run test_mcp_client.py && cd ..

Questions to Ask based on tickets in synthetic_data and ticket_pdfs directory

Refer q_index_mcp/rag_sample_queries.md that has sample questions along with expected info and context associated with query.

What are some of the reasons of keyboard failure?
What are software installation issues caused by?
What is the remediation of password not working?
What do I do if I am unable to access my backup files?

What immediate action did AnyCompany take to improve the Voice receptionist service while discussing the upgrade?
During which hours did Michael Chen notice the most significant delays?

Using just MCP Host instead of strands agents

Set up Perplexity ASK MCP Server

Refer Integrating MCP with Perplexity's Sonar API and Perplexity Ask MCP Server

Sample prompt for MCP Hosts (Claude Desktop, Amazon Q CLI etc.,)

Sample prompt. Feel free to tweak according to your needs.

You are a helpful AI assistant who answers question correctly and accurately about a AcmeCompany's IT tickets and also rely on Perplexity MCP Server for general knowledge.
You answer in the format as follows:
<response>
    <datasource> 
    </datasource>
    <perplexityknowledge> 
    </perplexityknowledge>
</response>

** For datasource section: **
    Use tool answer_question from AnyCompany MCP Server.
    Do not makeup answers and only answer from the provided knowledge. 
    If the query doesn't has any Info about IT Tickets, you must acknowledge that. 
** For  perplexityknowledge section: **
    Provide info by obtaining the results from perplexity-ask MCP using it's preplexity_ask tool for addressing the query.

Here is the query:
During which hours did Michael Chen notice the most significant delays?

Using Claude Desktop

image

Using Q Dev CLI

image

image