Skip to main content

Add your description here

Project description

Lineage Suggestion Agent

An AI-powered assistant that provides friendly, context-aware guidance to users navigating a data lineage workflow.

Description

This agent acts as a virtual assistant within a data lineage application. It takes the current status of the user's workflow as input and uses a large language model (LLM) to generate a concise, encouraging, and actionable suggestion for the next logical step.

The primary goal is to enhance the user experience by providing clear, timely guidance, reducing confusion, and helping users move smoothly through complex data lineage tasks.

Key Features

  • Context-Aware Guidance: Analyzes the current workflow status to provide relevant suggestions.
  • Friendly & Actionable: Generates suggestions that are easy to understand and act upon.
  • Encouraging Tone: Uses positive language to motivate users as they make progress.
  • Simple Integration: Designed to be easily integrated into any application requiring guided user interaction.

Installation

Prerequisites

  • uv – A fast Python package and environment manager.
  • Git

Steps

  1. Clone the lineage_suggestion_agent repository:

    git clone https://github.com/stepfnAI/lineage_suggestion_agent.git
    cd lineage_suggestion_agent
    
  2. Create a virtual environment and install dependencies:

    git switch dev
    uv sync --extra dev
    source .venv/bin/activate
    
  3. Clone and install the sfn_blueprint dependency: The agent requires the sfn_blueprint library.

    cd ../
    git clone https://github.com/stepfnAI/sfn_blueprint.git
    cd sfn_blueprint
    git switch dev
    uv pip install -e .
    cd ../lineage_suggestion_agent
    

Configuration

Configure the agent by creating a .env file in the project root or by exporting environment variables.

Available Settings

Environment Variable Description Default
OPENAI_API_KEY or ANTHROPIC_API_KEY (Required) Your AI provider API key. None
LINEAGE_AI_PROVIDER AI provider for suggestions. openai
LINEAGE_MODEL AI model for suggestions. gpt-4o
LINEAGE_TEMPERATURE AI model temperature (0.0 to 2.0). 0.3
LINEAGE_MAX_TOKENS Maximum tokens for the AI response. 4000

Example .env file:

# .env
OPENAI_API_KEY="sk-your-openai-api-key-here"

# Optional: Use a different model
# LINEAGE_MODEL="gpt-4o-mini"

Testing

To run the test suite, use the following command from the project root:

pytest

Usage

Running the Example Script

A basic usage example is provided in the examples/ directory.

python examples/basic_usage.py

Using as a Library

Integrate the LineageSuggestionAgent directly into your application.

from lineage_suggestion_agent import LineageSuggestionAgent

# 1. Initialize the agent
agent = LineageSuggestionAgent()

# 2. Define the current workflow status as a context string
context = "Join and transformations on 'Entity_X' are complete, creating 'Table_A'. Next action: MarkAsFinal."

# 3. Call the agent to get a suggestion
suggestion, cost = agent({"context": context})

# 4. Print the results
print(f"Suggestion: {suggestion.answer}")
print(f"Cost Details: {cost}")

Example Output

The agent returns a LineageSuggestion object and a cost dictionary.

Suggestion: Great job on completing the join and transformations for 'Entity_X'! Now, let's finalize this table. Please use the 'MarkAsFinal' action to complete the process.
Cost Details: {'prompt_tokens': 457, 'completion_tokens': 41, 'total_tokens': 498, 'total_cost_usd': 0.0016}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lineage_suggestion_agent-0.1.2.tar.gz (7.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lineage_suggestion_agent-0.1.2-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

Details for the file lineage_suggestion_agent-0.1.2.tar.gz.

File metadata

File hashes

Hashes for lineage_suggestion_agent-0.1.2.tar.gz
Algorithm Hash digest
SHA256 bce042688aa3ea97b04698531064164c63ee221fb3f1ae513659b67ce9b65f2f
MD5 6cd6b6813c5dc618de420fbb854064ad
BLAKE2b-256 9e8ce3a23aa3b6ab010b589d99611c77e429498ec2578eefd111452b675b3666

See more details on using hashes here.

File details

Details for the file lineage_suggestion_agent-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for lineage_suggestion_agent-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 7cf97f5af7db89aeab6049c1367f2c04e54025f0479b55ed3214a4d8e0bb5fd6
MD5 1fd115e703eecb30d0f34ca7b7a58afc
BLAKE2b-256 db49087b6747c5df1e174edfe41743d2f587982c588257d68776341f38033a92

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page