Skip to content

Migrate conversation flow agentic features to Python/LangChain subproject#2

Merged
MinecraftFuns merged 5 commits intomainfrom
copilot/create-python-agentic-subproject
Oct 28, 2025
Merged

Migrate conversation flow agentic features to Python/LangChain subproject#2
MinecraftFuns merged 5 commits intomainfrom
copilot/create-python-agentic-subproject

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Oct 28, 2025

Extracts all agentic conversation flow logic from Go into a standalone Python/LangChain microservice. Go layer becomes pure message delivery; Python handles intelligent conversation processing via REST API.

Architecture

Go Service (Message Delivery)  ──HTTP──>  Python Agent (Conversation AI)
       │                                           │
       └────────────── Shared SQLite ──────────────┘

Implementation

Python Subproject (python/langchain/)

  • 3 LangChain Agents: Coordinator (routing), Intake (onboarding), Feedback (habit tracking)
  • 4 Tools: State transitions, profile persistence, scheduling, prompt generation
  • FastAPI REST API: /process-message endpoint for conversation processing
  • SQLite State Manager: Compatible with existing Go database schema

Testing

  • 16 unit tests covering models, state manager, tools (all passing)
  • Integration tests for conversation flows
  • 41% code coverage

Infrastructure

  • Package management with uv
  • Latest dependencies: LangChain 0.3+, FastAPI 0.115+, OpenAI 1.54+
  • Environment-based config, health checks, OpenAPI docs

Integration (Not Implemented)

Go service needs HTTP client to call Python API:

// internal/agent/client.go
agentClient := agent.NewClient("http://localhost:8001")
resp, err := agentClient.ProcessMessage(ctx, participantID, message, phoneNumber)
// Send resp.Response via WhatsApp

Full integration guide in python/langchain/INTEGRATION.md with:

  • Go HTTP client implementation
  • Conversation handler modifications
  • Deployment configurations (Docker, systemd, K8s)
  • Gradual rollout strategy

Documentation

  • README.md: Setup and development
  • DEPLOYMENT.md: Production deployment (Docker/K8s/systemd)
  • INTEGRATION.md: Go integration with code examples
  • MIGRATION_SUMMARY.md: Complete overview

No breaking changes: All Go tests still pass. Python service is standalone until integration code is added.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • api.openai.com
    • Triggering command: /home/REDACTED/work/PromptPipe/PromptPipe/python/langchain/.venv/bin/python3 /tmp/test_message2.py (dns block)
  • astral.sh
    • Triggering command: curl -LsSf REDACTED (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

your task is to create a subproject in python/langchain within this monorepo to implement all agentic features previously implemented in Go within the conversation flow. once completed the whole migration, the Python/langchain layer would be in charge of processing user message/replying to the user agentically, whereas the Go layer would be a pure message delivery service. Follow all best practices (e.g. using uv for package/virtualenv management; use latest dependencies; writing unit tests& integration tests all the way you go), and ensure the tests you create for the new subproject is all working properly before asking me to review.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 4 commits October 28, 2025 14:48
Co-authored-by: MinecraftFuns <25814618+MinecraftFuns@users.noreply.github.com>
Co-authored-by: MinecraftFuns <25814618+MinecraftFuns@users.noreply.github.com>
Co-authored-by: MinecraftFuns <25814618+MinecraftFuns@users.noreply.github.com>
…UMMARY)

Co-authored-by: MinecraftFuns <25814618+MinecraftFuns@users.noreply.github.com>
Copilot AI changed the title [WIP] Add Python/langchain subproject for agentic features Migrate conversation flow agentic features to Python/LangChain subproject Oct 28, 2025
Copilot AI requested a review from MinecraftFuns October 28, 2025 15:06
@MinecraftFuns MinecraftFuns marked this pull request as ready for review October 28, 2025 19:39
@MinecraftFuns MinecraftFuns merged commit 35adca3 into main Oct 28, 2025
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.

2 participants