-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Cursor buildllm token context protocol 593a #1645
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
nicsins
wants to merge
11
commits into
agent0ai:main
Choose a base branch
from
dragon-and-panda:cursor_buildllm-token-context-protocol-593a
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
66887ff
Create python-publish.yml
nicsins 0b5ee8b
feat: Add blueprint for autonomous super-agency
cursoragent fa45c06
Add documentation for prompt personas and workflows
cursoragent f648468
Add immersive collaboration UI and multi-LLM routing
cursoragent 6b85fae
Add technical blueprint for Autonomous Listing Service
cursoragent f869902
Add co-development and iterative improvement docs
cursoragent ca28a29
feat: Add autonomous listing service scaffold
cursoragent f3c41bc
Merge pull request #1 from dragon-and-panda/cursor_buildbuild-autonom…
nicsins 5152e4d
Add token compression TCP protocol server
cursoragent 0940c6c
Document token compression protocol and extension flow
cursoragent f8f2567
Add simple Tkinter chat GUI for Ollama/OpenRouter
cursoragent File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| # This workflow will upload a Python Package to PyPI when a release is created | ||
| # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries | ||
|
|
||
| # This workflow uses actions that are not certified by GitHub. | ||
| # They are provided by a third-party and are governed by | ||
| # separate terms of service, privacy policy, and support | ||
| # documentation. | ||
|
|
||
| name: Upload Python Package | ||
|
|
||
| on: | ||
| release: | ||
| types: [published] | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| release-build: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: "3.x" | ||
|
|
||
| - name: Build release distributions | ||
| run: | | ||
| # NOTE: put your own distribution build steps here. | ||
| python -m pip install build | ||
| python -m build | ||
| - name: Upload distributions | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: release-dists | ||
| path: dist/ | ||
|
|
||
| pypi-publish: | ||
| runs-on: ubuntu-latest | ||
| needs: | ||
| - release-build | ||
| permissions: | ||
| # IMPORTANT: this permission is mandatory for trusted publishing | ||
| id-token: write | ||
|
|
||
| # Dedicated environments with protections for publishing are strongly recommended. | ||
| # For more information, see: https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment#deployment-protection-rules | ||
| environment: | ||
| name: pypi | ||
| # OPTIONAL: uncomment and update to include your PyPI project URL in the deployment status: | ||
| # url: https://pypi.org/p/YOURPROJECT | ||
| # | ||
| # ALTERNATIVE: if your GitHub Release name is the PyPI project version string | ||
| # ALTERNATIVE: exactly, uncomment the following line instead: | ||
| # url: https://pypi.org/project/YOURPROJECT/${{ github.event.release.name }} | ||
|
|
||
| steps: | ||
| - name: Retrieve release distributions | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| name: release-dists | ||
| path: dist/ | ||
|
|
||
| - name: Publish release distributions to PyPI | ||
| uses: pypa/gh-action-pypi-publish@release/v1 | ||
| with: | ||
| packages-dir: dist/ | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,186 @@ | ||
| # Autonomous Listing Service – Technical Blueprint | ||
|
|
||
| This document describes the design of an AI-native service that turns a seller’s raw photos and notes into premium listings, syndicates them across major marketplaces (Craigslist, Mercari, Nextdoor, etc.), and provides a unified conversational interface for negotiating with buyers. The system is intentionally agentic, multi-LLM, and RAG-enabled while running on a lightweight Python container suitable for serverless deployments. | ||
|
|
||
| --- | ||
|
|
||
| ## 1. Goals & Constraints | ||
| - **Delightful Listings:** Transform mediocre images + short descriptions into polished media and persuasive narratives that boost conversions. | ||
| - **One-Click Syndication:** Publish consistently formatted listings to multiple platforms with per-channel compliance. | ||
| - **Unified Messaging:** Give sellers a Zoom-like conversational hub to coordinate with AI agents and buyers while listings are live. | ||
| - **Autonomous Lifecycle:** Monitor inquiries, negotiate within guardrails, and auto-close listings once an item sells. | ||
| - **Portable Runtime:** Deliver as a Python-first, containerized micro-app deployable on Lambda, Cloud Run, or Fargate. | ||
|
|
||
| --- | ||
|
|
||
| ## 2. High-Level Architecture | ||
|
|
||
| ``` | ||
| User → Web/App UI → API Gateway → Python Orchestrator (FastAPI) → Agent Mesh | ||
| ↘ Event Bus / Task Queue | ||
| ↘ Worker Pods (image, LLM, RAG, integrators) | ||
| Storage Layers: Object storage (images), Vector DB (descriptions/market data), Relational DB (listings, chats) | ||
| ``` | ||
|
|
||
| ### Core Services | ||
| 1. **Ingestion & Auth** | ||
| - Accepts photo uploads, metadata, and voice/text notes. | ||
| - Performs safe content checks before processing. | ||
| 2. **AI Creativity Pipeline** | ||
| - Image Enhancement Agent: Upscales, denoises, applies lighting corrections, and composes collage thumbnails. | ||
| - Styling Agent: Suggests background removal or contextual scenes (e.g., staging furniture). | ||
| - Narrative Agent: Generates long-form descriptions leveraging a marketing RAG corpus + sentiment tuning for each marketplace. | ||
| 3. **Marketplace Integrators** | ||
| - Channel-specific adapters for Craigslist, Mercari, Nextdoor, (extensible to Facebook Marketplace, OfferUp, etc.). | ||
| - Normalizes categories, pricing, shipping, and handles platform-specific throttling/anti-bot rules. | ||
| 4. **Engagement Hub** | ||
| - Real-time messaging service bridging buyers (email/SMS/in-platform chat) with seller + negotiation agents. | ||
| - Shared timeline UI showing offers, counteroffers, and status changes. | ||
| 5. **Lifecycle Controller** | ||
| - Tracks listing states (draft → scheduled → live → pending sale → closed). | ||
| - Automatically unlists from all channels once a purchase is confirmed. | ||
|
|
||
| --- | ||
|
|
||
| ## 3. Agentic Workflow | ||
|
|
||
| | Step | Agent | Description | LLM Model(s) | | ||
| | --- | --- | --- | --- | | ||
| | Intake | Concierge Agent | Confirms item details, requests missing info, runs safety checklist. | GPT-4o or Claude 3.5 Sonnet | | ||
| | Visual Polish | Vision Stylist & Enhancer | Applies upscaling, background cleanup, style transfer tuned per category. | Stable Diffusion XL / ControlNet + DeepSeek-VL for QA | | ||
| | Narrative Crafting | Listing Copywriter | Generates short + long descriptions, bullet highlights, SEO tags, shipping guidance. Uses RAG on market best practices. | GPT-4.1 / Gemini 1.5 Pro | | ||
| | Valuation | Pricing Analyst | Benchmarks with comps fetched via search APIs; suggests optimal price tiers. | Claude 3.5 Haiku + internal comps DB | | ||
| | Syndication | Channel Publisher | Maps listing to each platform’s schema, posts, and verifies success. | Tool-executing agent via FastAPI + Selenium/API | | ||
| | Engagement | Buyer Liaison | Monitors inquiries, drafts responses, escalates to seller when negotiation boundaries hit. | GPT-4o mini (fast) with guardrails | | ||
| | Closure | Lifecycle Steward | Detects sale confirmation, auto-closes all channels, generates pick-up instructions. | Rule-based + LLM verification | | ||
|
|
||
| Agents communicate via the existing `call_subordinate` + `knowledge_tool` primitives, storing context in `memory`/`knowledge` for reuse (e.g., pricing heuristics, category guidelines). | ||
|
|
||
| --- | ||
|
|
||
| ## 4. AI Pipeline Details | ||
|
|
||
| ### 4.1 Image Enhancement | ||
| - **Stages:** (1) quality assessment → (2) super-resolution (e.g., Real-ESRGAN) → (3) background cleanup (Matte-ing) → (4) lighting & color grading → (5) layout collage. | ||
| - **Outputs:** hero image, 3–5 gallery shots, detail zooms, and optional lifestyle composite scene. | ||
| - **Instrumentation:** Each step logs metrics (sharpness delta, noise reduction) for future fine-tuning. | ||
|
|
||
| ### 4.2 Description + Sentiment Crafting | ||
| - **Inputs:** Seller notes, extracted metadata (dimensions via OCR, brand logos, etc.), prior sales comps. | ||
| - **RAG Sources:** Marketing playbooks, brand tone guides, compliance docs per platform. | ||
| - **Outputs:** | ||
| - Title optimized for SEO, | ||
| - Rich paragraph + bullet list, | ||
| - Condition disclosures, | ||
| - Suggested hashtags and shipping/pickup text. | ||
| - **Tone Tuning:** Different prompt templates per platform (e.g., concise for Craigslist, lifestyle-forward for Nextdoor). | ||
|
|
||
| ### 4.3 Pricing & Strategy | ||
| - Pulls live comps via aggregator APIs (where permitted) or stored datasets. | ||
| - Generates price ladder (list price, “fast-sale” price, minimum acceptable). | ||
| - Feeds guardrails to Buyer Liaison (auto-approve offers above threshold, escalate otherwise). | ||
|
|
||
| --- | ||
|
|
||
| ## 5. Marketplace Integrations | ||
|
|
||
| | Platform | Integration Mode | Notes | | ||
| | --- | --- | --- | | ||
| | Craigslist | Headless browser automation (Playwright) + email relay for replies. | Needs CAPTCHA-solving strategy (vision model + manual fallback). | | ||
| | Mercari | Official API (if available) or mobile-app automation. | Supports shipping label creation; track order IDs. | | ||
| | Nextdoor | Web automation w/ community selection. | Monitor community guidelines to avoid spam flags. | | ||
| | Custom / Others | Modular adapters via interface `MarketplacePublisher`. | Easy to add OfferUp, eBay, Etsy later. | | ||
|
|
||
| Failure handling: retries with exponential backoff, webhook-like callbacks to update listing state, and anomaly logging for manual review. | ||
|
|
||
| --- | ||
|
|
||
| ## 6. Unified Seller Interface | ||
|
|
||
| ### UX Tenets | ||
| - **Organic Flow:** Minimal forms; conversational onboarding with dynamic checklists. | ||
| - **Zoom-like Collab:** Agents appear as avatars, announce actions (e.g., “Copywriter drafting Mercari description”). Seller can join live huddles to approve or tweak content. | ||
| - **Inbox View:** Threaded conversations grouped by platform and buyer; AI-suggested replies with quick-edit controls. | ||
| - **Visual Dashboard:** Pipeline status (Processing Images → Drafting → Live on X platforms), price ladder, performance analytics. | ||
|
|
||
| ### Tech Stack | ||
| - **Frontend:** React/Next.js or SvelteKit with WebSockets for live updates. | ||
| - **Backend:** Python FastAPI orchestrator running inside a slim container (e.g., distroless + uvicorn). Event-driven tasks handled by Celery/Redis or AWS SQS + Lambda workers. | ||
| - **Storage:** | ||
| - S3-compatible bucket for assets, | ||
| - Postgres for listings/offers, | ||
| - Redis/WebSocket gateway for live messaging, | ||
| - Vector DB (Qdrant/Pinecone) for RAG corpora. | ||
|
|
||
| --- | ||
|
|
||
| ## 7. Serverless / Containerized Deployment | ||
|
|
||
| | Layer | Option | Notes | | ||
| | --- | --- | --- | | ||
| | API + UI | AWS Lambda (FastAPI via Mangum) or Cloud Run | Handles synchronous interactions. | | ||
| | Workers | AWS Fargate / ECS tasks or Cloud Run Jobs | For heavier image/LLM workloads. | | ||
| | Event Bus | AWS SQS + EventBridge or Pub/Sub | Decouples ingestion from processing. | | ||
| | Media Processing | AWS Lambda w/ GPU (if available) or attached GPU service | For rapid diffusion-based adjustments. | | ||
|
|
||
| CI/CD builds a single container image (FastAPI + worker binaries) pushed to ECR/GCR. Infrastructure-as-code (Terraform/Pulumi) provisions queues, storage, and secrets. | ||
|
|
||
| --- | ||
|
|
||
| ## 8. Data & Knowledge Fabric | ||
| - **Knowledge Packs:** | ||
| - Marketing best practices, | ||
| - Platform policy summaries, | ||
| - Visual staging tips per category. | ||
| - **RAG Pipeline:** | ||
| 1. Seller intent + item metadata → embed → retrieve from vector DB, | ||
| 2. Feed retrieved snippets into Copywriter prompts, | ||
| 3. Store resulting listing in `memory/solutions` for future reuse. | ||
| - **Personalization:** Seller preferences (tone, negotiation style) saved to memory and loaded automatically when they return. | ||
|
|
||
| --- | ||
|
|
||
| ## 9. Implementation Roadmap | ||
|
|
||
| 1. **Foundations** | ||
| - Spin up FastAPI skeleton + auth. | ||
| - Configure storage buckets, DB, and vector store. | ||
| 2. **AI Pipeline MVP** | ||
| - Integrate image enhancer (ESRGAN) + background removal. | ||
| - Build Copywriter agent with GPT-4o + RAG from initial corpus. | ||
| 3. **Marketplace Adapter Framework** | ||
| - Define `MarketplacePublisher` interface. | ||
| - Implement Craigslist + Mercari to validate both automation styles. | ||
| 4. **Engagement Hub** | ||
| - Real-time messaging API + UI view. | ||
| - Buyer Liaison agent with guardrails + escalation rules. | ||
| 5. **Lifecycle & Automation** | ||
| - Listing state machine, auto-closing logic, unified analytics. | ||
| 6. **Serverless Packaging** | ||
| - Containerize, add IaC, deploy to sandbox environment. | ||
| 7. **UX Polish** | ||
| - Zoom-like collaboration room, hero dashboard, onboarding wizards. | ||
| 8. **Compliance & Monitoring** | ||
| - Logging, anomaly detection, rate-limit watchdogs, content moderation pipeline. | ||
|
|
||
| --- | ||
|
|
||
| ## 10. Future Enhancements | ||
| - **Smart Negotiation:** Reinforcement-learning agent tuned on successful deal histories. | ||
| - **Buyer Discovery:** Cross-post to social channels with auto-generated reels/stories. | ||
| - **Shipment Automation:** Integration with UPS/FedEx APIs for instant label creation. | ||
| - **Reputation Engine:** Aggregate feedback across platforms to build seller trust profiles. | ||
| - **Predictive Demand:** Recommend best posting windows and price adjustments based on market trends. | ||
|
|
||
| --- | ||
|
|
||
| ## 11. Co-Development with the Super Agency | ||
|
|
||
| - **Mission Diary:** Maintain `docs/programs/autonomous_listing/journal.md` logging every experiment, release, and KPI shift so agents can learn from prior iterations. | ||
| - **Improvement Backlog:** Share a prioritized list (`docs/programs/autonomous_listing/improvements.md`) that feeds into the agency-wide iterative protocol (see Section 15 of `autonomous_super_agency.md`). | ||
| - **Telemetry Handoff:** Telemetry Sentinel publishes listing-service-specific health reports (conversion uplift, response latency, negotiation success rate) for Portfolio Navigator to review weekly. | ||
| - **Prompt Sync:** Copywriter, Buyer Liaison, and Publisher persona prompts live under `prompts/super-agency/roles/listing_*` and reference the same change log as the broader agency to keep behavior updates auditable. | ||
| - **Feedback Routing:** Any seller or buyer feedback entering the Engagement Hub is tagged and stored in `knowledge/custom/main/listings/` so the RAG corpus continuously reflects real-world voice-of-customer insights. | ||
| - **Release Ritual:** Every deployment of the service includes a short “What changed / Metrics impacted / Next bet” record appended to the mission diary, ensuring synchronous evolution of the agency and this product line. | ||
|
|
||
| This blueprint provides a detailed path to a serverless, AI-native listing concierge that delights sellers and scales across marketplaces with minimal manual effort. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this workflow, the release job runs
python -m buildfrom the repository root immediately after checkout, but I checked the root forpyproject.toml,setup.py, orsetup.cfgand none exists. That means every published release will fail inrelease-buildbeforedist/is uploaded or PyPI publishing can run; either add package metadata at the root orcdto the package that actually has it before building.Useful? React with 👍 / 👎.