CJP - Civic Journey Platform

Inspiration

Citizen concerns are everywhere social media, community platforms, government portals, and local discussions but they are often fragmented and forgotten.

One person reports that there are not enough technology jobs for graduates. Another says engineers are leaving the city. Someone else reports limited IT opportunities. These may all describe the same underlying civic problem, but traditional systems often treat them as completely separate complaints.

That inspired us to ask:

What if an AI agent could genuinely remember civic concerns, connect them across time, and help citizens move from a problem to a possible solution?

We wanted to build more than a chatbot that forgets its previous conversations and more than a database with a search box. We wanted persistent agentic memory to be a core part of the application.

That became CJP - Civic Journey Platform, where CockroachDB acts as the persistent memory layer for the civic agent.


What CJP Does

CJP transforms fragmented citizen voices into an accountable civic journey.

A citizen can report a concern such as:

"There aren't enough technology jobs for graduates in my area."

The CJP agent can:

  1. Search persistent civic memory for semantically related issues and reports.
  2. Identify whether the concern is related to an existing civic issue.
  3. Create or update a consolidated civic issue.
  4. Maintain an accountability timeline.
  5. Search for relevant employment opportunities using semantic similarity.
  6. Persist the interaction and related context in CockroachDB.
  7. Retrieve that context when the citizen returns later.

For example, a citizen can return and ask:

"Continue with the employment issue about Thanjavur graduates."

Instead of starting from zero, the agent can retrieve the previous issue context, location, status, timeline, related reports, job matches, and previous actions from CockroachDB.

This demonstrates the core idea of CJP:

Citizen voice → AI understanding → persistent memory → related information → actionable next steps


How We Built It

CJP uses a React frontend, Python FastAPI backend, Strands Agents SDK, Amazon Bedrock, and CockroachDB Cloud.

Agent Layer

The Strands Agents SDK orchestrates the Civic Agent with dynamically selected tools.

The agent uses Amazon Bedrock Nova Pro for reasoning. Instead of forcing a fixed sequence of operations, the agent determines which tools are relevant to the citizen's request.

CJP currently provides 13 agent tools, including capabilities for:

  • Civic memory search
  • Civic issue creation
  • Related issue detection
  • Job opportunity search
  • Job matching
  • Context retrieval
  • CockroachDB Agent Skills

CockroachDB Memory Layer

CockroachDB is the persistent memory layer of CJP.

The application stores structured civic information such as:

  • Issues
  • Citizen reports
  • Conversations
  • Messages
  • Responses
  • Evidence
  • Job opportunities
  • Agent actions

CJP also uses CockroachDB Distributed Vector Indexing for semantic retrieval.

Amazon Bedrock Titan Embed V2 generates 1024-dimensional embeddings, which are stored directly in CockroachDB alongside the operational data.

This allows the agent to find semantically related information even when a citizen uses completely different wording.

CockroachDB MCP

The CockroachDB Cloud Managed MCP Server connects the agent with the CockroachDB memory layer.

This allows the agent to perform database-related persistence and retrieval operations through MCP, while the CJP Agent Activity interface makes important agent operations visible to the user.

CockroachDB Agent Skills

We also integrated the CockroachDB Agent Skills repository.

The application loads 34 structured CockroachDB skills covering areas such as:

  • Application Development
  • Query Design
  • Operations
  • Observability
  • Security
  • Migrations

The agent can use tools such as consult_cockroachdb_skill and list_cockroachdb_skills when CockroachDB-specific knowledge is relevant.

ccloud CLI

The ccloud CLI was used during development and deployment for CockroachDB Cloud cluster administration, configuration, and API credential/MCP setup.

Frontend

The frontend was built with:

  • React 18
  • TypeScript
  • Tailwind CSS
  • Vite
  • React Router

The interface includes:

  • Civic dashboard
  • Civic Agent
  • Citizen report flow
  • Civic issue explorer
  • Opportunity/job browser
  • Persistent memory exploration
  • Agent Activity monitor
  • CockroachDB technology explanations
  • Execution timelines
  • Issue detail pages
  • Navigation and error handling

The application is deployed on Vercel with CockroachDB Cloud and Amazon Bedrock.


What We Learned

1. Persistent memory changes what an agent can do

The biggest lesson was that an agent becomes much more useful when memory is treated as a core architectural component rather than an afterthought.

With CockroachDB, structured data, conversations, reports, and embeddings can remain together in the same persistent system.

2. Vector similarity depends on the embedding model

We learned that similarity scores cannot be treated as universal thresholds.

Titan Embed V2 produced a different score distribution from the embedding models we had previously worked with. We therefore had to test retrieval behavior empirically and calibrate our thresholds instead of assuming that a commonly used value such as 0.7 would automatically work.

3. MCP creates a useful boundary between agents and databases

The CockroachDB Managed MCP Server gave us a clean interface between the agent and database capabilities.

Instead of building a custom database-to-agent integration layer, the agent can communicate through the MCP protocol.

4. Agent observability matters

We learned that agentic applications should not be treated as black boxes.

CJP includes an Agent Activity interface that surfaces agent processing, MCP operations, vector searches, and related actions so users can understand what the system is doing.

5. Serverless has practical limits for reasoning agents

Our Nova Pro reasoning, vector searches, and database operations can take approximately 30–50 seconds.

That made Vercel's serverless execution timeout an important engineering constraint and pushed us to reduce unnecessary agent/tool operations.


Challenges We Faced

CockroachDB Vector Index Configuration

Working with CockroachDB's vector indexing syntax required us to adapt from assumptions based on standard PostgreSQL/pgvector examples.

We had to understand the syntax supported by our CockroachDB version and test the resulting indexes and retrieval behavior.

Vector Parameter Ordering

While building dynamic semantic-search queries, conditional SQL clauses caused parameter positions to shift.

This resulted in errors such as malformed vector literals. Debugging the issue required tracing the SQL placeholders and embedding parameters rather than assuming the embedding itself was invalid.

Titan Embed V2 Retrieval Calibration

Our initial similarity thresholds returned few or no results.

We tested the actual score distribution produced by Titan Embed V2 and adjusted retrieval thresholds based on observed behavior.

Vercel Runtime Configuration

During deployment, environment variables configured at build time were not available to the production serverless runtime as expected.

The deployed function initially attempted to connect to localhost:26257 instead of CockroachDB Cloud.

We resolved this by configuring the production environment variables correctly in Vercel.

Windows SSL Configuration

sslmode=verify-full required a root certificate configuration that was not available by default in our Windows development environment.

We adjusted the connection configuration to use encrypted sslmode=require.


What We Are Proud Of

The most important accomplishment is that CJP is not simply a chatbot connected to a database.

The application demonstrates a complete persistent-memory workflow:

Citizen Report
      ↓
Civic Agent
      ↓
Semantic Memory Search
      ↓
CockroachDB
      ↓
Issue + Report + Embedding + Timeline
      ↓
Persistent Memory
      ↓
Citizen Returns
      ↓
Agent Retrieves Previous Context
      ↓
Actionable Response

CockroachDB provides the persistent memory foundation, while Amazon Bedrock provides the reasoning and embedding capabilities.

The result is a civic agent that can turn a citizen's concern into a persistent, connected, and actionable journey rather than treating every conversation as a completely new interaction.

Vision

Our long-term vision is for CJP to make every civic concern from a broken streetlight to employment opportunities and larger community problems part of a persistent journey from:

Citizen Voice → Understanding → Memory → Accountability → Action → Resolution

We believe the combination of CockroachDB's distributed data and vector capabilities with AWS's AI services provides a strong foundation for building agentic applications where memory is not an optional feature, but the foundation that makes the agent useful.

Built With

Share this project:

Updates

Submission history