Springo - AI Assistant Backend powered by Amazon Bedrock, rebuilt with FastAPI.
This is the FastAPI version of Springo, migrated from Flask to leverage async/await for better performance and scalability.
Async/Await : Full async support for non-blocking I/O
Pydantic Models : Type-safe request/response validation
Auto-generated Docs : OpenAPI/Swagger documentation at /docs
MCP Tools Integration : Async tool execution with parallel support
SSE Streaming : Server-Sent Events for real-time responses
Session Management : JSONL-based session persistence
Python 3.11+
AWS credentials configured
Amazon Bedrock access
# Create virtual environment
python3 -m venv venv
source venv/bin/activate
# Install dependencies
pip install -r requirements.txt
# Development mode (with auto-reload)
uvicorn api.main:app --host 0.0.0.0 --port 8081 --reload
# Production mode
uvicorn api.main:app --host 0.0.0.0 --port 8081 --workers 4
Using the Convenience Script
# Start server
python run.py
# Or with custom options
python run.py --port 8082 --workers 2
Method
Endpoint
Description
GET
/health
Health check
GET
/docs
Swagger UI documentation
GET
/openapi.json
OpenAPI schema
Method
Endpoint
Description
POST
/v1/messages
Send message to Claude (supports streaming)
POST
/v1/messages-auto
Auto tool loop mode
Method
Endpoint
Description
GET
/v1/tools/list
List available tools
POST
/v1/tools/execute
Execute single tool
POST
/v1/tools/batch
Execute multiple tools
GET
/v1/tools/{name}
Get tool info
Method
Endpoint
Description
GET
/v1/sessions
List sessions
GET
/v1/sessions/{id}
Get session
POST
/v1/sessions/{id}
Save session
DELETE
/v1/sessions/{id}
Delete session
POST
/v1/sessions/hash
Generate session hash
Method
Endpoint
Description
GET
/v1/context
Get context
POST
/v1/context/add
Add context
DELETE
/v1/context
Clear context
Method
Endpoint
Description
POST
/v1/news/search
Search news
GET
/v1/news/search
Search news (GET)
Method
Endpoint
Description
POST
/v1/images/generate
Generate image
POST
/v1/images/search
Search images
POST
/v1/images/upload
Upload image
springo-fastapi/
├── api/
│ ├── __init__.py
│ ├── main.py # FastAPI application
│ ├── config.py # Pydantic settings
│ ├── dependencies.py # Dependency injection
│ ├── routers/
│ │ ├── messages.py # Messages endpoints
│ │ ├── tools.py # Tools endpoints
│ │ ├── sessions.py # Sessions endpoints
│ │ ├── context.py # Context endpoints
│ │ ├── news.py # News endpoints
│ │ ├── images.py # Images endpoints
│ │ └── health.py # Health endpoints
│ ├── services/
│ │ ├── bedrock.py # Bedrock async client
│ │ ├── tool_manager.py # Tool manager
│ │ └── session_store.py # Session persistence
│ ├── models/
│ │ ├── requests.py # Request models
│ │ └── responses.py # Response models
│ └── utils/
│ └── streaming.py # SSE utilities
├── tests/
│ └── e2e/ # E2E tests
├── requirements.txt
├── pytest.ini
├── run.py # Convenience runner
└── README.md
Environment variables (prefix: SPRINGO_):
Variable
Default
Description
SPRINGO_AWS_REGION
us-west-2
AWS region
SPRINGO_BEDROCK_MODEL_ID
anthropic.claude-sonnet-4-20250514-v1:0
Bedrock model
SPRINGO_HOST
0.0.0.0
Server host
SPRINGO_PORT
8081
Server port
SPRINGO_DEBUG
true
Debug mode
# Run all E2E tests
pytest tests/e2e/ -v
# Run with coverage
pytest tests/e2e/ -v --cov=api --cov-report=html
# Run benchmarks
pytest tests/e2e/test_benchmark.py -v -s
Benchmark results (M3 Mac):
Endpoint
Requests/sec
/health
~1,000+
/v1/tools/list
~450
/v1/tools/execute
~170
/v1/sessions
~28
Health latency
~1.2ms
This project is a FastAPI rewrite of the original Flask-based Springo. Key improvements:
Async/Await : Non-blocking I/O throughout
Type Safety : Pydantic models for all request/response
Auto Documentation : OpenAPI/Swagger auto-generated
Parallel Tools : Concurrent tool execution support
Better Testing : Comprehensive E2E test suite
Licensed under the Apache License 2.0 .