A Go-based financial assistant that provides real-time cryptocurrency prices, IBAN validation, and financial information through an AI-powered chat interface.
- 🤖 AI-Powered Chat: Interactive chat interface using OpenAI GPT-3.5
- 💰 Cryptocurrency Data: Real-time prices for Bitcoin and other cryptocurrencies
- 🏦 IBAN Validation: Validate and get information about International Bank Account Numbers
- 🔧 Tool Integration: Seamless integration with external APIs for financial data
- 🐳 Docker Support: Easy deployment with Docker and Docker Compose
- Go 1.23.6 or higher
- Docker and Docker Compose (optional)
- OpenAI API Key
- Ninja API Key
- Clone the repository:
git clone <repository-url>
cd finance-agent- Create a
.envfile in the root directory:
OPENAI_API_KEY=your_openai_api_key_here
NINJA_API_KEY=your_ninja_api_key_here- Install dependencies:
go mod download- Run the application:
go run cmd/main.goThe server will start on http://localhost:8080
- Build and run with Docker Compose:
docker-compose up --buildPOST /ask
Request body:
{
"user_id": "user123",
"question": "What's the current Bitcoin price?"
}Response:
{
"code": 200,
"status": "OK",
"data": {
"user_id": "user123",
"question": "What's the current Bitcoin price?",
"answer": "The current Bitcoin price is $45,000 USD. This information is based on real-time market data from cryptocurrency exchanges.",
"messages": [
{
"role": "user",
"content": "What's the current Bitcoin price?"
},
{
"role": "assistant",
"content": "The current Bitcoin price is $45,000 USD. This information is based on real-time market data from cryptocurrency exchanges."
}
]
}
}{
"code": 400,
"status": "Bad Request",
"error": "Validation error message"
}The AI agent can use the following tools:
- get_last_bitcoin_price: Returns the current Bitcoin price
- get_crypto_price: Returns the price of a specific cryptocurrency
- get_iban_information: Validates and provides information about IBAN numbers
finance-agent/
├── cmd/
│ ├── main.go # Application entry point
│ └── api/
│ ├── handler.go # HTTP request handlers
│ └── router.go # Route definitions
├── internal/
│ ├── agent/
│ │ ├── agent.go # Main agent logic
│ │ ├── mcp/ # Memory/context management
│ │ └── tools/ # Tool definitions and handlers
│ └── platform/
│ └── ninjaclient/ # External API client
├── dockerfile
├── docker-compose.yml
├── go.mod
└── README.md
| Variable | Description | Required |
|---|---|---|
OPENAI_API_KEY |
OpenAI API key for GPT-3.5 | Yes |
NINJA_API_KEY |
Ninja API key for financial data | Yes |
go test ./...go build -o finance-agent cmd/main.go- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
For support and questions, please open an issue in the repository.