An AI-powered observability backend for log analysis, incident tracking, and operational debugging workflows.
This project is being built incrementally using FastAPI and evolves from a structured CRUD backend into a production-style incident intelligence platform with semantic retrieval, AI-assisted debugging, and RAG-based operational analysis.
- Async FastAPI REST API
- Layered backend architecture
- PostgreSQL integration
- Async SQLAlchemy 2.0 ORM
- Alembic database migrations
- Incident CRUD operations
- Dynamic filtering & querying
- Pagination support
- Configurable sorting
- Tag-based filtering
- Search functionality
- Pydantic v2 schema validation
- Enum-based validation
- UUID primary keys
- PostgreSQL ENUM + ARRAY types
- User registration & authentication
- Password hashing with pwdlib
- JWT access token authentication
- Protected API routes
- Current user dependency injection
- Role-Based Access Control (RBAC)
- User management APIs
- Audit logging
- Audit log querying & filtering
- Custom exception hierarchy
- Centralized exception handling
- Request logging middleware
- Automated async API testing with pytest
- Dependency injection with AsyncSession
- Swagger/OpenAPI documentation
- Refresh token support
- Redis caching
- Background job processing
- Log ingestion pipelines
- Operational analytics dashboard
- AI-powered incident summarization
- Incident root cause analysis
- Semantic incident search
- Vector embeddings for incidents and logs
- Similar incident detection
- LangChain-powered retrieval workflows
- LangGraph-based investigation agents
- LangSmith observability and tracing
- Retrieval-Augmented Generation (RAG) over incident history
- AI-assisted operational debugging workflows
- Python
- FastAPI
- PostgreSQL
- SQLAlchemy 2.0
- AsyncPG
- Alembic
- Pydantic v2
- PyJWT
- pwdlib
- Pytest
- Uvicorn
- Redis
- LangChain
- LangGraph
- LangSmith
- FAISS / Vector Database
- Embedding Models
app/
├── api/
│ ├── routes/
│ └── dependencies/
├── core/
├── db/
│ ├── models/
│ └── database.py
├── middleware/
├── schemas/
├── services/
├── tests/
└── main.py
alembic/
├── versions/
└── env.py
| Method | Endpoint | Description |
|---|---|---|
| POST | /auth/register |
Register a new user |
| POST | /auth/login |
Authenticate user and return JWT |
| GET | /auth/me |
Get current authenticated user |
| Method | Endpoint | Description |
|---|---|---|
| POST | /incidents/ |
Create incident |
| GET | /incidents/ |
Get all incidents |
| GET | /incidents/{incident_id} |
Get incident by ID |
| PATCH | /incidents/{incident_id} |
Update incident |
| DELETE | /incidents/{incident_id} |
Delete incident |
| Method | Endpoint | Description |
|---|---|---|
| GET | /users/ |
Get all users |
| GET | /users/{user_id} |
Get user by ID |
| PATCH | /users/{user_id}/role |
Update user role |
| Method | Endpoint | Description |
|---|---|---|
| GET | /audit-logs/ |
Get audit logs with filters |
The platform uses Role-Based Access Control (RBAC).
| Role | Permissions |
|---|---|
| VIEWER | Read incidents |
| ANALYST | Read, create, and update incidents |
| ADMIN | Full access including deletion and user management |
| Endpoint | VIEWER | ANALYST | ADMIN |
|---|---|---|---|
GET /incidents |
✅ | ✅ | ✅ |
GET /incidents/{id} |
✅ | ✅ | ✅ |
POST /incidents |
❌ | ✅ | ✅ |
PATCH /incidents/{id} |
❌ | ✅ | ✅ |
DELETE /incidents/{id} |
❌ | ❌ | ✅ |
GET /audit-logs |
❌ | ✅ | ✅ |
GET /users |
❌ | ❌ | ✅ |
GET /users/{id} |
❌ | ❌ | ✅ |
PATCH /users/{id}/role |
❌ | ❌ | ✅ |
Supports:
- Severity filtering
- Status filtering
- Environment filtering
- Service-based filtering
- Tag filtering
- Search queries
- Pagination
- Configurable sorting
GET /incidents?severity=high
GET /incidents?status=open&environment=production
GET /incidents?tag=database
GET /incidents?search=timeout
GET /incidents?limit=10&offset=0
GET /incidents?sort_by=created_at&order=desc
Supports:
- Action filtering
- Entity type filtering
- Entity ID filtering
- User ID filtering
- Pagination
- Chronological sorting
GET /audit-logs?action=INCIDENT_UPDATED
GET /audit-logs?entity_type=USER
GET /audit-logs?entity_id=<entity_uuid>
GET /audit-logs?user_id=<user_uuid>
GET /audit-logs?limit=10&offset=0
- UUID primary keys
- PostgreSQL ENUM types
- PostgreSQL ARRAY columns
- PostgreSQL JSONB support
- Timestamp tracking
- Indexed query fields
- Audit trail tracking
- Foreign key relationships
- Alembic migration management
git clone <repo-url>
cd log-analysis-platformpython -m venv .venvsource .venv/bin/activate.venv\Scripts\activatepip install -r requirements.txtalembic upgrade headuvicorn app.main:app --reloadpytest -vSwagger UI:
http://127.0.0.1:8000/docs
This project is focused on learning and implementing:
- Backend architecture
- REST API design
- Async backend engineering
- Validation and serialization
- Authentication & authorization
- Role-Based Access Control (RBAC)
- Audit logging
- Database integration
- Database migrations
- Query optimization & filtering
- Automated API testing
- Observability concepts
- AI-powered operational workflows
- Retrieval-Augmented Generation (RAG)
- Production-style backend engineering