Documentation Index
Fetch the complete documentation index at: https://agent-contracts.relari.ai/llms.txt
Use this file to discover all available pages before exploring further.
Agent Implementation
The finance research agent was implemented using LangGraph with the following multi-agent architecture. Try for yourself.
Contract Specification
We can now define the scenarios and corresponding contract in aSpecification.
define.py
specification.json.
Running the Agent
Start the verification server from theagent-contracts directory (make sure youβve downloaded and installed agent-contracts repo installation). The verification server includes the telemetry collector necessary to receive the traces from the agent instrumented with relari-otel.
specification.json). Make sure youβve installed the langgraph-fin-agent README.
http://localhost:16686. Or you can fetch the traces via the Agent Contracts CLI.
$ poetry run cli ls run βtimespan 1h
Listing runs from 2025-03-11 04:27:05.937162+00:00 to 2025-03-11 05:27:05.937158+00:00β¦
ββββββββββββ³ββββββββββββββββββββββ³ββββββββββββββββββββ³ββββββββββββββββββββββ³ββββββββββββββββββββββ
β Run ID β Project Name β Specifications ID β Start Time β End Time β
β‘βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ©
β 187a8d09 β langgraph-fin-agent β yw936jmp β 2025-03-10 21:56:20 β 2025-03-10 21:56:20 β
ββββββββββββ΄ββββββββββββββββββββββ΄ββββββββββββββββββββ΄ββββββββββββββββββββββ΄ββββββββββββββββββββββ
Verification Results
The following is the verification results post-execution. We can see that thecon-comparison and con-analysis contracts are satisfied while the con-liquidity-analysis contract is not.
$ poetry run cli verify run 187a8d09 /Users/yisz/code/Relari/agent-examples/apps/langgraph-fin-agent/specifications.json βtimespan 1d
Verifying run 187a8d09 with specifications from agent-examples/apps/langgraph-fin-agent/specifications.jsonβ¦
Output will be saved to output/verify_187a8d09.json
Contract Right Tickers: 100%|ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ| 3/3 [00:06 < 00:00, 2.06s/it]
Contract Right Tickers: 100%|ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ| 4/4 [00:08 < 00:00, 2.22s/it]
Contract Right Tickers: 100%|ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ| 4/4 [00:10 < 00:00, 2.64s/it]
βββββββββββββββββββββββββββββββββββββββ Trace 6f644c2e191daa723fcd7effac3de3e0 ββββββββββββββββββββββββββββββββββββββββ
Right Tickers (UNSATISFIED)
ββββββββ³ββββββββββββ³ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ³ββββββββββββ
β Type β Qualifier β Requirement β Satisfied β
β‘βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ©
β PRE β MUST β Question about the debt-to-equity ratio β Yes β
β PATH β MUST β Retrieve the financials of at least 3 car manufacturers β No β
β POST β MUST β Output a table β No β
β POST β SHOULD β Include at least Tesla, Ford, and General Motors β No β
ββββββββ΄ββββββββββββ΄ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ΄ββββββββββββ
βββββββββββββββββββββββββββββββββββββββ Trace 0cbce717cb265f18e45f6047c3f6060d ββββββββββββββββββββββββββββββββββββββββ
Right Tickers (SATISFIED)
ββββββββ³ββββββββββββ³ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ³ββββββββββββ
β Type β Qualifier β Requirement β Satisfied β
β‘βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ©
β PRE β MUST β Comparison between Nike and Adidas β Yes β
β PATH β MUST β Retrieve Nike financials with the ticker NKE β Yes β
β PATH β MUST β Retrieve Adidas financials with the ticker ADDYY β Yes β
β POST β SHOULD β A numeric value for operating margins expressed in percentage β Yes β
ββββββββ΄ββββββββββββ΄ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ΄ββββββββββββ
βββββββββββββββββββββββββββββββββββββββ Trace 7d01b56e279cc75e44a3b2e57890b9bd ββββββββββββββββββββββββββββββββββββββββ
Right Tickers (SATISFIED)
ββββββββ³ββββββββββββ³ββββββββββββββββββββββββββββββββββββββββββββββββββββββ³ββββββββββββ
β Type β Qualifier β Requirement β Satisfied β
β‘βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ©
β PRE β MUST β Question about Teslaβs net income β Yes β
β PATH β MUST β Retrieve Teslaβs net income with the ticker TSLA β Yes β
β POST β SHOULD β A numeric value for net income expressed in dollars β No β
ββββββββ΄ββββββββββββ΄ββββββββββββββββββββββββββββββββββββββββββββββββββββββ΄ββββββββββββ
You can further inspect the detailed verification results with reasoning in the output/verify_187a8d09.json file.