Skip to main content
Provide context to your agent at creation time just before a call. This enables them to manage the call more effectively.

Use Cases

Just-in-time context enables you to:
  • Tailored User Experience: Generate unique system prompts based on user data
  • Session-Specific Configuration: Create specialized agents for individual sessions
  • Context Augmentation: Adapt agent behavior based on external data sources

Implementation

You can provide just-in-time context in the system prompt field of the Create Agent endpoint. Since agent creation is a lightweight operation, you can generate agents dynamically just before a call to inject just-in-time context. The response includes the agent ID, which you can use to share as a direct link (https://bey.chat/{agent-id}) or embed via iframe. Agents created this way are typically single-use and disposable. To keep your agent collection clean, delete them after use with the Delete Agent endpoint. Conversations managed by these agents remain in your database.
Creating single-use agents for just-in-time context is a simple workaround. We plan to directly support dynamic context injection for agents in the future.

Complete Example

See our just-in-time context example for full implementation including API integration, context injection, and call data retrieval.

Next Steps