Skip to content
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

Prompt Management #946

Open
Vaibhav-Lodha opened this issue Jan 8, 2025 · 8 comments
Open

Prompt Management #946

Vaibhav-Lodha opened this issue Jan 8, 2025 · 8 comments
Assignees

Comments

@Vaibhav-Lodha
Copy link
Contributor

Vaibhav-Lodha commented Jan 8, 2025

Feature Request: Prompt Management System

It is unclear whether this feature request aligns with Pipecat’s primary functionality. However, it would be beneficial to incorporate a basic prompt management system within Pipecat. This would facilitate the easy deployment and utilization of Pipecat in production environments.
While there are existing services that offer similar capabilities, it would be advantageous to have this feature integrated directly into Pipecat.

@markbackman
Copy link
Contributor

@Vaibhav-Lodha what type of features are you looking for exactly? Can you explain the use case you have in mind?

@chadbailey59 chadbailey59 added need-more-info waiting on more info from requester and removed enhancement labels Jan 16, 2025
@Vaibhav-Lodha
Copy link
Contributor Author

Vaibhav-Lodha commented Jan 20, 2025

Standardized Prompt Management and Dynamic Usage

Description

We need a standardized way to define and use prompts dynamically within the system. This includes versioning prompts based on the environment (e.g., dev, staging, production) or labels, ref langfuse and structuring them around key components such as:

  • Main Script: The core logic of the agent.
  • Greetings: Initial messages or prompts.
  • End Call: Closing messages or prompts.
  • Standard Structure: A consistent framework for organizing prompts.

Additionally, the system should support:

  • Caching: To improve performance and reduce redundant operations.
  • Optional Database Integration: For advanced use cases, but prompts should primarily be manageable within the repository itself.

The goal is to create a more complete agent management system that minimizes the need for deploying code outside the repository. Native support for these features would make the system more robust and self-contained.

Proposed Solution

  1. Prompt Versioning: Allow prompts to be versioned based on the environment (e.g., prompt_v1_dev, prompt_v1_prod).
  2. Dynamic Usage: Enable prompts to be dynamically loaded and used within the main script, greetings, and end call components.
  3. Standard Structure: Define a consistent structure for organizing prompts, making it easier to manage and update them directly within the repository.
  4. Caching Mechanism: Implement caching to store frequently used prompts, reducing load times and improving efficiency.
  5. Optional Database Integration: Provide the ability to store prompts in a database for advanced use cases, but ensure that prompts can be fully managed within the repository by default.

Benefits

  • Self-Contained System: Prompts are managed within the repository, reducing dependencies on external systems.
  • Improved Management: Easier to manage and version prompts, especially in different environments.
  • Performance: Caching improves performance and scalability.
  • Flexibility: Optional database integration allows for advanced use cases without complicating the default workflow.
  • Consistency: A standardized structure ensures consistency across different parts of the system.

@markbackman
Copy link
Contributor

markbackman commented Jan 20, 2025

@Vaibhav-Lodha thanks for the detailed write up. Pipecat Flows does some of this already, at least in terms of having a structured conversation. Have you checked that out?

Given that Flows offers the structured conversation already, it sounds like you're asking for a prompt management system similar to langfuse; that is prompt versioning and storage plus other affordances. Is that accurate?

@marcklingen
Copy link

Just found this ("langfuse" alert) -- I'm one of the maintainers

Let me know in case you want to explore an integration, pipecat seems to be really interesting and prompt management turned out to be a way more involved product than we thought it would be when initially creating it, learn more here: langfuse.com/docs/prompts

@chadbailey59
Copy link
Contributor

@marcklingen I've been thinking about making pipecat's "central brain" a bit more modular. Langfuse could be an interesting part of that. I'll let you know if I build anything interesting!

@chadbailey59 chadbailey59 removed the need-more-info waiting on more info from requester label Jan 20, 2025
@chadbailey59 chadbailey59 self-assigned this Jan 20, 2025
@chadbailey59
Copy link
Contributor

@Vaibhav-Lodha I think it's more likely that we'd enable the use of third-party services like Langfuse rather than the core team building this directly into pipecat. If someone else is interested in building it, we'd welcome a community PR.

@marcklingen
Copy link

@marcklingen I've been thinking about making pipecat's "central brain" a bit more modular. Langfuse could be an interesting part of that. I'll let you know if I build anything interesting!

Sounds good! Makes sense that growing too broad/coupled makes maintaining pipecat more difficult than necessary. Ping me anytime when you want to get to third-party prompt management as we have made a lot of learnings since releasing this initially.

@aconchillo
Copy link
Contributor

aconchillo commented Jan 20, 2025

That's right. The goal is to keep Pipecat as small as possible but with all the functionality necessary so you can build advanced features such as a Pipecat Flows or integrate with langfuse.

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

No branches or pull requests

5 participants