An AI-powered reflection agent that helps you process and learn from your thoughts, experiences, and reflections. The agent uses LangChain and OpenAI to extract key insights, facts, and actionable plans from your personal reflections.
The Reflection Agent takes your personal reflections and:
- Extracts 5 main points - Identifies the key learnings and insights
- Creates a list of facts - Separates objective facts from opinions
- Generates an action plan - Creates specific, actionable steps to integrate learnings into daily life
- Checks for repetition - Ensures content isn't overly repetitive
- Provides a summary - Combines everything into a comprehensive overview
- Streaming updates - Real-time progress updates via Server-Sent Events
- REST API - Simple HTTP endpoints for integration
- Web interface - Built-in frontend for easy interaction
- Secure - Uses environment variables for API keys
- Node.js (v18 or higher)
- OpenAI API key
- Clone the repository:
git clone https://github.com/NihaalManaf/Reflection-agent-fresh.git
cd Reflection-agent-fresh- Install dependencies:
npm install- Create a
.envfile in the root directory:
OPENAI_API_KEY=your_openai_api_key_here- Start the server:
npm startThe server will start on http://localhost:3000
Visit http://localhost:3000 to use the web interface.
Process a reflection and get the complete result.
curl -X POST http://localhost:3000/invoke \
-H "Content-Type: application/json" \
-d '{"content": "Your reflection text here"}'Process a reflection with streaming updates.
curl "http://localhost:3000/invoke-stream?content=Your%20reflection%20text%20here"| Variable | Description | Required |
|---|---|---|
OPENAI_API_KEY |
Your OpenAI API key | Yes |
PORT |
Server port (default: 3000) | No |
- API keys are stored in environment variables
- No sensitive data is committed to the repository
- Comprehensive
.gitignoreprevents accidental key exposure
MIT License