File size: 1,507 Bytes
a3de586
3eb9f3e
 
 
 
648a915
 
a3de586
 
52fbe2a
a3de586
 
648a915
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3eb9f3e
648a915
 
 
 
 
 
 
 
 
 
 
 
a3de586
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
---
title: Agentic Assistant k2
emoji: 
colorFrom: blue
colorTo: gray
sdk: gradio
sdk_version: 5.38.0
app_file: app.py
pinned: false
short_description: Agentic base on top of kimi-k2-small to power internal MCP
---

# Agentic Assistant

A Gradio-based chat interface powered by LangChain and HuggingFace models.

## Setup

### 1. Install Dependencies
```bash
pip install -r requirements.txt
```

### 2. Environment Variables

Create a `.env` file in the project root with the following variables:

```bash
# Required: HuggingFace API Token
# Get your free token from: https://huggingface.co/settings/tokens
HUGGINGFACEHUB_API_TOKEN=your_huggingface_token_here

# Optional: SerpAPI Key (for web search functionality)
# Get your key from: https://serpapi.com/
SERPAPI_API_KEY=your_serpapi_key_here
```

### 3. Run the Application
```bash
python app.py
```

## Features

- 🤖 Powered by Moonshot AI's Kimi K2 1.5B model
- 🔍 Optional web search capability (requires SerpAPI key)
- 💬 Interactive chat interface with Gradio
- 🛠️ Built with LangChain for agent capabilities

## Troubleshooting

- **Missing API Token**: Make sure you've set the `HUGGINGFACEHUB_API_TOKEN` environment variable
- **Import Errors**: The code now uses `langchain_community` imports to avoid deprecation warnings
- **Web Search**: If you don't have a SerpAPI key, the agent will run without web search functionality

---

Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference