File size: 1,047 Bytes
b0c3c60
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
# 🧠 Assistant API

The Bizz AI Assistant is a REST API designed to emulate chat behavior with optional memory persistence.

---

## Endpoints

### `GET /api/assistant/start`

> Used to ping and initialize the assistant system.

```bash
curl http://localhost:8000/api/assistant/start
```

Returns:

```json
{ "message": "ProjectPilot AI assistant activated!" }
```

---

### `POST /api/assistant/chat`

**Secure** – Requires `X-API-Key` header

Send user messages to the assistant:

```bash
curl -X POST http://localhost:8000/api/assistant/chat \
  -H "Content-Type: application/json" \
  -H "X-API-Key: change-me" \
  -d '{ "message": "Hello" }'
```

Returns the assistant's response and memory:

```json
{
  "response": "You said: Hello",
  "memory": [
    { "role": "user", "content": "Hello" },
    { "role": "assistant", "content": "You said: Hello" }
  ]
}
```

---

## Notes

- The memory buffer is in-memory only and limited to the last 50 messages.
- To persist data long-term, consider integrating Redis, PostgreSQL, or vector DBs.