Documentation

Integrating Civagent with OpenGov

OpenGov provides budgeting, financial management, and transparency solutions to over 2,000 state and local governments. This guide covers deploying Civagent’s JavaScript embed on OpenGov-hosted transparency portals and citizen-facing dashboards to provide residents with conversational access to budget data, financial reports, and civic information.


Overview

OpenGov provides the budgeting platform, financial reporting tools, and public transparency portals. Civagent adds a conversational layer—a chat widget that answers resident questions about budgets, spending, revenue, and other published financial data.

The integration requires adding a script to your OpenGov transparency portal. No backend changes or data migration required.


Embedding the Chat Widget

Script Installation

Add this script to your OpenGov transparency portal or embedded dashboard:

<script
  src="https://civagent.com/agentic-embed.js"
  data-agent-id="your-jurisdiction-agent-id"
  data-ws-url="wss://your-agent-endpoint"
  data-theme="light"
  data-button-label="Ask About the Budget"
></script>

The widget appears as a floating button in the corner of the page. Clicking it opens the chat interface.

Configuration Parameters

Parameter Required Description
data-agent-id Yes Jurisdiction-specific agent identifier
data-ws-url Yes WebSocket endpoint for agent communication
data-theme No light or dark to match your portal theme
data-button-label No Custom button text (default: “Chat”)
data-greeting No Initial message shown when chat opens
data-auto-open No Set true to open chat automatically on page load

OpenGov Transparency Portal Installation

OpenGov transparency portals support custom scripts in several locations:

Portal Settings

  1. Log into your OpenGov admin as a Portal Administrator
  2. Navigate to Settings > Portal Configuration or Customization
  3. Locate the Custom Scripts or Footer HTML section
  4. Paste the embed script
  5. Save and publish changes

Embedded Portals

If your OpenGov portal is embedded within your main municipal website:

  1. Add the embed script to your host site’s footer or page template
  2. The widget loads on pages containing the OpenGov iframe
  3. Configure the agent to access both your main site content and OpenGov data

Custom Landing Pages

For jurisdictions with custom OpenGov landing pages:

  1. Access the page builder or HTML editor
  2. Add the script to the page’s custom code section
  3. Publish the page

Verification

After adding the script:

  • Clear your browser cache and reload the portal
  • Confirm the chat button appears in the expected position
  • Test the widget opens and responds to budget-related queries
  • Verify appearance on mobile devices

Knowledge Base

Civagent answers questions using content you provide. The knowledge base supports multiple content types:

Document Upload

Upload PDFs, Word documents, and text files containing financial and policy information:

  • Adopted budgets and budget summaries
  • Comprehensive Annual Financial Reports (CAFRs)
  • Capital improvement plans
  • Revenue projections and assumptions
  • Department budget narratives
  • Audit reports
  • Bond documents and debt schedules

Documents are processed, chunked, and stored as vector embeddings. When a resident asks a question, the agent retrieves relevant passages and synthesizes an answer.

Website Content Ingestion

Point Civagent at your municipal site URLs to supplement financial data with general information:

  • Department pages and organizational charts
  • Service descriptions
  • Contact information
  • Meeting schedules and agendas
  • Strategic plans

The agent crawls specified pages and indexes the content. Updates sync on a configurable schedule.

Structured Data

Import structured information as JSON or CSV:

  • Line-item budget data
  • Historical spending by department
  • Revenue by source
  • Fund balances
  • Performance metrics

Structured data enables precise answers: “How much did Parks spend last year?” returns the exact figure rather than a general reference.

Content Management

  • Add, update, or remove documents through the Civagent dashboard
  • Set refresh schedules for web content
  • Review which sources the agent cites in responses
  • Flag incorrect answers for knowledge base refinement

OpenGov Data Integration

Civagent connects directly to OpenGov’s data layer for real-time queries against your published financial information.

Budget Data Access

Configure read access to your OpenGov budget datasets:

  • Operating budgets by fund, department, and account
  • Multi-year budget comparisons
  • Adopted vs. amended vs. actual spending
  • Encumbrances and remaining balances

The agent queries this data to answer questions like “What’s the police department’s overtime budget this year?” with current figures.

Financial Reporting

Access published financial reports and visualizations:

  • Revenue and expenditure summaries
  • Fund balance trends
  • Budget-to-actual variance reports
  • Year-over-year comparisons

When residents ask about financial trends, the agent pulls from your published OpenGov reports.

Performance Metrics

If your OpenGov instance includes performance management:

  • Key performance indicators by department
  • Goal progress and status
  • Outcome metrics
  • Service delivery statistics

The agent answers performance questions using your published metrics.

Data Refresh

  • Real-time: Queries against live OpenGov data return current values
  • Cached: Frequently accessed data cached for faster response
  • Scheduled: Full data sync on configurable intervals

Agent Capabilities

Enable modules based on your transparency goals:

Budget Q&A

Answer resident questions about the budget. “How much do we spend on public safety?” returns a breakdown from your budget data. “Why did the water fund increase?” retrieves narrative explanations from uploaded budget documents.

Spending Lookup

Let residents query specific expenditures. “How much did we pay for road salt last winter?” searches transaction data if published through OpenGov or connected systems.

Revenue Explanation

Help residents understand where money comes from. “What percentage of revenue is from property taxes?” calculates from your revenue data. “Why did sales tax revenue drop?” surfaces explanations from your financial documents.

Comparison Tools

Answer comparative questions. “How does our police budget compare to last year?” pulls multi-year data. “What percentage of the budget goes to each department?” generates proportional breakdowns.

Capital Projects

Track capital improvement projects and bond-funded initiatives. “What’s the status of the new fire station?” returns project updates if that information is in your knowledge base or connected systems.

Document Retrieval

Help residents find specific documents. “Where can I find the 2024 audit?” returns a direct link. “Show me the parks department budget narrative” retrieves the relevant section.


Compliance

Data Retention

Configure retention policies for conversation records, knowledge base documents, and audit logs. Retention periods can vary by department or project. Legal holds suspend deletion when litigation or records requests require preservation.

Audit Trail

All agent interactions generate tamper-evident audit records documenting queries, responses, knowledge base access, and administrative actions. Logs export for records requests and compliance reviews.

Standards Alignment

Civagent’s compliance controls align with NIST 800-53 (AU-11, SI-12) for audit and retention, and SOC 2 (C1.2, P5.1) for data handling.

Public Records

Conversations about public budget data may themselves be public records. Configure retention and export accordingly. The agent does not handle confidential financial data—it queries only information already published through your OpenGov transparency portal.

Accessibility

OpenGov portals should meet WCAG 2.1 AA accessibility standards. Civagent’s chat interface supports keyboard navigation, screen readers, and sufficient color contrast. The conversational interface helps residents who find data visualizations or complex tables difficult to interpret.


Implementation Checklist

Pre-deployment

  • [ ] Gather documents for knowledge base (budgets, CAFRs, narratives, audits)
  • [ ] Identify which OpenGov datasets to connect
  • [ ] Document retention requirements for conversation records
  • [ ] Determine which agent modules to enable
  • [ ] Confirm OpenGov admin access for script installation

Configuration

  • [ ] Upload documents to Civagent knowledge base
  • [ ] Configure OpenGov data connection
  • [ ] Set up website content ingestion if applicable
  • [ ] Set retention policies
  • [ ] Test agent responses against common budget questions

Deployment

  • [ ] Add embed script to OpenGov portal settings
  • [ ] Verify widget appears correctly
  • [ ] Test on mobile devices
  • [ ] Confirm theme matches portal design

Monitoring

  • [ ] Review conversation logs for common questions
  • [ ] Identify knowledge gaps and add content
  • [ ] Track resident engagement with budget information
  • [ ] Gather feedback on answer accuracy

Common Questions

These questions represent typical resident inquiries the agent should handle after configuration:

  • “What’s the total budget for this year?”
  • “How much do we spend on police/fire/parks?”
  • “Where does the city’s money come from?”
  • “Why are property taxes going up?”
  • “What’s in the capital improvement plan?”
  • “How much debt does the city have?”
  • “What did we spend on [specific item] last year?”
  • “When is the budget hearing?”
  • “How can I provide input on the budget?”

Test these questions during configuration to verify the agent returns accurate, well-sourced answers.


Operational Notes

Human in the Loop: Agents answer questions and surface data. Staff review for accuracy on complex financial questions. The agent may provide a budget figure, but finance staff can verify against source systems.

No Data Training: Civagent does not train on customer data. Conversations and documents remain within the municipal tenant with no third-party sharing.

Source Attribution: Responses cite the documents or data sources used. Residents see whether an answer comes from the adopted budget document, a CAFR, or live OpenGov data.

Multi-language Support: The agent handles queries in multiple languages without separate configuration. A resident can ask “¿Cuánto gastamos en parques?” and receive a response in Spanish.

Data Accuracy: The agent reports what’s published. If OpenGov data is outdated or contains errors, the agent surfaces that data. Maintain your OpenGov instance as the source of truth.


Support

For OpenGov admin questions (portal configuration, custom scripts, data publishing), contact your OpenGov account representative or access OpenGov support resources.

For Civagent setup and configuration, contact the Civagent team for jurisdiction onboarding, knowledge base setup, and data source connections.