AI SystemsAugust 2026Status: Complete

FinTech Research Agent

Tool Orchestration, Structured Output and Local LLMs for FinTech Research

At a glance

Problem
FinTech research mixes fast-moving news with established facts from sources of very different quality, and chat answers are hard to check or reuse.
My role
Designed and built the agent, its research tools, schemas and tests.
Key decision
Keep the agent deliberately narrow: research orchestration only, with structured, validated output.
Result
A tested research agent on a local Qwen3:30b model that returns structured findings with the sources and tools it reports using.
Proof
16 unit testsLive end-to-end integration testInstallable Python package
Built with
Model
  • Qwen3:30b
  • Ollama
Agent
  • LangChain
  • Pydantic
Research tools
  • DuckDuckGo
  • Wikipedia API
Quality
  • pytest
  • pytest-cov
Language
  • Python

In Practice

1 of 3

Context

I wanted to learn agentic AI development by building one well-scoped agent around a locally hosted model. Rather than a general-purpose autonomous system, it does a narrow job, FinTech research: gathering and synthesizing information through external tools. That scope made it a practical way to learn how tool orchestration, structured outputs, testing and local inference work together, and a foundation to extend.

How can a deliberately focused AI agent use tools to conduct research rather than simply generate an answer?

Generative AI systems can produce useful answers, but conversational responses alone are difficult to validate, reuse and integrate into downstream workflows. Research tasks also require access to external information sources and the ability to determine when different sources should be used. This project explores how a focused agent can coordinate those capabilities while keeping the system simple enough to evaluate, test and extend.

Approach

A locally hosted Qwen3:30b model, prompted as a FinTech research assistant, interprets the question and chooses between complementary tools: DuckDuckGo for current developments and news, Wikipedia for established concepts and background. The prompt sets source-quality rules (prefer regulatory sources, established financial institutions and primary research; treat marketing content and unsourced claims with caution; separate facts from interpretation), and every answer must be valid JSON matching a Pydantic schema that includes sources, tools used and confidence notes.

Data sources

  • Web and Knowledge Sources

    Research information is retrieved dynamically from DuckDuckGo web search and the Wikipedia API. The agent selects the appropriate source based on the research question and the type of information required.

Solution

Agent and tools

  1. Local research agent. Implemented a local Qwen3:30b research agent using Ollama and LangChain.

  2. Two research tools. Developed complementary DuckDuckGo and Wikipedia research tools.

  3. Tool-selection prompts. Designed prompt instructions that guide tool selection based on information needs and source characteristics.

Structured output

  1. Validated output. Implemented a Pydantic ResearchResponse schema to validate structured agent output.

  2. Source tracking. Added source and tool tracking to make research results auditable and reusable.

Engineering and testing

  1. Modular package. Designed a modular Python package separating agent orchestration, prompts, schemas, tools, services and application execution.

  2. Mocked unit tests. Built unit tests that mock external research calls and validate tool behavior and error handling.

  3. Live integration test. Added a live integration test validating the complete Qwen3, tool-calling and structured-output workflow.

  4. Installable package. Configured the project as an installable Python package using pyproject.toml.

Architecture

The system uses a focused tool-calling architecture in which a locally hosted Qwen3:30b model interprets a research query and determines which research tools to invoke.

DuckDuckGo provides current web-based information while Wikipedia provides established background knowledge. Retrieved information is synthesized into a validated Pydantic ResearchResponse containing findings, entities, sources, tools used and confidence notes.

Architecture: a research question goes to a Qwen3:30b agent that calls DuckDuckGo and Wikipedia, returns a Pydantic-validated ResearchResponse and appends each run to a research log.
Hover to magnify · click to open full sizeTap to open full size

Components

  • Local Qwen3:30b LLM
  • Ollama inference runtime
  • LangChain tool-calling agent
  • DuckDuckGo web search
  • Wikipedia API
  • Pydantic structured output
  • Research persistence
  • Unit and integration testing

Outcome

The agent runs end to end on a local Qwen3:30b model. Asked to research the adoption of AI and machine learning in FinTech startups, it searches, synthesizes and returns a validated ResearchResponse (summary, key findings, entities such as Upstart and Zest AI, source URLs, tools used and confidence notes), and appends each run to a research log. Sixteen unit tests mock the external research calls; a live integration test exercises the full model, tool-calling and structured-output workflow.

Scope and limits

Sources and tools in each response are reported by the model, not verified against what the tools returned, so findings are a starting point for research, not evidence. It has not been evaluated for research accuracy or tool-selection quality.

Lessons Learned

  • A model reporting its own sources is not the same as recorded evidence. Structured output makes answers checkable in shape, not true in substance. This was one of the explorations that shaped the AI Agent Operational Platform, where the system records every tool call and checks responses against them.

  • Narrowly defined agent responsibilities can make agentic systems easier to test, evaluate and extend.

  • Tool descriptions and prompt design strongly influence agent behavior and tool selection.

  • Structured outputs make LLM-generated information more reliable and useful for downstream applications.

  • Unit tests and live integration tests serve different purposes when testing AI systems.

  • Agent outputs should be treated as data when they are intended to support future analytical workflows.

What's next

  • Add additional financial and regulatory research sources.
  • Implement automated source quality and credibility evaluation.
  • Store structured research as JSONL or in a database.
  • Evaluate agent tool-selection accuracy and research quality.
  • Compare local and hosted LLM performance.
  • Introduce retrieval-augmented generation over an accumulated research corpus.
  • Explore semantic search and topic classification across stored research.