Date: Wednesday, July 17, 2024
Work Undertaken Summary
- Try Out more models
- phi3
- mistal
- gemma2
- Use AI to generate initial headings for documents
- Allow human to tweak the headings and then push into production
- Allow ollama integration for heavier models (e.g. llama3-70b)
- Generation using individual sections
current generation: story-weaver-output/Leads.xml at ollama-8 - story-weaver-output - Gitea: Aeternus (4man.dev)
Risks
Time Spent
1.25 new models (phi3, gemma2, mistral) 1.75 Auto generate headings. 0.35 Reading 2Better & Faster Large Language Models via Multi-token Predictionâ 2hr ollama integration 0.5hr testing ollama with llama3 3.5hr multi-heading generation setup.
Questions for Tutor
Next work planned
Resolve the deleting useful information problem: Potential solutions:
- First pass ask LLM is this relevant (y/n question)
- Or after generation ask an llm if what is generated is valuable
- Or try a more grounded model / bigger or huggingface
- or try tweaking the prompt
- or get a human to accept/reject/merge the changes that it suggests.
hugging-face model was worse at rejecting unneeded information. I think I should try saying include this information. DO not include information under the these headers.
Raw Notes
Process for individual sections
- Have the generated sections get saved to xml file.
- Then the user can tweak them to what they want Then parse the result and create the individual sections in the xml document, keep the user specified headings around so they can be passed as context to the model. Then change the generation to use the headings.
Phi3-mini
started out well but like phi3-medium it ended up stuck repeating itself.
Mandatory fields are:
- Company (either existing, or new / company name)
- ~~Primary Contact~~ (optional)
- Source (this will be the existing Application Sources lookup)
- Source Detail - TBC, asked on Trello to confirm
- Priority
- Details
- Recolight Service Interest
- Status - defaults to New
- Assigned To (user - allow multiple)
- Next Action By (single team)
Additional comments:
- If the Lead is for an existing company, but of a different Recolight Business Type (e.g. exists as a Member and the Lead is for a Collection Point), update the Recolight Business Type of the existing record.
- Any Lead/Notes, Lead/Documents, Lead/Communications should be copied to any new or existing Company records.
- The Lead List view needs to show Customer Of (as per Cases).
- The Created By, Created Date, Updated By, Updated Date fields should be saved and updated if any fields are changed.
- The Lead List view needs to show Customer Of (as per Cases).
- The Lead List view needs to show Customer Of (as per Cases).
- The Lead List view needs to show Customer Of (as per Cases).
- The Lead List view needs to show Customer Of (as per Cases).
- The Lead List view needs to show Customer Of (as per Cases).
Gemma2
Gemma2 completed generation with pretty successful results. Took about 30 minutes to generate. Had to generate without flashattention as it was complaining about not being able to compare the flash attention version Had to reduce the max new tokens or itâd error with trying to allocate too much memory.
Mistral
Mistral did an okay job but generally missed the point that the output should be in markdown. It generally created really long sentences rather than using bullet point lists etc.
Applications and Leads represent opportunities for new business for Recolight. Recolight uses both applications and leads to track potential new customers.
Applicants and internal users can view, edit, and convert leads from a list. The leads list view shows the Customer Of, which is the name of the company associated with the lead. Users can filter and sort the leads list by various criteria such as company name, priority, and service interest.
Leads can be associated with an existing company or a new company, and an existing address or a new address. Users can add, view, and edit Notes/Communications for a Lead. Leads can be copied with the ability to copy select fields.
Users can send emails from within a Lead to all contacts at the Lead Address, whether they are on the Lead or not.
Leads can have a Website associated with them.
Users can add a Generated By field, which is user selectable from internal users.
Bulk importing leads from a CSV file is available, which will be expanded to create lead companies/addresses/contacts once the required details have been confirmed.
Users can filter leads by company name, company ref, lead type, priority, freerider, assigned to, next action by, and created date from/to, service interest, application status, application date, application reference, and quotation status.
Users can link a Lead to an application and vice versa. An inactive or retired company may have a new Lead, which when the Lead is converted, would mean the Company would be updated to active status.
Lead status changes include:
- Cancel Lead: User sets the Status to Cancelled, enters Reason for Cancellation, allows addition of a Comment, logs date/time and user, and performs an audit.
- Mark as Lost: User sets the Status to Lost, enters Reason for Loss, allows addition of a Comment, logs date/time and user, and performs an audit.
- Convert Lead: User sets the Status to "Converted", ensures mandatory fields are filled, makes the company active if it is inactive or retired, logs date/time and user, and performs an audit.
Mandatory fields for converting a lead: Company, Addresses, Contacts, Lead Type, Probability, Anticipated Closure Date, and Status.
Users can view and download quotations for leads and applications.
Users can access the Leads List from the Company and Address. This would only show Leads for existing Companies/Addresses.
Users can show material icons in the LHS of the Leads List, as per Jobs. If missing material group or no service interests, the icon would not show on the leads LHS.</content>
Heading Generation
Initial Generation using llama3 created this
# Leads
## Lead Management
### Lead Overview
### Lead Administration
#### Lead Statuses
#### Lead Fields
#### Lead Actions
#### Lead Notes and Audit
### Lead List View
### Lead Details View
### Lead Company Management
### Lead Address Management
### Lead Contact Management
### Lead Communication
### Lead Quotations
#### Creating a Quotation
#### Viewing and Downloading a Quotation
#### Emailing a Quotation
### Linking Applications and Leads
### Lead Status Changes
#### Lead Status Transitions
#### Lead Cancellation
#### Lead Loss
#### Lead Conversion
### Lead Actions and Notes
#### Lead Notes
#### Lead Audit
### Lead Reporting
No more stories to add to section Leads
phi3 got confused and started generating the actual textâŠ
Gemma2
# Introduction
# Lead Management
# Lead List View
# Lead Details View
# Lead Status Management
# Lead Communication
# Lead Communications
# Lead Notes
# Lead Documents
# Lead Actions
# Lead Actions
# Lead Lookups
# Lead Audit
# Lead Audit
# Lead Import
# Bulk Lead Import
# Lead Attributes
# Lead Fields
# Lead Relationships
# Company Management
# Company Status
# Company Activation
# Lead Lifecycle
# Lead Status Transitions
# Lead Conversion
# Quotation Management
# Quotation Creation
# Quotation Viewing
# Quotation Download
# Quotation Email
# Lead Access
# Accessing Leads from Companies and Addresses
Mistral
Mistal also got confused and started trying to generate the documentation right from the get go
# Leads Functional Area
## Introduction
- Overview of Leads functional area as potential business opportunities
- Integration with Applications
* Creating links between Leads and Applications
* Synchronizing Lead and Application statuses
## Leads List & Details Views
### Mandatory Fields
- Company or Company Name
- Source
- Priority
- Details
- Recolight Service Interest
- Status
- Assigned To
- Generated By
- Website
### Optional Fields
- Primary Contact
- Address
- Sub-Sectors
### Filters
- General text search
- Company name, company ref, lead type, priority, freerider, assigned to, next action by, created date from/to, service interest, generated by
### Sorting
- To be determined
## Creating a Lead
- Selecting an existing company or entering a new company name
- Entering a new address using postcode lookup or manual entry
- Setting mandatory and optional fields
- Assigning status, priority, and assigning to a user
- Generated by field is user selectable
## Lead Statuses
- New
- In Progress
- Converted
- Lost
- Cancelled
## Advanced Search
- Filters
- Sorting
## Lead Lookups
- New Reasons type lookups
- Lead Probability
## Additional Functionality
- Notes/Audit
- Actions
- Communications
- Project Management & Wireframing
## Contacts on Lead
- Ability to add and manage multiple contacts for a lead
## Bulk Import Leads
- Ability to import leads from a CSV file
## Sending Email
- Ability to send email from within a lead
## Creating Company, Address, Contacts
- Option to create new company, address, contacts from within a lead
## Permissions
- New permissions required for bulk import and email functionality
## Linking Leads and Applications
- Creating links between Leads and Applications
- Synchronizing Lead and Application statuses
* Converting Leads when Applications are approved
* Cancelling or setting Leads to Lost when Applications are cancelled or rejected
* Unlinking Leads and Applications when statuses change or manually intervened
Tweaking
You are a helpful assistant tasked with creating a description of a vertical slice of a software system.
You are first tasked with creating a list of headings and sub-headings for the area of the system. DO NOT Generate the description yet, just the headings.
The user will descibe what the area of the system relates to, the current list of headings and a list of stories that have been completed.
You will then provide a new list of headings under which all of the information could be neatly categorized under.
The user will provide the current version of the headings between [existing description] and [first story]
Stories are delimited by the [next story] token.
You will output ONLY the new list of headings and sub-headings.
You will NOT remove any headings from the list.
Headings should aim to have a couple paragraphs of information under them. They should not be too specific.
Individual fields should not be headings. Headings should be general like "Creating an Application" and not "Application Ref".
Write in the present tense.
Output in markdown format, using bullet point lists and headings for brevity.
Use only the # character for headings and ## for sub-headings. Do not use more than two levels of headings.
# Leads
## Lead Management
### Lead Creation and Editing
### Lead Statuses and Options
### Lead Filtering and Sorting
### Lead Notes and Communications
### Lead Documents and Management
### Lead Actions and Tasks
### Lead Lookups and Search
## Lead Quotations
### Lead Quotation Creation and Editing
### Lead Quotation Statuses and Options
### Lead Quotation Filtering and Sorting
### Lead Quotation Notes and Communications
### Lead Quotation Documents and Management
### Lead Quotation Actions and Tasks
### Lead Quotation Lookups and Search
## Lead Contacts
### Primary Contact
### Additional Contacts
### Contact Management
## Lead Import and Export
### Bulk Add Leads
### CSV Import
### Duplicate Checking
## Lead Communication
### Send Email
### Email Templates
### Sent Emails
## Lead Generation
### Created By
### Generated By
## Lead Information
### Company
### Address
### Contacts
## Lead Status and Actions
### Lead Statuses
### Lead Actions
### Lead Cancellation
### Lead Conversion
### Lead Status Changes
#### Cancel Lead
#### Mark as Lost
#### Convert Lead
#### Print and Email Quotations
## Lead Customization
### Email to All Contacts
### Material Icons
### Service Interest Lookup
ollama llama3:9b
Here is a suggested list of headings and subheadings for the Leads functional area:
# Introduction
## Overview of Lead Management
### Key Concepts and Terminology
# Lead Management
## Lead List View
#### General Search
##### Customizable Filtering Options
## Lead Details
#### Mandatory Fields
##### Optional Fields
###### Additional Information
# Quotations and Applications
## Creating and Editing Quotations and Applications
#### Printing and Emailing Documents
# Statuses and Transitions
## Current Statuses
##### Status Transitions and Rules
### Cancellation and Loss
#### Cancel Lead
##### Reason for Cancellation and Comment
#### Mark as Lost
##### Reason for Loss and Comment
### Conversion
#### Convert Lead to Opportunity
##### Mandatory Fields for Conversion
# Linking and Utilities
## Creation and Editing of Links
##### Duplicate Check and Suggestion Modal
## Advanced Search Options
##### Bulk Operations (Add, Edit, Delete)
###### Copy Lead FunctionNo more stories to add to section Leads
ollama llama3:70b
# Introduction
# Lead Management
## Creating Leads
### Selecting Companies
### Entering Address and Contact Information
### Adding Lead Details and Metadata
## Viewing and Editing Leads
### Lead Summary and Related Documents
### Modifying Lead Status and Details
# Quotations
## My Quotations
### Printing and Downloading Quotations
### Emailing Quotations
#### Email Composition and Sent Emails
## Creating Quotations
### Mandatory Fields for Creation
### Free Format Detail Section
## Viewing Quotations
### Quotation Summary and Related Documents
# Lead Communication
## Sending Emails from Leads
### Email Composition and Sent Emails
# Contacts Management
## Creating and Viewing Contacts
### Contact Summary and Related Documents
# Company Management
## Activating Inactive Companies
# Address Management
## Creating Leads from Addresses
# Lead List Views
## Filtering and Sorting Leads
### Material Icons for Services
### Accessing Leads from Companies and Addresses
# Reporting and Auditing
## Tracking Changes and Status Updates
ollama llama3:9b Generation
Recolight use leads to track potential new customers.
From the **Leads List**, users can:
* Create
* Edit
* View Details
* Contacts:
+ Add Primary Contact
+ Display list of contacts with count on tab header
+ Website
* Copy Lead function
* Bulk add leads from a CSV file via the existing Imports page
The **Leads List** view displays the following columns:
* Company (either existing or new/company name)
* Customer Of (as per Cases)
* Lead Type
* Priority
* Freerider
* Assigned To
* Next Action By
* Created Date
* Updated Date
* Generated By (user-selectable from internal users)
* Website
Filters:
* General text search for reference
* company name, company ref, lead type, priority, freerider, assigned to, next action by, created date from/to, service interest
Sorting: TBD
The following mandatory fields are required:
* Company (either existing or new/company name)
* Primary Contact (either existing or new - if new, this will not create a contact in main R3, if existing then it must be one of the company's contacts if for an existing company)
* Source
* Priority
* Details
* Recolight Service Interest
* Status (defaults to New)
* Assigned To (user - allow multiple)
* Next Action By (single team)
Lead Statuses:
1. New
2. In Progress
3. Converted
4. Lost
5. Cancelled
Additionally, you can send an email from within a Lead with the following options:
* Set a subject and details (simple multiline text box)
* The subject will default to the Lead Reference
**Lead Quotation**
The quotation produced from a lead should also show:
- Main contact
- Lead Ref in the format: Quotation Ref Q4 (LE21)
where the lead is for an existing site, the Site Address Ref
Quotations can be viewed and printed from within the leads list, with the following details:
- The main contact
- The Lead Ref
- Where the lead is for an existing site, the Site Address Ref
A new icon should be added to the Leads List to indicate that a quotation exists on a lead.
**Application Quotation**
The document output when the Applicant clicks on the Print Quotation button should be called âQuotationâ and show âQuotation Detailsâ
This document should include:
- The wording âQuotes are valid for 7 days, subject to availabilityâ
- Site Address Ref
- A new quote reference each time the applicant (or other user) clicks the "Print Quotation" button
The Payment Terms and Bank details should be removed from the Application Quotation
A copy of this document should be placed in the tab Application/Documents.
In the LHS of Leads List, show material icons as per Jobs.
Issues this session
Canât talk to ollama
Had to add   âânetwork=hostâ to devcontainer and rebuild
Getting ollama setup
Box is out of date, donât want to update as that could mess with cuda installation.
Use docker but they only give example of normal docker. Use compozize to generate a docker compose file for it
Getting shorter output
Add max-tokens=160000 to the output
headings donât serialize correctly
<headings><database.DocumentHeading object at 0x7f3b2c70dbd0></headings>
<headings><database.DocumentHeading object at 0x7f3b2c70d3c0></headings>
<headings><database.DocumentHeading object at 0x7f3b2c70d120></headings>
<headings><database.DocumentHeading object at 0x7f3b2c70d540></headings>
<headings><database.DocumentHeading object at 0x7f3b2c70d300></headings>
nested objects arenât going to xml very easy. Using the typing library able to just use a dict which serializes right.
writing content that isnât in the heading
solution: add the headings into the prompt again.
overwriting good information
Tried re-iterating not to remove information. Might have to loop a human in and get them to okay diffs? Try with the non ollama, or try a bigger model?
Other changes
added The stories contain information about changes to the system, you must describe the system as it is after the changes have been made. The description must be internally consistent.
Current Generation
# Leads List Page
Leads is a form which users fill out to request services.
## Advanced Search
Users can filter leads based on:
* Company name
* Company reference
* Lead type
* Priority
* Freerider
* Assigned to
* Next action by
* Created date from/to
Contacts on Lead
A Lead will have a Primary Contact, however there will also be a list of contacts on a Contacts tab for Recolight to be able to add additional contacts.
Additionally, leads can now be filtered based on:
* Material icons
# Import Leads
## Fields
The import process for leads requires the following fields:
- Name
- Email
- Created Date
- Website
# Import Leads
Importing leads is a process that creates multiple leads in the system. The import process includes:
## Fields
* Company (either existing or new, with creation option)
* Addresses (either existing or new, with creation option)
* Contacts (either existing or new, with creation option)
* Lead Type (Recolight Business Type)
* Probability
* Anticipated Closure Date
* Status
## Import Process
The import process includes the following steps:
- Upload a file containing the leads to be imported
- Map the fields in the uploaded file to the corresponding fields in the system
- Review and validate the data before completing the import
# Lead Details
The lead details page is where users can view and edit the information for a specific lead.
## Mandatory Fields
This section contains the following mandatory fields:
- Company (either existing, or new / company name)
- Primary Contact (either existing or new - if new, this will not create a contact in Recolight if it doesn't already exist, and if the Company is inactive or retired on converting the lead, please make the company active)
- Addresses must exist or have been created from Lead
- Contacts must exist or have been created from Lead
- Lead Type (Recolight Business Type)
- Probability
- Anticipated Closure Date
- Status
## Other Fields
In addition to the mandatory fields, the lead details page also includes:
* Material icons as per Jobs, displayed on the left-hand side of the leads list.
Note: The material group is optional and will only be shown if a service interest is selected. If no service interests are present or there is no material group, the icon will not display.
# Quotations and Applications
Quotations and Applications is a functional area which enables users to manage quotations for both leads and applications. The feature allows external users to view, download, and print quotes for their own applications, while internal users can view and edit all quotations.
## Creating and Editing Quotations and Applications
The feature provides the ability to create and edit quotations for both leads and applications. It includes printing and emailing document options. Applicants can view, download, and print quotes for their own applications. Internal users can also view and edit all quotations.
#### Printing and Emailing Documents
When sending an email, the system will only send it to the applicant if the quote is from an application. For quotations generated from leads, the system will send it to the first contact added. The download option enables users to access a printed copy of the quote in both internal and external views.
As requested, material icons are now shown in the left hand side (LHS) of the Leads List.
# Leads List Page
Leads list page allows users to view and manage leads. The page features an advanced search function, allowing internal users to filter leads by various criteria.
## Advanced Search
The advanced search functionality includes options for filtering leads based on:
* Company name
* Address
* Contact details
* Lead type
* Status
## Sorting
Leads can be sorted in ascending or descending order by the following fields:
- Created Date
- Last Updated Date
# Import Leads
Importing leads enables users to efficiently populate their lead database. The import process involves mapping fields from a CSV file to corresponding fields in the system.
## Fields
The following fields are available for importing leads:
* Company name
* Address
* Contact details
* Lead type
* Status
## Import Process
The import process allows internal users to upload a CSV file and map it to the relevant lead fields. The system will then create or update leads based on the imported data.
# Lead Details
Lead details contain various information about a lead, including:
* Company name
* Addresses
* Contacts
* Lead Type
* Probability
* Anticipated Closure Date
* Status
Other fields in the lead details include:
- Created Date
- Last Updated Date
Mandatory fields for lead details are:
- Company
- Addresses
- Contacts
- Lead Type
- Probability
- Anticipated Closure Date
- Status
# Linking and Utilities
Users can create and edit links between companies, addresses, and contacts. When creating a new link, they can select an existing company or enter the name of a new company to prevent duplicate entries.
Additionally, there is now the option to convert leads into customers. To do this, the user must set the status to "Converted" and provide additional mandatory information/fields: Company, Addresses, Contacts, Lead Type (Recolight Business Type), Probability, Anticipated Closure Date, and Status.
Users can also create a lead from an address by selecting the "Create Lead" option from the Address tab. The leads list page includes an option to create or edit leads, showing only leads for existing companies/adresses.
Furthermore, it is possible to email all contacts at the lead address, whether they are linked to the lead or not.
# Copy Lead
The **Copy Lead** feature allows users to create a duplicate lead from an existing lead.
## Creating a Duplicate Lead
When copying a lead, the following information will be duplicated:
* Company (either selecting an existing company or entering a new company name)
* Address (with postcode lookup or manual entry for new addresses)
* Contact (optional)
The mandatory fields to be copied are:
* Primary Contact (optional)
* Source
* Source Detail
* Priority
* Details
* Recolight Service Interest
* Status
* Assigned To
* Next Action By
Additional information that will be duplicated includes Lead Key/VIP and any selected subsectors.
New features added in this release include:
* The ability to add a website URL to the lead