Reflexion Agent is a powerful tool-calling agent implemented using the Temporal Go SDK and instructor-ai/instructor-go. It demonstrates an advanced AI-powered workflow that combines initial response generation, self-reflection, and information retrieval to provide comprehensive and accurate answers to user queries.
- Implements the Reflexion architecture for improved AI responses
- Utilizes Temporal workflows for robust and scalable execution
- Integrates instructor-ai for AI-powered decision making
- Includes a mock search service for demonstration purposes
- Implements OpenTelemetry tracing for observability
The Reflexion Agent is implemented as a Temporal workflow with three main activities:
- Initial Responder: Generates an initial answer, reflection, and search query.
- Search: Performs a search based on the generated query.
- Revisor: Revises the initial answer based on search results.
The workflow orchestrates these activities to produce a final, refined answer to the user's question.
- Update the
instructor.NewClient("your-api-key")
inmain.go
with your actual API key. - Modify the
MockSearchService
inmock_search.go
to integrate with a real search service if needed.
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.