Public-safe reconstruction · Bounded agentic workflow
Ask Evidence
An AI analysis workspace where questions are answered through bounded tool use, traceable evidence retrieval, and visible review surfaces.
Project purpose
Fast analytical answers with visible evidence boundaries.
Ask Evidence explores how an AI assistant can answer follow-up analytical questions with evidence, caveats, and tool activity in view.
Why the product problem mattered
Reports and dashboards often contain enough evidence for deeper follow-up. Users still need quick explanations, caveats, and source references after the main analysis is delivered.
How the prototype responded
The workflow gives the model a fixed set of project tools. It can choose and repeat tool calls. The tools control which evidence, sections, variables, and implementation details can enter each answer.
Bounded agentic workflow
The agent selects a route through permitted tools, returned evidence, and review surfaces.
flowchart TD Q["Question intake
user question + selected project context"] --> S["Scope guard
project · region · required fields · output limits"] S --> A["Agent orchestration loop
interpret question · choose next tool · track tool turns"] A --> T["Callable tool registry
18 bounded project tools exposed to the model"] T --> R{"Select tool call type"} R --> D["Call structured-evidence tool
query prepared tables, rankings, trends, wages, and occupation references"] R --> M["Call document-section tool
pull relevant memo or methodology sections by heading"] R --> C["Call implementation-lookup tool
inspect script symbols, formulas, constants, and scoring logic"] D --> P["Tool result returns to agent
evidence packet · source context · caveats · errors"] M --> P C --> P P --> E{"Enough evidence?"} E -->|"Need another tool call"| A E -->|"Ready to answer"| G["Grounded answer
synthesize only from returned evidence"] G --> V["Reviewable output
answer · tool calls · arguments · sources · caveats"] classDef defaultNode fill:#ffffff,stroke:#d8d8d8,color:#070707,rx:12,ry:12; classDef agent fill:#ffffff,stroke:#d8d8d8,color:#070707,rx:12,ry:12; classDef evidence fill:#ffffff,stroke:#d8d8d8,color:#070707,rx:12,ry:12; classDef review fill:#ffffff,stroke:#d8d8d8,color:#070707,rx:12,ry:12; classDef decision fill:#faf9f7,stroke:#cfcfcf,color:#070707; class Q,S,T,P defaultNode; class A,G agent; class D,M,C evidence; class V review; class R,E decision;
Read top to bottom. Retrieval branches return bounded evidence to the agent; incomplete results loop back for another tool call.
Right-sized retrieval
Retrieval was designed for a smaller, structured evidence base.
Ask Evidence uses a RAG-informed retrieval-before-generation pattern for a compact, curated evidence base. The retrieval layer combines structured lookups, heading-based section retrieval, and source-code search.
Retrieve before generating.
Answers are generated after project evidence is selected through scoped tools rather than from model recall alone.
Query prepared evidence directly.
CSV and XLSX evidence is filtered by explicit regions, occupations, industries, measures, and time periods.
Use document structure instead of embeddings.
Project memos and methodology documents are split at Markdown headings and retrieved through predictable title matching.
Inspect implementation truth when needed.
Symbol and text search can retrieve exact functions, formulas, constants, and branch logic when documentation is too broad.
Bounded autonomy by design
The agent chooses the route inside a fixed evidence boundary.
The agent chooses tools inside controlled evidence access.
The model decides which permitted tools to call, while those tools control the evidence that can be returned.
Missing context triggers a concrete clarification.
Missing regions, wage bases, time windows, or ambiguous fields trigger one concrete clarification instead of plausible completion.
The original data grain stays intact.
System instructions define valid regions, time anchors, wage bases, source limitations, and prohibited calculations.
Execution remains inspectable.
Tool names, arguments, returned results, sources, caveats, and errors remain available for review.
Under the hood
The architecture separates agent reasoning from evidence access and review.
A DeepSeek model operates inside a LangChain tool-calling loop. FastAPI exposes the agent and workspace services, while React keeps the answer, selected evidence, and execution trace visible to the reviewer.
React conversation, guided prompts, and a synchronized evidence workspace.
DeepSeek interprets questions and synthesizes answers from retrieved evidence.
LangChain binds tools and manages an iterative execution loop capped at 12 tool turns.
A dynamic project registry exposes 18 bounded analytical operations.
Structured datasets, project memos, methodology documents, and implementation source.
Scope rules, parameter constraints, refusal behaviour, and finite execution limits.
Tool calls, arguments, results, sources, caveats, and errors remain inspectable.
Product surface
One workspace connects user intent, agent output, and supporting evidence.
Public-safe reconstruction · Example responses vary by question, selected tools, and returned evidence.
Guided prompts establish analytical intent and reduce missing context while keeping the underlying data structure out of the user's way.
Public-safe reconstruction · Example responses vary by question, selected tools, and returned evidence.
Agent-generated answers remain connected to tool calls, source sections, structured rows, variables, and visible caveats.
Methods and tools
Methods combined agent orchestration, bounded retrieval, and analytical review UX.
The page uses anonymized, portfolio-safe content to demonstrate the product approach while protecting client-specific analytical material.