| --- |
| title: AI Agent POC |
| emoji: 🧮 |
| colorFrom: blue |
| colorTo: purple |
| sdk: docker |
| sdk_version: latest |
| app_file: app.py |
| pinned: false |
| --- |
| |
| # AI Agent POC |
|
|
| A friendly Math Tutor AI agent built with Chainlit and LangChain, powered by Anthropic's Claude. |
|
|
| ## Features |
|
|
| - Interactive chat interface using Chainlit |
| - Math tutoring for elementary school students |
| - Streaming responses for real-time interaction |
| - Powered by Claude 3.5 Sonnet |
|
|
| ## Setup |
|
|
| ### Local Development |
|
|
| 1. **Create and activate a virtual environment:** |
| |
| **Windows (PowerShell):** |
| ```powershell |
| python -m venv venv |
| .\venv\Scripts\Activate.ps1 |
| ``` |
| |
| **Windows (CMD):** |
| ```cmd |
| python -m venv venv |
| venv\Scripts\activate.bat |
| ``` |
| |
| **Linux/Mac:** |
| ```bash |
| python -m venv venv |
| source venv/bin/activate |
| ``` |
|
|
| 2. **Install dependencies:** |
| ```bash |
| pip install -r requirements.txt |
| ``` |
|
|
| 3. **Set up your API key:** |
| |
| Create a `.env` file in the project root: |
| ```bash |
| ANTHROPIC_API_KEY=your_api_key_here |
| ``` |
| |
| Or set it as an environment variable: |
| - **Windows (PowerShell):** |
| ```powershell |
| $env:ANTHROPIC_API_KEY="your_api_key_here" |
| ``` |
| - **Windows (CMD):** |
| ```cmd |
| set ANTHROPIC_API_KEY=your_api_key_here |
| ``` |
| - **Linux/Mac:** |
| ```bash |
| export ANTHROPIC_API_KEY=your_api_key_here |
| ``` |
| |
| 4. **Run the application:** |
| ```bash |
| chainlit run app.py |
| ``` |
| |
| The app will start on `http://localhost:8000` by default. |
|
|
| 5. **Access the chat interface:** |
| - Open your browser and navigate to `http://localhost:8000` |
| - Start chatting with the AI agent! |
|
|
| ### Hugging Face Spaces Deployment |
|
|
| 1. Set your `ANTHROPIC_API_KEY` in the Space secrets |
| 2. The app will automatically deploy when code is pushed |
|
|
| ## Usage |
|
|
| Simply start chatting! The AI agent will guide you through the Design Thinking process. |
|
|