File size: 2,870 Bytes
e7d9cd5
d243e59
e7d9cd5
d243e59
 
e7d9cd5
 
d243e59
 
 
 
 
 
 
 
890d952
335d527
d243e59
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
335d527
d243e59
 
 
 
 
 
 
 
 
 
335d527
d243e59
 
 
 
 
 
 
 
 
335d527
 
d243e59
 
 
 
 
 
 
 
335d527
 
d243e59
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
eb4910e
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
---
title: chat-with-avd-doc
app_file: app.py
sdk: gradio
sdk_version: 5.30.0
---

# Network Fabric Documentation Chat Assistant

![Network Documentation](https://img.shields.io/badge/Network-Documentation-blue)
![Python](https://img.shields.io/badge/Python-3.8+-yellow)
![ChromaDB](https://img.shields.io/badge/ChromaDB-Backend-green)
![Gemini](https://img.shields.io/badge/Gemini-Flash-purple)


Queries network documentation with natural languague.
Recommend interface ports to users based on network fabric documentation.

## πŸš€ Key Features

- **Natural Language Queries**: Ask questions about your network in plain English
- **Semantic Search**: Uses embeddings to find relevant information beyond simple keyword matching
- **Device-Aware Context**: Distinguishes between global and device-specific information
- **Interactive UI**: User-friendly Gradio web interface
- **Vector Database**: Persistent storage of document embeddings using ChromaDB
- **LLM Integration**: Powered by Google's Gemini Flash model
- **Customizable Prompts**: Configure system and user prompts through YAML

## πŸ“‹ Requirements

- Python 3.8+
- Dependencies listed in `requirements.txt`



## πŸ” Working with the Vector Database

The application uses FAISS to store document embeddings. The database is created in the `faiss_index` directory.

- Documents are organized by "fabric" collection
- Metadata includes source information that can identify device-specific documentation
- The system distinguishes between global network information and device-specific details


## πŸš€ Usage

1. **Start the application**:
   ```bash
   uv run app.py
   ```

2. **Access the UI**:
   Open your browser to http://127.0.0.1:7860

3. **Query your network documentation**:
   - Ask natural language questions about your network
   - Example: "What is the loopback Pool address used by the fabric?"
   - Example: "How many IP addresses are in use in the management network?"
   - Example: "I need unused ports to connect 6 servers. provide me a pair of connections per server."
   - Example: "What is the name server in this network? -> 8.8.8.8"

## πŸ“‚ Project Structure

```
chat-with-avd-doc/
β”œβ”€β”€ app.py              # Main application with Retriever Tool and Gradio UI
β”œβ”€β”€ prompts.yaml        # Configuration for AI prompts and behavior
β”œβ”€β”€ requirements.txt    # Python dependencies
└── faiss_index/        # FAISS database files
    β”œβ”€β”€ faiss.index     # FAISS index file
```


## πŸ“„ License

MIT License

## 🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

1. Fork the repository
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
3. Commit your changes (`git commit -m 'Add some amazing feature'`)
4. Push to the branch (`git push origin feature/amazing-feature`)
5. Open a Pull Request