Inspiration

If you run every client project yourself, you also run every scope conversation yourself. Solo operators and freelancers often find themselves doing unbilled work simply because they want to avoid arguing with clients over what is or isn't included in a contract. We wanted to build a tool that removes the friction from these conversations. The goal isn't to argue with clients, but to ensure that solo developers actually notice when a scope-creep conversation is happening before it turns into unpaid labor.

What it does

Accord is an automated change request manager for solo operators. It acts as a shield between client requests and your signed Statements of Work (SOW).

When a client request comes in via our Intake API, Accord instantly searches the specific project's signed SOW for relevant clauses. It decides whether the requested work is already covered and quotes the contract language back to you word-for-word. If the request is out-of-scope, Accord generates an estimated hours count priced at your configured rate, along with a drafted reply you can immediately send. Once approved, that out-of-scope work automatically turns into a billable line item ready to be invoiced.

How we built it

Accord is built with a highly secure, entirely server-side architecture.

  • The Stack: We used the Next.js App Router, React Server Components, Tailwind CSS v4, and Supabase (PostgreSQL).
  • AI & RAG: Uploaded PDFs are parsed using unpdf and chunked. We use Google's Gemini embeddings (gemini-embedding-001, 1536 dims) to embed the requests, storing them in Postgres with pgvector to find the nearest SOW clauses via cosine similarity.
  • The Verdict Engine: We use Groq (llama-3.3-70b-versatile in JSON mode) to adjudicate the scope. We intentionally run the verdict evaluation at a temperature of 0 so the same request and contract always yield the exact same answer, while running the email reply generation slightly warmer for better prose.
  • Intake API: We built a dedicated webhook route (/api/evaluate-scope) so users can easily point their inbox automations, forms, or webhooks directly to Accord.

Challenges we ran into

  • PDF Text Normalization: Extracting text from PDFs that arrive hard-wrapped with no blank lines proved difficult. We had to build robust tests to successfully rebuild paragraph breaks. Getting this wrong meant clauses would get cut mid-sentence, which completely degraded our vector retrieval.
  • Database Security Quirks: Because we wanted the database to be completely unreachable from the browser, we didn't use Row Level Security (RLS). Instead, we revoked all privileges from anon and authenticated roles. However, we discovered that Supabase re-grants these privileges on every new table by default during migrations, meaning we had to explicitly alter default privileges to ensure the door didn't reopen on subsequent database migrations.

Accomplishments that we're proud of

  • Zero Client-Side Vulnerability: Every single database query runs server-side under the service role via Server Components and Server Actions. There is no browser Supabase client anywhere in the codebase, and no sensitive variables are exposed to the client. The entire application forms work flawlessly even with JavaScript disabled.
  • Privacy-First Processing: Uploaded contract PDFs are strictly read for their text and immediately thrown away. We only store the parsed clauses themselves, keeping data footprint light and privacy high.

What we learned

Building Accord gave us a masterclass in Retrieval-Augmented Generation (RAG) optimization. specifically the nuances of contract chunking and how critical text normalization is to vector search accuracy. We also learned a great deal about PostgreSQL permission architectures and how to effectively bypass client-side database connections entirely to build a hyper-secure Next.js application.

What's next for Accord

  • Direct Inbox Integrations: Building out native, seamless integrations for email providers so Accord can automatically parse incoming emails without needing a third-party webhook tool.
  • Expanded Document Support: Adding parsing support for other standard contract formats like .docx and .txt.
  • Invoice Generation: Integrating with payment gateways (like Stripe) to take the approved, out-of-scope line items and automatically generate and send the final invoices directly to the client.

Built With

  • gemini-embedding
  • groq
  • next.js
  • supabase
Share this project:

Updates

Submission history