Phi-4 in DOIN: Technical Architecture for Open-Source Reasoning at the Edge
A technical architecture document mapping Microsoft's Phi-4 small language model family into the Digital Opportunities Intelligence Network (DOIN), covering GraphRAG reasoning, multi-agent orchestration, edge deployment, multimodal accessibility, and education.
Introduction
The Digital Opportunities Intelligence Network (DOIN) is a next-generation decision support system designed to transform how we understand and solve the digital divide. It moves beyond static maps and spreadsheets to create a dynamic, predictive intelligence engine for digital opportunity, grounded in the six-dimension Digital Opportunities Compass framework developed by Dagg, Rhinesmith, Bauer, Byrum, and Schill (2023).
DOINβs intelligence layer requires a language model capable of evidence-grounded reasoning, causal inference, and natural language synthesis β one that can operate across a distributed infrastructure spanning community edge devices, regional campuses, and cloud batch processing. Microsoftβs Phi-4 family of small language models meets these requirements with open weights, MIT licensing, and a deployment profile engineered for the full latency-versus-accuracy spectrum.
This document specifies where Phi-4 sits within the DOIN architecture, how each variant maps to a deployment tier, and what capabilities each integration enables for policymakers, Digital Navigators, educators, and community members across the Eastern Upper Peninsula and beyond.
1. DOIN Architecture Overview
DOIN operates as a three-layer system, each layer building on the one beneath it.
1.1 Layer 1 β The Compass (The Map)
The Digital Opportunities Compass provides the measurement framework organized across six domains: Contexts, Governance, Connectivity, Skills, Applications, and Outcomes. These dimensions map to the theoretical pipeline from Opportunity (Senβs capabilities) through Aspiration (Appaduraiβs navigation) to Growth Mindset (Dweckβs learning) to Equity.
Phi-4βs role in this layer: None directly. The Compass is a measurement and organizational framework. Phi-4 consumes Compass-structured data; it does not define it.
1.2 Layer 2 β The Network (The Structure)
The Knowledge Graph ingests and links census demographics, infrastructure maps, federal policy documents, stakeholder feedback, and research findings into a web of relationships using Neo4j, RDF/OWL, and SHACL schemas. The embedding layer (Harrier-oss-v1) converts unstructured text into vector representations stored in FAISS for semantic retrieval.
Phi-4βs role in this layer: Phi-4-mini (3.8B) serves as a data integration assistant, parsing incoming documents, extracting entities, and suggesting Knowledge Graph node/edge mappings during the ontologist workflow. Its 128K context window accommodates full policy documents without chunking, and its function-calling capability enables direct interaction with Neo4j via MCP tool servers.
1.3 Layer 3 β The Intelligence (The Engine)
The Intelligence layer combines Bayesian Networks (causal prediction) with GraphRAG (evidence-grounded AI Q&A). It operationalizes the Policy Learning Approach using Gini coefficients to measure inequality gaps, Hajek estimators to correct for data biases, and Bayesian inference to model cause-and-effect. It allows policymakers to ask βWhat if?β questions with traceable, citation-backed reasoning.
Phi-4βs role in this layer: Primary. Phi-4 is the reasoning and synthesis engine that completes the GraphRAG pipeline:
Question
β
Harrier retrieves from Knowledge Graph (embedding layer)
β
Bayesian Network provides predictions (causal layer)
β
Phi-4 synthesizes evidence-grounded answer (reasoning layer)
β
Citable, traceable, actionable response
2. Phi-4 Family Variant Mapping
The Phi-4 family includes three primary variants, each optimized for a different point on the latency-versus-accuracy spectrum. DOIN deploys all three.
2.1 Phi-4-mini (3.8B Parameters)
| Attribute | Specification |
|---|---|
| Parameters | 3.8 billion |
| Context Window | 128,000 tokens |
| VRAM Requirement | ~3 GB (quantized) |
| Key Strengths | Reasoning, function calling, long-context tasks |
| Deployment Target | Micro Edge AI Pods, community kiosks, school laptops |
| License | MIT |
DOIN Functions:
- DataAgent brain in the MultiAgentGraphRAG architecture
- Knowledge Graph data integration assistant (entity extraction, relationship suggestion)
- Community-facing Q&A at Digital Navigator kiosks and library access points
- Student-facing interactive AI for Tech Changemakers and AI Connect curriculum
- Function calling into Neo4j, FAISS, and external data APIs via MCP tool servers
Why 128K context matters for DOIN: A single Phi-4-mini instance can hold an entire countyβs Compass assessment, the full BEAD state plan excerpt, and the userβs question in a single prompt β enabling coherent, cross-referential reasoning without retrieval fragmentation.
2.2 Phi-4 (14B Parameters)
| Attribute | Specification |
|---|---|
| Parameters | 14 billion |
| Context Window | 16,000 tokens |
| VRAM Requirement | ~10 GB (quantized) |
| Key Strengths | MMLU 84.8%, MATH 80.4%, HumanEval 82.6% |
| Deployment Target | Campus/regional edge servers, CTTC data center |
| License | MIT |
DOIN Functions:
- Primary GraphRAG synthesis engine for policy Q&A
- TheoryAgent, EvidenceAgent, and SynthesisAgent brain in MultiAgentGraphRAG
- Bayesian inference chain reasoning (βWhat if we invest $X in digital literacy here?β)
- Report generation (Compass dimension analyses, intervention recommendations)
- Complex multi-step reasoning across Compass dimensions
Why 14B at the campus edge matters for DOIN: The 14B variant delivers reasoning quality competitive with models four to ten times its size on mathematical and logical tasks. DOINβs Bayesian reasoning layer requires a model that can handle Gini coefficients, Hajek estimators, and conditional probability chains without hallucinating the mathematics. Phi-4βs training emphasis on synthetic textbook-style data and mathematical reasoning makes it uniquely suited to this requirement.
2.3 Phi-4-multimodal (5.6B Parameters)
| Attribute | Specification |
|---|---|
| Parameters | 5.6 billion |
| Modalities | Speech + Vision + Text (unified architecture) |
| Architecture | Mixture-of-LoRAs across modalities |
| Speech Languages | English, French, Spanish, Japanese |
| Deployment Target | Digital Navigator kiosks, smart building edge, field inspection |
| License | MIT |
DOIN Functions:
- Voice-first community interface for Digital Navigators and accessibility
- Speech-to-text transcription for EUPConnect Steering Committee meetings
- Vision-based document processing (policy PDFs, handwritten community feedback)
- Smart building visual analytics (occupancy detection, energy dashboard interpretation)
- Cross-border French-English speech input for Canadian partnerships
- Assistive technology for individuals with disabilities (28.7% of EUP population)
Why multimodal matters for DOIN: Digital equity is fundamentally about access. A text-only AI interface excludes residents with limited literacy, visual impairments, or discomfort with keyboards. Phi-4-multimodal enables a resident to walk up to a kiosk, speak a question about broadband programs, and receive a reasoned, evidence-grounded answer. This is the DOIN vision made tangible β intelligence that meets people where they are.
3. Multi-Agent GraphRAG Architecture
DOINβs advanced policy questions require coordinated reasoning across multiple knowledge domains. The MultiAgentGraphRAG architecture deploys specialized agents, each powered by a Phi-4 variant matched to its computational requirements.
3.1 Agent Topology
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β SynthesisAgent β
β (Phi-4 14B) β
β Combines all inputs into final answer β
ββββββββββββββ¬βββββββββββ¬βββββββββββ¬ββββββββββββββββββββββββ
β β β
ββββββββββΌβββ ββββββΌββββββ ββΌββββββββββββββββ
βTheoryAgentβ βEvidence β βPredictionAgent β
β(Phi-4 14B)β βAgent β β(Phi-4 14B) β
β β β(Phi-4 14Bβ β β
βRetrieves β βRetrieves β βRuns Bayesian β
βSen, β βHampton & β βpredictions β
βAppadurai, β βBauer, β β β
βDweck, β βresearch β βP(Equity | β
βToyama β βfindings β β Opportunity, β
βββββββββββββ ββββββββββββ β Aspiration, β
β Mindset) β
ββββββββββ΄βββββββββ
β DataAgent β
β (Phi-4-mini β
β 3.8B) β
β β
βRetrieves county β
βdata, runs β
βlookups via MCP β
βtools β
βββββββββββββββββββ
3.2 Agent Specifications
TheoryAgent β Retrieves and interprets relevant theoretical frameworks from the Knowledge Graph. When a policymaker asks about digital literacy investment, TheoryAgent identifies that Senβs capabilities approach (Opportunity), Appaduraiβs capacity to aspire (Aspiration), and Dweckβs growth mindset (mechanism) all apply, and provides the theoretical grounding for the recommendation.
- Model: Phi-4 (14B)
- Retrieval source: Harrier-embedded theory corpus
- Output: Theoretical framework analysis with citations
EvidenceAgent β Retrieves empirical research findings, particularly the Hampton and Bauer (2020) Michigan data and the Dagg et al. (2023) Compass metrics. Provides the evidence base that validates or challenges theoretical predictions.
- Model: Phi-4 (14B)
- Retrieval source: Harrier-embedded research corpus
- Output: Evidence summary with DOIs and source attribution
DataAgent β Retrieves county-level and state-level data from the Knowledge Graph via function calls. Handles structured queries against Neo4j (SPARQL/Cypher), census APIs, and broadband availability databases.
- Model: Phi-4-mini (3.8B)
- Tools: Neo4j MCP server, Census API MCP server, FAISS vector store
- Output: Structured data tables, Compass dimension scores
PredictionAgent β Runs Bayesian inference chains using the causal model. Given observed Compass scores and a proposed intervention, predicts the probability distribution of outcomes.
- Model: Phi-4 (14B) or Phi-4-reasoning
- Tools: pgmpy/bnlearn Bayesian network via MCP server
- Output: Conditional probability estimates, confidence intervals
SynthesisAgent β Combines outputs from all four agents into a coherent, citable, actionable policy recommendation. Ensures every claim is traceable to a theory, evidence source, data point, or prediction.
- Model: Phi-4 (14B)
- Input: Concatenated agent outputs
- Output: Natural language recommendation with full citation chain
3.3 Example Query Flow
User Question: βShould we prioritize infrastructure or Digital Navigators in Mackinac County?β
- DataAgent (Phi-4-mini) retrieves Mackinac County Compass scores: low Connectivity (infrastructure gap), moderate Skills, low Applications.
- TheoryAgent (Phi-4) identifies Toyamaβs amplification principle: technology amplifies existing human intent and capacity. Without capacity (Skills), infrastructure alone underperforms.
- EvidenceAgent (Phi-4) retrieves Hampton and Bauer (2020): infrastructure is necessary but not sufficient; digital navigation increases adoption among underserved populations.
-
PredictionAgent (Phi-4) runs Bayesian inference: P(Adoption Infrastructure + Navigator) = 0.73 vs. P(Adoption Infrastructure only) = 0.41. - SynthesisAgent (Phi-4) produces: βInfrastructure first to close the Connectivity gap (Opportunity stage), with concurrent Digital Navigator deployment to build Skills and Applications (Aspiration + Mindset stages). The Bayesian model predicts 73% adoption with both interventions vs. 41% with infrastructure alone. This aligns with Toyamaβs amplification principle and Hampton & Bauerβs Michigan findings.β
4. Edge Deployment Architecture
DOINβs distributed deployment maps directly to the NOVA multi-tier edge AI infrastructure, with Phi-4 variants matched to each tier alongside their Harrier embedding counterparts.
4.1 Deployment Tiers
| Tier | Infrastructure | Phi-4 Variant | Harrier Variant | Power | Use Case |
|---|---|---|---|---|---|
| Micro Edge AI Pod | Containerized compute at school IDFs, library kiosks, CTTC walk-in closets | Phi-4-mini (3.8B) | harrier-270M | 100β200 kW shared | Community Q&A, navigator tools, student AI |
| Campus Edge | Regional data center at CTTC, school campus MDF | Phi-4 (14B) + Phi-4-multimodal (5.6B) | harrier-0.6B | ~1 MW | GraphRAG policy Q&A, smart building analytics, meeting transcription |
| Cloud/Batch | Snowflake, Azure, or partner cloud | Phi-4-reasoning-plus (14B) | harrier-27B | Cloud-managed | Full corpus re-indexing, statewide policy analysis, deep Bayesian modeling |
4.2 Infrastructure Integration
DOINβs physical infrastructure leverages the Passive Optical LAN (POLAN) and Fault-Managed Power Systems (FMPS) architecture documented in the EUPConnect infrastructure planning. This architecture creates a centralized power node where all building systems draw power and data from a single distribution point β an ideal topology for edge AI deployment.
POLAN + Phi-4 integration:
- Fiber backbone provides the low-latency, high-bandwidth connectivity required for model serving
- Centralized power nodes concentrate GPU/compute at the MDF, reducing distributed power complexity
- Class 4 power systems (NEC Article 725, UL 62368-1) enable low-voltage DC distribution to edge inference devices without conduit requirements
- NOVA high-density fiber panels support the east-west DCI traffic patterns emerging from distributed AI inference
Container runtime:
# docker-compose.yml β Campus Edge Deployment
version: '3.8'
services:
phi4-inference:
image: vllm/vllm-openai:latest
command: >
--model microsoft/phi-4
--tensor-parallel-size 1
--max-model-len 16384
--gpu-memory-utilization 0.9
ports:
- "8000:8000"
deploy:
resources:
reservations:
devices:
- capabilities: [gpu]
phi4-mini-agents:
image: vllm/vllm-openai:latest
command: >
--model microsoft/phi-4-mini
--max-model-len 131072
--gpu-memory-utilization 0.85
ports:
- "8001:8000"
deploy:
resources:
reservations:
devices:
- capabilities: [gpu]
phi4-multimodal:
image: vllm/vllm-openai:latest
command: >
--model microsoft/phi-4-multimodal
--trust-remote-code
ports:
- "8002:8000"
deploy:
resources:
reservations:
devices:
- capabilities: [gpu]
harrier-embeddings:
image: sentence-transformers/serving:latest
environment:
- MODEL_NAME=microsoft/harrier-oss-v1-0.6b
ports:
- "8003:8080"
neo4j:
image: neo4j:5-community
ports:
- "7474:7474"
- "7687:7687"
volumes:
- neo4j_data:/data
faiss-server:
image: faiss-server:latest
volumes:
- faiss_index:/index
ports:
- "8004:8080"
mcp-gateway:
image: docker/mcp-gateway:latest
environment:
- MCP_TOOLS=neo4j,faiss,census-api,bayesian
ports:
- "8005:8080"
volumes:
neo4j_data:
faiss_index:
4.3 MCP Tool Server Architecture
Model Context Protocol (MCP) provides the standardized interface between Phi-4 agents and external tools. Following Dockerβs secure-by-default recommendations, each MCP server runs in an isolated container with secret management restricting credential access to authorized containers only.
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Phi-4 Agent Layer β
β TheoryAgent Β· EvidenceAgent Β· DataAgent β
β PredictionAgent Β· SynthesisAgent β
ββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββ€
β β MCP Gateway β
β β (Authentication, Logging, Policy) β
ββββββββββ¬ββββββββββββΌββββββββββββ¬βββββββββββββββββββββββββ€
β Neo4j β FAISS β Census β Bayesian β
β MCP β MCP β API MCP β MCP β
β Server β Server β Server β Server β
β β β β (pgmpy/bnlearn) β
ββββββββββ΄ββββββββββββ΄ββββββββββββ΄βββββββββββββββββββββββββ
Tool budget management: Each Phi-4 agent is configured with a maximum of four to six MCP tools to avoid overloading the context window. The DataAgent, which requires the most tool diversity, uses Phi-4-miniβs 128K context to accommodate tool descriptions alongside data retrieval results.
5. Multimodal Accessibility Layer
5.1 Digital Navigator Voice Interface
The EUPCC Digital Equity Hub deploys Digital Navigators across Chippewa, Luce, and Mackinac counties to help underserved populations β including elders and seniors (PP1), Native Americans (PP2), individuals with disabilities (PP3), and veterans (PP4) β navigate digital resources.
Phi-4-multimodal transforms this interaction from text-dependent to voice-first:
Resident speaks question (English or French)
β
Phi-4-multimodal transcribes speech to text (on-device)
β
Harrier-0.6B embeds question for Knowledge Graph retrieval
β
Phi-4 (14B) synthesizes evidence-grounded answer
β
Response displayed on screen + spoken via TTS
Privacy architecture: All speech processing occurs on-device or at the campus edge. No audio data leaves the local network. This is critical for Tribal data sovereignty and for building trust with populations historically excluded from digital systems.
5.2 Smart Building Integration
The POLAN + FMPS distributed edge architecture in DOIN-connected facilities (schools, CTTC, community centers) generates continuous sensor data. Phi-4-multimodal processes visual feeds for:
- Occupancy analytics: Camera-based occupancy detection for HVAC optimization, reducing energy costs at the centralized power node
- Maintenance prediction: Visual inspection of infrastructure components, with Phi-4-multimodal identifying wear patterns and suggesting maintenance schedules
- Safety monitoring: Integration with InformaCast and AtlasIED mass notification systems for automated visual threat assessment
6. Education and Workforce Development
6.1 AI Literacy Curriculum Integration
The βFirst Five Things to Teach a Computerβ framework from AI Connect provides the pedagogical structure. Phi-4-mini serves as the student-facing AI that makes each lesson tangible:
| Lesson | Phi-4-mini Application |
|---|---|
| Teach it to communicate | Students prompt Phi-4-mini with natural language, observe how instruction clarity affects output quality |
| Teach it to play music | Students use function calling to connect Phi-4-mini to audio generation tools |
| Teach it to draw pictures | Students instruct Phi-4-mini to generate image prompts, exploring how language shapes visual output |
| Teach it to do math | Students test Phi-4-miniβs mathematical reasoning (MATH 80.4%), comparing AI and human problem-solving |
| Teach it to play games | Students build simple game agents, learning about decision trees and reward functions |
Deployment for education: Phi-4-mini runs on school laptops via Foundry Local (CPU-only mode, ~3 GB RAM). No cloud dependency, no per-student API costs, no student data leaving the building. Open weights enable students to inspect the model architecture β aligned with the βlearning in publicβ philosophy.
6.2 BICSI and CTE Workforce Training
The Cloverland Technology and Training Center (CTTC) workforce pipeline trains technicians in fiber construction, network operations, and converged IT/OT systems. Phi-4 enhances this training through:
- Interactive technical Q\&A: Trainees query Phi-4 about NEC Article 725, UL 62368-1, POLAN design principles, and FMP specifications β receiving technically accurate, contextually grounded answers from the DOIN Knowledge Graph
- Scenario-based learning: Phi-4βs reasoning capability generates βWhat if?β scenarios for network design decisions, helping trainees understand the cascading effects of architectural choices
- Code generation: Phi-4βs HumanEval 82.6% performance supports trainees learning Python for network automation, configuration scripting, and data analysis
7. Policy Learning Machine Integration
DOINβs Policy Learning Machine operates in continuous cycles: Observe, Interpret, Model, Recommend, Measure, Update. Phi-4 powers each stage with a different reasoning mode:
| Cycle Stage | Phi-4 Function | Variant |
|---|---|---|
| Observe | Parse incoming data signals, extract entities, flag anomalies | Phi-4-mini (3.8B) |
| Interpret | Classify observations by Compass dimension, identify theoretical relevance | Phi-4 (14B) |
| Model | Generate Bayesian network structure hypotheses, validate causal assumptions | Phi-4 (14B) |
| Recommend | Synthesize multi-agent analysis into actionable policy recommendations | Phi-4 (14B) |
| Measure | Compare predicted outcomes to observed outcomes, quantify model accuracy | Phi-4-mini (3.8B) |
| Update | Generate model revision proposals, explain reasoning for parameter adjustments | Phi-4 (14B) |
This cycle transforms DOIN from a static analytical tool into a continuously learning system β one that improves its predictions as new data flows in from Digital Navigator interactions, census updates, infrastructure deployment reports, and community feedback.
8. Licensing and Consortium Deployment
All Phi-4 variants are released under the MIT license, enabling unrestricted use across the EUPConnect consortium:
- Five Nations Advisors β Commercial advisory use without licensing restrictions
- Bay Mills Community College β Educational deployment with student access to open weights
- Lake Superior State University (CFRE) β Research applications with full model inspection
- Sault Area Public Schools β Student-facing AI on school devices without per-seat costs
- Cloverland Electric / CTTC β Workforce training with technical Q\&A capabilities
- Tribal partners β On-premises deployment ensuring data sovereignty with no cloud dependencies
9. Technology Stack Summary
| Layer | Component | Technology |
|---|---|---|
| Reasoning | Phi-4 (14B) | PyTorch, Transformers, Flash Attention, vLLM |
| Edge Reasoning | Phi-4-mini (3.8B) | Foundry Local, vLLM, ONNX Runtime |
| Multimodal | Phi-4-multimodal (5.6B) | PyTorch, Mixture-of-LoRAs, vLLM |
| Embeddings | Harrier-oss-v1 (0.6B default) | Sentence Transformers, PyTorch |
| Vector Store | FAISS | faiss-gpu / faiss-cpu |
| Knowledge Graph | Neo4j Community Edition | Cypher, RDF/OWL, SHACL |
| Agent Protocol | Model Context Protocol (MCP) | Docker MCP Gateway |
| Containers | Docker Compose | Docker Engine, GPU passthrough |
| Causal Model | Bayesian Networks | pgmpy, bnlearn |
| Network | POLAN + FMPS | Tellabs, Cisco Meraki, Clearfield NOVA |
10. Conclusion
Phi-4 completes the DOIN intelligence stack. Where Harrier-oss-v1 provides the semantic retrieval layer β finding the right evidence across 94 languages and three deployment scales β Phi-4 provides the reasoning layer that transforms retrieved evidence into actionable intelligence.
The Phi-4 familyβs three-variant architecture mirrors DOINβs distributed deployment model: Phi-4-mini at the community edge for real-time interaction, Phi-4 at the campus for deep policy reasoning, and Phi-4-multimodal bridging the accessibility gap for populations that text-only interfaces cannot serve. All variants share MIT licensing, PyTorch compatibility, and the mathematical reasoning strength that DOINβs Bayesian inference chains demand.
Together, Harrier and Phi-4 represent a complete open-source AI stack for evidence-based policymaking β one that can be deployed, inspected, and governed by the communities it serves. This is not AI as a service. This is AI as infrastructure.
Part of: Project Compass (Merit Network) β Digital Opportunities Intelligence Network (DOIN)
Working draft π¬ Learning in Public β This site is my digital laboratory β a space for curiosity, experimentation, and evolving ideas.
Β© 2026 Jason Kronemeyer. All rights reserved.
Sources Referenced
This document draws from your existing DOIN framework documentation including TrainingCompassOverview.html , TrainingCompassGraphRAG.html, the PL.html Compass framework connection , your training-the-compass-digital-opportunities-intelligence-framework.html , the MCP Servers_Docker_and_AI Agent Integration.docx technical report, Docker-State-of-Agentic-AI-white-paper.pdf , the daf62f4a-7f5d-45b1-bcf9-e12e632cc881.pdf NOVA edge AI infrastructure presentation, the EUP MITTEN Narrative v3.docx program narrative, your ai-connect-curiosity.html education framework, and the finding_digital_divide.html Bayesian Networks article.