Inspiration

Freight invoices almost never match the original quote exactly. A forwarder quotes a set of charges, the actual invoice comes in with different names, different rates, sometimes charges that were never quoted at all — and reconciling the two is manual, slow, and easy to get wrong. We wanted an agent that could do this reconciliation automatically, and — because the theme of this hackathon is agentic memory — one that actually remembers what it's already told you, instead of starting cold on every question.

What it does

LogiSight is an AI copilot for freight charge auditing. A forwarder submits a quote, uploads the resulting invoice, and LogiSight:

  • Parses the invoice and maps each raw charge line to a standardized charge in the company's charge dictionary — first by exact match, then by alias, then by semantic similarity via CockroachDB's vector index, falling back to an LLM and finally to human review for anything genuinely ambiguous.
  • Flags anomalies between the quote and the invoice — amount mismatches, rate mismatches, unexpected or missing charges.
  • Lets users ask the Copilot natural-language questions about their quotes, invoices, and anomalies — and, unlike a stateless chatbot, the Copilot remembers the current conversation and can recall relevant past interactions from earlier sessions, using CockroachDB as the single store for that memory.

How we built it

A note on project history, in the interest of full disclosure: the underlying LogiSight application — the invoice/quote data model, the charge-mapping pipeline, the React frontend shell — is a project we started building in April 2026, before this hackathon's Submission Period opened. Everything described below as our CockroachDB and AWS work was built specifically during the Submission Period (Aug 3–17, 2026): migrating the database to CockroachDB, adding Distributed Vector Indexing, integrating the CockroachDB Managed MCP Server, deploying via AWS Lambda and S3, and building the agentic memory layer (same-session history + cross-session semantic recall) described below. We're disclosing this per the Official Rules' "New Projects Only" clause and the organizers' guidance to be explicit about what's new versus pre-existing.

CockroachDB tools used, and how:

  • Distributed Vector Indexing — charge names are embedded and stored in a native VECTOR(1536)column with a distributed vector index. When an invoice charge doesn't match our dictionary exactly, we query the index directly in SQL (ORDER BY embedding_v <-> :query_vec`) to find the closest semantic match, instead of maintaining a separate vector store alongside our transactional data. We use this same pattern for agent memory: every Copilot exchange is embedded and indexed, so the agent can later retrieve semantically similar past conversations from other sessions — not just the current one.
  • CockroachDB Cloud Managed MCP Server — the Copilot agent connects to our cluster through the real Managed MCP Server (JSON-RPC over the MCP protocol — initializetools/listtools/call), generating SQL from the user's natural-language question and executing it through MCP's read-only, audited execute-query tool, rather than a bespoke database connection.

AWS services used, and how:

  • AWS Lambda — the FastAPI backend runs on Lambda (via Mangum) behind API Gateway, and a second Lambda is triggered directly by S3 upload events to run OCR and populate invoice data synchronously.
  • Amazon S3 — invoice PDFs are uploaded directly to S3 via presigned URLs, which is what triggers the ingestion Lambda above.
  • Amazon Bedrock — used for Titan embeddings (the vectors behind our charge-matching and memory-recall features) and available as an LLM fallback; our primary LLM for query generation is Groq/Llama for speed, with Bedrock/Claude as the fallback path.

Agentic memory, specifically: every Copilot question and answer is recorded in CockroachDB. On each new question, we pull the last several turns of the current session's history and fold them into the SQL/answer generation prompt, so follow-up questions ("what about last month specifically?") resolve correctly. Separately, we search the vector index of past interactions across all of a tenant's sessions, so the agent can surface something relevant it discussed weeks ago in an entirely different conversation — all from the same CockroachDB cluster, with no separate vector store and no sync gap between transactional and semantic data.

Challenges we ran into

Getting real distributed vector indexing right meant moving away from an earlier, naive approach — computing similarity in application code after pulling every row — to actually using CockroachDB's native VECTOR type and index, which is a meaningfully different (and much more scalable) query pattern. Wiring the Managed MCP Server correctly also meant generating real SQL from the user's question before calling MCP's execute-query tool, rather than assuming the server would interpret natural language directly.

Accomplishments we're proud of

Getting agent memory to genuinely read back — not just log — was the part we cared about most, since it's the actual theme of this hackathon. Cross-session recall via the same vector index we use for charge matching means CockroachDB is doing real double duty as both an operational database and the agent's long-term memory, in one system.

What we learned

How much simpler multi-modal (transactional + vector) data gets when it lives in one system instead of stitching together a separate vector database — no ETL, no consistency gap, one query language.

What's next for LogiSight

Extending semantic recall beyond the Copilot into the anomaly-detection pipeline itself, so the agent can flag "we've seen this exact discrepancy with this forwarder before" using the same memory it already builds today.

Built With

Share this project:

Updates