Skip to content

petrhrabina/ai-middleware-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AI Middleware Example

Example of using the AI middleware to interact Pivotal Tracker with Anthropic LLM

This project demonstrates the concept of an AI middleware system, showcasing how artificial intelligence can be integrated with project management tools like Pivotal Tracker. It serves as a proof of concept for using natural language processing to interact with structured data from external APIs.

What This Example Does

  1. Natural Language Processing: Accepts user queries in plain natural language.
  2. AI Interpretation: Uses AI to interpret the intent of the query.
  3. API Integration: Fetches relevant data from Pivotal Tracker based on the interpreted query.
  4. Intelligent Response: Generates a response using AI, combining the query intent with the fetched data.
  5. Prompting: Effective prompting strategies for Anthropic LLM models.

Key Features of the Middleware

  • Seamless integration between AI language models and external APIs
  • Flexible query handling for different types of project management questions
  • Demonstration of how AI can enhance data retrieval and interpretation

Quick Start

Set up the environment:

mv .template.env .env

Edit .env and fill in your API keys and other required values. Then run one of the following commands:

This command returns the standard response without the pivotal tracker api call

python main.py "Hi, how are you?"

Default Response

This command initiates an api call to the pivotal tracker and returns any unstarted tasks

python main.py "What unstarted tasks do we have?"

Unstarted Tasks

This command initiates an api call to the pivotal tracker and returns any started tasks

python main.py "List the current sprint's started stories."

Started Tasks

How It Works

  1. User input is processed by an AI model to determine the query type.
  2. Based on the AI's interpretation, the middleware fetches relevant data from Pivotal Tracker.
  3. Another AI call combines the fetched data with the original query to generate a human-readable response.

Prompt Examples

This example also demonstrates effective prompting techniques for Anthropic models.

  • middleware/prompts/default.prompt: Shows how to write prompt instructions for Anthropic LLM model to determine user intent and provide a standard response or request clarification.
  • middleware/prompts/detail.prompt: Contains prompt instructions that force the LLM to respond precisely and in detail, based solely on data obtained from the API call.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages