A minimal AI engineering project demonstrating how modern LLM applications interact with tools, APIs and external systems.
The goal is not to build an autonomous AI agent, but to demonstrate practical implementation of:
- OpenAI API integration
- Tool Calling
- MCP (Model Context Protocol)
- Structured Outputs
- FastAPI services
- Observability and tracing
- Evaluation and testing
- Cost monitoring
The project focuses on engineering practices commonly used in production AI systems.
Organizations process large volumes of reports, filings and technical documents.
Manual analysis is time-consuming and often repetitive.
This project demonstrates how an LLM-powered service can assist analysts by:
- classifying documents
- generating executive summaries
- extracting key entities
- identifying important topics
- exposing processing steps through traces and metrics
The objective is to create a transparent and observable AI workflow rather than a fully autonomous decision-making system.
Minimal Proof of Understanding.
The project prioritizes architectural clarity and demonstrable AI engineering skills over product completeness.
In scope:
- document ingestion
- OpenAI integration
- MCP-based tool usage
- structured outputs
- tracing and observability
- cost tracking
- automated tests
Out of scope:
- user authentication
- frontend development
- multi-tenancy
- production deployment
- autonomous agent swarms
- custom model training
| Source | URL | Purpose |
|---|---|---|
| SEC EDGAR Filings | https://www.sec.gov/edgar/search/ | Financial reports |
| ECB Publications | https://www.ecb.europa.eu/pub/html/index.en.html | Central bank reports |
| OECD Reports | https://www.oecd.org/publications/ | Policy documents |
| World Bank Documents | https://documents.worldbank.org/ | Long-form reports |
| arXiv Papers | https://arxiv.org/ | Technical documents |
| ID | Requirement |
|---|---|
| FR-1 | Upload document |
| FR-2 | Classify document type |
| FR-3 | Generate executive summary |
| FR-4 | Extract entities |
| FR-5 | Generate risk assessment |
| FR-6 | Generate action items |
| FR-7 | Return structured JSON output |
| FR-8 | Expose tool execution trace |
| FR-9 | Support MCP tool discovery |
| FR-10 | Record token and cost statistics |
| ID | Requirement | Target |
|---|---|---|
| NFR-1 | Response latency | <15 sec |
| NFR-2 | Structured output validity | 100% |
| NFR-3 | Dockerized deployment | Required |
| NFR-4 | Observability | LangSmith traces |
| NFR-5 | Type safety | Pydantic models |
| NFR-6 | Cost visibility | Per-request statistics |
| NFR-7 | Tool reliability | >95% successful calls |
| ID | User Story | ||
|---|---|---|---|
| US-1 | As an analyst, | I want a summary | so that I can understand the document quickly |
| US-2 | As a manager, | I want action items | so that I know what decisions are required |
| US-3 | As an auditor, | I want execution traces | so that I can understand how the result was produced |
| US-4 | As an engineer, | I want tool metrics | so that I can evaluate system performance |
| US-5 | As an AI engineer | I want MCP-based tools | so that I can experiment with modern agent architectures |
| ID | Test Case | Expected Result |
|---|---|---|
| TC-1 | Financial report upload | Classification succeeds |
| TC-2 | Entity extraction | Known entities identified |
| TC-3 | Summary generation | Non-empty summary returned |
| TC-4 | Risk assessment | Risks detected when present |
| TC-5 | JSON validation | Schema passes |
| TC-6 | MCP tool invocation | Tool executes successfully |
| TC-7 | Cost tracking | Token usage recorded |
| TC-8 | Trace generation | LangSmith trace available |
| ID | Deliverable |
|---|---|
| DOD-1 | FastAPI service operational |
| DOD-2 | OpenAI integration completed |
| DOD-3 | MCP client implemented |
| DOD-4 | At least 3 MCP tools implemented |
| DOD-5 | Structured outputs implemented |
| DOD-6 | LangSmith tracing enabled |
| DOD-7 | Docker image created |
| DOD-8 | CI pipeline configured |
| DOD-9 | Cost tracking implemented |
| DOD-10 | README completed |
| Decision | Chosen | Alternative | Reason |
|---|---|---|---|
| LLM | OpenAI GPT-4.1 | Local Llama | Focus on application engineering rather than GPU optimization |
| Vector DB | Qdrant | Pinecone | Open source and reproducible, easy local setup, sufficient for portfolio purposes |
| Framework | FastAPI | Flask | Strong typing and OpenAPI support |
| Data Engine | Polars | Pandas | Better scalability |
- OpenAI API
- Structured Outputs
- Tool Calling
- MCP Client
- Tool Discovery
- Custom MCP Server
- FastAPI Integration
- FastAPI
- Pydantic
- SQLAlchemy
- LangSmith
- Request Tracing
- Cost Tracking
- Docker
- GitHub Actions
- Unit Tests
- Integration Tests
- Prompt Injection Protection
- Input Validation
- Rate Limiting
- LangGraph
- Tool calling
- State management
- Multi-step workflow
- OpenAI
- Structured outputs
- Prompt templates
- FastAPI
- Pydantic
- LangSmith
- Golden dataset
- Input sanitization
- Prompt injection checks
- Token accounting
- Cost reporting