Skip to content

feat(icp): add chat-based ICP creation and edit interface - #16

Open
Rishavraaj wants to merge 3 commits into
mainfrom
feat/icp-chat-interface
Open

feat(icp): add chat-based ICP creation and edit interface#16
Rishavraaj wants to merge 3 commits into
mainfrom
feat/icp-chat-interface

Conversation

@Rishavraaj

Copy link
Copy Markdown
Member

Summary

Before this PR, creating or editing an ICP profile used a form sheet with dropdowns. It was rigid — you had to know exactly what filters to pick. Now you just describe your ideal customer in plain English and AI builds the filters for you.

  • You type something like "SaaS companies in India, 50–500 employees, targeting CTOs using Salesforce"
  • AI converts that into structured Apollo search filters
  • It shows you a preview with how many contacts match
  • You confirm, give the profile a name, and it's saved

Editing works the same way — the Edit button now opens the same chat, but pre-loaded with existing filters. You can say "add Bengaluru" or "also target VPs" and it merges your change in without losing anything.

Changes

New chat interface

  • IcpChat component — a chat window that walks you through describing your ICP, reviewing filters, and saving the profile
  • /icps/new — new page that opens the chat for creating a profile
  • /icps/:id/edit — new page that opens the chat pre-filled with existing filters for editing

Smarter filter refinement

  • When you ask to change something (e.g. "add Bengaluru"), the AI gets the current filters as context so it merges your request instead of starting from scratch. Previously it would drop everything and only return what you just said.
  • AI now classifies your reply as "confirm" or "change something" — so any natural phrasing works, not just specific keywords like "yes" or "confirm"

Profile detail panel

  • Edit button navigates to the chat edit page instead of opening a sheet
  • Now shows all filters: company name, excluded locations, job titles, seniority levels, technologies

Removed contact DB sync

  • The "Run ICP" button and the endpoint behind it are removed
  • Contacts are fetched live from Apollo's free search endpoint — no credits used, no DB writes needed

Fixed Apollo search bugs

  • Company location filter was sending to the wrong Apollo field (person_locationsorganization_locations)
  • Company name filter and excluded locations were missing from the contacts search payload — this was causing 28M contacts to be returned instead of the expected few hundred

Test plan

  • Go to /icps/new, describe an ICP, confirm filters, name it, verify profile is created and you land on the profile page
  • Open a profile → click Edit → chat opens with existing filters shown → say "also target VPs" → verify VP title is added and other filters are kept
  • Say something vague to confirm ("looks good", "save it", "yes") — verify it saves
  • Say something vague to refine ("tweak the location") — verify it asks for more info instead of saving
  • Profile detail panel shows all filter types (location, titles, seniority, tech, excluded locations)
  • Contacts tab returns a reasonable count (not 28M) when company name filter is set

@Rishavraaj
Rishavraaj force-pushed the feat/icp-chat-interface branch 2 times, most recently from 97a1322 to 923c866 Compare July 27, 2026 07:47
- Add IcpChat component with state machine (description → compile → confirm → name → create)
- Add /icps/new page using chat flow instead of form sheet
- Add /icps/:id/edit page for editing via chat (starts at awaiting_confirm with existing filters)
- Edit button in profile sidebar navigates to /icps/:id/edit instead of opening sheet
- Show all filters (organizationName, excludeLocations, personTitles, personSeniorities, technologiesAnyOf) in profile detail panel
- Remove contact DB sync; serve contacts live from Apollo (free endpoint)
- Remove RunIcpButton and POST /:id/run endpoint
- Use LLM (gpt-4o-mini) to classify confirm vs refine intent instead of keyword matching
- Add POST /icps/refine-filters endpoint: passes current filters as context so refinements merge instead of replacing existing filters
- Fix contacts search: map locations → organization_locations (not person_locations), add organizationName and excludeLocations to payload

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@Rishavraaj
Rishavraaj force-pushed the feat/icp-chat-interface branch from 923c866 to d4f044e Compare July 27, 2026 07:53
Rishavraaj and others added 2 commits July 27, 2026 15:37
…alidation

- Add POST /icps/preview-filters (no profile ID) so new-ICP chat can
  preview Apollo counts before a profile exists; old /:id/preview-filters
  kept for edit mode
- Extract shared runPreview() helper in IcpService
- Add ClassifyIntentDto (MinLength 1) so short replies like "yes" pass
  validation on classify-intent (was failing with MinLength 10)
- Frontend: previewFilters() accepts id|undefined, routes to anon
  endpoint when no profile; drop ?? 1 fallback

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Prevents full page reloads on back button and internal links.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant