Skip to content

AswinWebDev/Concordia

Repository files navigation

Concordia — Autonomous Agentic Negotiation & On-Chain Legal Copilot

🌐 The Ultimate Truth Layer for Digital Agreements

Concordia is a privacy‑first, multi-agent autonomous negotiation platform. It eliminates the catastrophic friction of legacy contract redlining by deploying isolated, zero-retention AI agents to negotiate on your behalf. Once the agents strike a deal, Concordia autonomously rewrites the agreement and locks cryptographically unforgeable proof onto the Ethereum blockchain.


🏆 Hackathon Tracks Targeted

1. Protocol Labs ($16,000 - Agents With Receipts / ERC-8004)

  • Truly Autonomous Background Agent: Our daemon continuously polls the Ethereum Sepolia blockchain for RoomCreated events.
  • Discover -> Plan -> Execute -> Verify: When an event fires, the agent fetches the E2EE encrypted document from IPFS, decrypts it locally, analyzes it via the LLM, and submits a blockchain transaction back to the room with the analysis hash. Independent of the frontend!

2. Venice AI ($11,500 - Private Agents, Trusted Actions)

  • Zero-Retention Secret Keepers: Each party instructs a totally isolated Venice AI instance. The AI strictly guards the user's private constraints (e.g., maximum budget, hidden deadlines).
  • Autonomous Document Rewriting: We utilize mistral-small-3-2-24b-instruct to read the entire negotiation transcript, extract the mutually agreed-upon terms, and autonomously rewrite the legally binding text document before executing a dual-consensus IPFS sync.
  • Privacy Enforcement: We explicitly enforce Venice's privacy headers (include_venice_system_prompt: false) to guarantee confidential business strategies never leak to model training pipelines.

3. Synthesis Open Track ($14,500)

  • Advanced multi-agent prompt engineering utilizing Directional Math Evaluation Logic, Rule of Bidding, and strict Prompt Injection Defenses to prevent one party from manipulating the other party's AI into signing an exploitative deal.

4. ENS Track

  • Seamless Server-Side Resolution: Users bypass the UX friction of raw Ethereum hex addresses. You can invite a counterparty simply by typing vitalik.eth or base.eth.
  • CORS-Immune Proxy: To prevent browser-level CCIP-Read CORS blockers and RPC rate limits, all ENS hooks are routed through a highly redundant, server-side Next.js Viem proxy fetching from Cloudflare Ethereum nodes, ensuring flawless resolution entirely independent of the user's connected testnet.

🛠️ Architecture & Tech Stack

Frontend & Web3 (Glassmorphic Minimalist UI)

  • Framework: Next.js 15 (React), Tailwind CSS v4, Framer Motion
  • Web3 Integration: Wagmi, Viem, RainboxKit
  • Design Philosophy: Pure techno-industrial glassmorphism inspired by Venice AI.

Backend / Autonomous Agent

  • Runtime: Node.js, TypeScript
  • Blockchain Interaction: Ethers.js v6
  • AI Inference: Venice AI API (mistral-small-3-2-24b-instruct)
  • Self-Healing: Built-in 3-attempt Auto-Retry loops for LLM hallucinations or network drops.

Smart Contracts & Immutable Storage

  • Smart Contract Framework: Hardhat, Solidity
  • Decentralized Storage: IPFS via Pinata SDK
  • Network: Ethereum Sepolia Testnet

🚨 The Market Problem

Legal negotiation currently relies on painfully slow email ping-pong, expensive billable hours, and blind trust. Furthermore, pasting contracts into commercial AI tools (like standard ChatGPT) exposes highly confidential IP, NDAs, and trade secrets to centralized training algorithms. There is no simple, trustless, privacy‑first way for two entities to:

  1. Negotiate rapidly without human psychological friction.
  2. Protect their absolute bottom-line constraints.
  3. Generate immutable cryptographic proof of consensus.

⚡ The Concordia Solution: End-to-End Workflow

1. Zero-Knowledge Initialization & IPFS

Users paste their contract into Concordia and supply the counterparty's Ethereum address. Concordia dynamically generates an AES-256-GCM room key, entirely client-side. The document is encrypted and pushed to IPFS. The decryption key is exclusively passed via the URL anchor fragment (#key=...), meaning the server never sees the unencrypted text.

2. Constraint Setting

Both parties enter the E2EE workspace and instruct their local AI Copilot in natural language. (e.g. "I am the client. Cap the hourly rate at $60, but try to get $55. Deadline is July 20th.").

3. Autonomous Multi-Agent Warfare

Users click Auto-Negotiate. The two isolated AI agents connect in a shared Terminal interface and begin rapidly bargaining. They utilize complex logic to anchor prices, concede gracefully, and halt the system to ask the human for clarification if an impasse is reached.

4. Autonomous Rewriting & Dual-Consensus

Once the agents explicitly declare an agreement has been reached, the humans click Approve Terms. Concordia instantly triggers a massive LLM pipeline that scans the transcript, identifies the final terms, and autonomously rewrites the original legal contract to perfectly integrate the amendments. This new text is synchronized in real-time between both browsers.

5. Cryptographic Immutability On-Chain

Both parties click Sign & Record On-Chain. This triggers a MetaMask smart contract signature that writes both party's wallet addresses, the timestamp, and the final IPFS SHA-256 Hash permanently into the Ethereum ledger. The result is an unforgeable, undeniable cryptographic receipt of mutual agreement.


🚀 Getting Started Locally

Prerequisites

  1. Node.js 18+
  2. MetaMask wallet linked to Ethereum Sepolia.
  3. Configure .env in both concordia-frontend and concordia-agent.
    • VENICE_API_KEY
    • NEXT_PUBLIC_PINATA_JWT
    • NEXT_PUBLIC_RPC_URL (Alchemy/Infura)
    • PRIVATE_KEY

Running the Stack

Note: You must run BOTH the frontend and the agent daemon simultaneously to experience autonomous negotiation.

1. Start the Frontend:

cd concordia-frontend
npm install
npm run dev
# Running on http://localhost:3000

2. Start the Autonomous Daemon:

cd concordia-agent
npm install
npm start
# Daemon is now polling the blockchain for RoomCreated events.

🤝 Conclusion

Concordia represents a paradigm shift. We are moving from high-friction, low-trust human legal battles to frictionless, cryptographically-proven autonomous agent marketplaces.

About

Concordia is a privacy‑first AI contract copilot that helps two parties understand, negotiate, and finalize agreements in a private “contract room”

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors