Trailmark is a knowledge-handover platform built as a two-person project. When a team member leaves a project, it reads the project's authorised sources, finds what is missing or unclear, asks the departing member about those gaps, and gives the incoming member a reviewed, evidence-linked handover.
The full journey on the synthetic "Campus Events App" project: the lead imports sources and runs the analysis, the departing member answers a question, the lead resolves the three source conflicts and approves, and the incoming member confirms receipt. The analysis step in this recording shows the saved result of a real AI run (backend/saved_results/), so the recording is repeatable. The full video is in the repo, and docs/demo/record.mjs regenerates it.
trailmark-demo.webm
When someone leaves a project, the files stay but much of what they knew leaves with them: why decisions were made, what was left half done, which parts depend on others, what usually breaks, and who to ask. This knowledge is scattered across chats, commits, pull requests, task boards and meeting notes, and often exists only in the leaver's memory. The incoming member has to rebuild the picture from fragments, and the remaining team loses time to questions and rework.
- Connect. The project lead connects authorised sources: a code repository, documents, a chat export and a task list, and sets who may see each one.
- Reconstruct. Trailmark rebuilds the project's current state: decisions and their reasons, owners, unfinished work, dependencies, risks and key contacts. Each item keeps a link to its source.
- Verify. Every statement is labelled:
- Verified: supported by a source, shown with the link.
- Unverified: stated by the departing member only.
- Missing or conflicting: nothing was found, or sources disagree. Trailmark says so and does not fill the gap.
- Ask. For each gap, the departing member gets a specific question together with the evidence that raised it, at most nine questions, riskiest first. Unanswered questions stay visible as open gaps.
- Review. The project lead edits, rejects, resolves conflicts (with a written reason) and approves. Every change is versioned, and nothing is shared until a person approves it.
- Hand over. The incoming member sees only the approved handover, filtered to their permissions, with what they own, unfinished work, risks, dependencies, open questions and a recommended order of next actions. Each statement links to its source, and they confirm receipt.
- Traceable: important statements link back to their supporting sources.
- Honest about uncertainty: missing, unverified and conflicting information is shown, not hidden or guessed.
- Permission-aware: summaries and derived statements inherit the restrictions of their sources, and restricted content is hidden or redacted.
- Human-controlled: a person reviews, corrects and approves every handover.
- Frontend: React (Next.js 14, TypeScript, Tailwind CSS), planned for Vercel
- Backend: Python 3.12, FastAPI, planned for Render
- Database: PostgreSQL in deployment, SQLite for local work (no pgvector, see the changes below)
- AI: a large language model API, Gemini by default (Groq and Anthropic also supported), with structured output, quote checks and a separate claim-support check
- Containers: Docker and Docker Compose (backend and database)
The full list of libraries, models and services is in docs/TOOLS.md.
Round 2 build. Nothing is deployed yet. The deployed link goes in one place, the first row of docs/ROUND2_SUBMISSION.md, and is still to be added.
- Backend: covers the whole workflow and has 197 automated tests, all passing on SQLite and on PostgreSQL 16 (3 Nov 2026, two separate runs). Sign-in with roles, handovers and members, source import, the AI analysis with quote and verification checks, the saved-results and basic fallbacks, the departing member's answers, the lead's review and approval, the incoming member's redacted and permission-filtered handover, and the receipt.
- AI run: the AI has been run on the synthetic project and the result is saved in
backend/saved_results/(106 statements, 9 questions). It cites 32 of 32 planted cases, 32 with the expected label, finds all three planted conflicts and marks all four claims only the leaver makes as unverified. The 32 uses the corrected answer key: the key locations of two cases (C26, C28) were wrong, and the same file scored 31 with the old key. Earlier scores in the run tables use the old key and were not re-scored. Other runs vary and some are weaker (29 and 30 with the old key in the last round, 15 in an earlier one). Details indocs/TESTING.md. - Frontend: the screens call the backend. The code passes
tsc --noEmitandnext build(3 Nov 2026). The full journey (lead, departing member, lead review and approval, incoming member) was clicked through on the merged code in the Claude desktop app's built-in browser (including 375 px and one AI-mode run) and again in Chrome against a local backend in saved-results mode, in both the cross-origin and the same-origin build. Voice recording was run once in Chrome by the project owner: the microphone was allowed, one spoken sentence was transcribed into the answer box and saved, and the backend returned it. Only one run, English, one speaker. The message shown when the microphone is refused was tested with a stubbed rejection. The frontend has 12 automated tests (npm test, all passed) that cover a small part of the screens. Firefox, Safari, a real phone and a deployed instance were not tried (docs/TESTING.md). - Deployment: the Docker and Render configuration is written but untested on Render. On 3 Nov 2026 the backend and Postgres built and ran in Docker on the current code (
/health, register, login, create a handover,401without login). The frontend image was built and started withdocker run;docker compose upfor the frontend was not run because ports were busy. Steps are indocs/DEPLOY.md.
You need Python 3.12 and Node.js. Docker is optional.
cd backend
python -m venv .venv
.venv/Scripts/activate # on macOS/Linux: source .venv/bin/activate
pip install -r requirements.txt
cp ../.env.example ../.env # then set JWT_SECRET to a long random string
uvicorn app.main:app --reloadThe API is at http://localhost:8000 and its interactive docs at /docs. GET /health answers {"status": "ok"}. Every endpoint is listed in docs/API.md. Locally the backend uses SQLite, so nothing else needs installing.
Without LLM_API_KEY the analysis runs in the saved or basic mode. For the AI, set LLM_API_KEY in .env (a free Gemini key from Google AI Studio works).
cd frontend
npm install
npm run devThe app is at http://localhost:3000 and talks to http://localhost:8000 unless NEXT_PUBLIC_API_URL says otherwise. The backend must be running, and FRONTEND_ORIGIN in .env must match the frontend address.
| Frontend variable | Meaning | Default |
|---|---|---|
NEXT_PUBLIC_API_URL |
Backend address the browser calls. same-origin (or empty) means relative paths, forwarded by Next.js to BACKEND_URL |
http://localhost:8000 |
BACKEND_URL |
Backend address for the forwarding in same-origin mode, read at build time. Not set means no forwarding | not set |
Same-origin mode is the fallback when a deployed login cookie is blocked, see docs/DEPLOY.md.
| Variable | Meaning | Default |
|---|---|---|
DATABASE_URL |
SQLite file or PostgreSQL address | sqlite:///./trailmark.db |
JWT_SECRET |
Signs login tokens. A deployed server (COOKIE_SECURE=true) refuses to start unless it is at least 32 characters |
change-me |
JWT_EXPIRE_MINUTES |
Login lifetime | 60 |
COOKIE_SECURE, COOKIE_SAMESITE |
true and none when frontend and backend are on different domains |
false, lax |
FRONTEND_ORIGIN |
Frontend address allowed by CORS | http://localhost:3000 |
LLM_API_KEY |
AI service key. Empty means no AI | empty |
LLM_PROVIDER |
gemini, groq or anthropic |
gemini |
LLM_MODEL |
Main model | gemini-3.6-flash |
LLM_FALLBACK_MODEL |
Second model, tried if the first keeps failing | gemini-3.5-flash-lite |
LLM_REASONING_EFFORT |
low, medium or high for models that think first |
low |
LLM_BASE_URL |
Override the provider address | empty |
SAVED_RESULTS_DIR |
Where analysis results are saved | saved_results |
TEST_DATABASE_URL |
Run the tests on PostgreSQL | not set |
The last four are read by the code but are not in .env.example.
cd backend
python -m pytest -qThe AI is never called in tests. The frontend has a small Vitest set: run npm test in frontend. How to run the backend tests on PostgreSQL, what each file covers and what is not tested yet is in docs/TESTING.md.
docker compose up --buildThis starts PostgreSQL and the backend at http://localhost:8000 (if that port is taken, set BACKEND_PORT=8010 first). Put your values in a .env file first (see .env.example), at least JWT_SECRET and LLM_API_KEY. Add the frontend with docker compose --profile frontend up --build (frontend/Dockerfile, a production build running as a non-root user, at http://localhost:3000). The frontend image was built and started on 3 Nov 2026 with docker run (see docs/TESTING.md); compose up with the frontend profile was not run. The address the browser uses for the backend is a build argument (NEXT_PUBLIC_API_URL, default http://localhost:8000). npm run dev as above still works. Saved analysis results are written to backend/saved_results/.
render.yaml describes the backend and its database for Render, and the frontend goes on Vercel. Because they are on different domains, COOKIE_SECURE=true and COOKIE_SAMESITE=none are set in render.yaml, and FRONTEND_ORIGIN must be the exact Vercel address. If the browser blocks the cross-domain cookie, use same-origin mode (BACKEND_URL). In a deployed setup the app refuses to start with a weak JWT_SECRET. The steps are in docs/DEPLOY.md.
docs/API.md: every endpoint with sample requests and responsesdocs/ARCHITECTURE.md: components, data flow, access control, decisionsdocs/TOOLS.md: APIs, models, libraries and services useddocs/TESTING.md: what is tested, what is notdocs/DEPLOY.md: deployment checklistdocs/FEEDBACK.md: user feedback sessions (none yet)docs/ROUND2_SUBMISSION.md: features completed, changes from the plan, Round 3 commitmentsdocs/Trailmark_Round1_Plan.pdf: the Round 1 plan
- pgvector and similarity search are not used. The model is given all source pieces in one request instead, which is fine for a project of the demo size but would need chunking for a large repository.
- Postgres row-level security is not built. Access is enforced in the backend and covered by tests.
- Repository data comes from an uploaded export (JSON), not live from the GitHub REST API.
- The frontend Docker image (
frontend/Dockerfile) was built withdocker compose --profile frontend buildand started locally withdocker run; it loaded and signed in against a local backend.compose upwith the frontend profile and a deployed instance have not been run.
- The model must cite source pieces by id with a word-for-word quote. If the quote is not in the cited piece, the claim is thrown away.
- Something only the departing member says in chat, with no code, document, task or other person behind it, is never
verified: it staysunverified. - A second, separate model call sees only the claim and its quotes. Only a clear "supported" makes a statement
verified, anything else staysunverified. - Two sources that disagree become one
conflictingstatement that cites both. - Missing information is reported as a
missinggap with a question for the leaver, never filled in. Rules in code (not the model) add gaps for unowned tasks and for commits nothing explains. They are listed indocs/TESTING.md. - Text shown to the incoming member has emails, phone numbers and secrets masked, and a statement is hidden unless they may see every source behind it.
- If the AI service fails, the last good results are shown (marked as saved), and if there are none, a basic listing built only from structured fields such as task owners. The response always says which mode was used.
What share of AI-generated claims are backed by a quote that really exists in the cited source.
Definition
- A claim is grounded if every quote it cites appears in the source piece it points to
- Matching is exact, ignoring only spacing and line breaks
- Measured on the model's raw output, before the pipeline discards bad claims
Result
| Claims | Grounded | Ungrounded | Rate |
|---|---|---|---|
| 110 | 106 | 4 | 96.4% |
- 130 of 134 individual quotes were found in the cited source (97.0%)
- The 4 misses were paraphrases presented as quotes
- Anything ungrounded is dropped before it reaches the user
Data and run
- 9 synthetic sources in
data/synthetic: 2 chats, 4 docs, a repo export, 2 task boards - Model:
gemini-3.5-flash-lite, one run - Reproduce from
backend:python tests/run_real_pipeline.py OUT, thenpython tests/score_grounding.py OUT
Limits
- Small sample: one run on one synthetic project
- Checks that the quote exists, not that the claim follows from it
- Claims rejected before evidence was checked (malformed output) are not counted
- Results will vary between runs and models
- Access is checked in the backend. Every endpoint checks who you are and your role in that handover. A statement or question is shown only if the viewer may see every source behind it, so a summary of a restricted document inherits the restriction. The incoming member only sees what the lead approved.
- Logins use argon2 password hashes and a signed token in an HTTP-only cookie. The AI key stays on the server and is never sent to the browser. A deployed server refuses to start with a weak
JWT_SECRET. - The demo screens use fixed demo accounts with one shared demo password. That is acceptable for synthetic data and not for real use.
- Redaction is pattern based. Emails, phone numbers and secrets are masked for the incoming member, but pattern matching will miss some sensitive text. Do not rely on it for real data.
- The AI service sees everything the lead connects, including sources only the lead may read. Connect only data you are allowed to send to the AI provider, and check the provider's terms, since free tiers may use submitted content. All demonstration data here is synthetic.
- The AI can be wrong, so the product shows its evidence. Each statement links to a quote copied from its source, quotes that are not in the source are thrown away, and a separate check decides what counts as verified. Missing information is reported as a gap with a question, never filled in. A person reviews and approves every handover.
- Not built yet: database row-level security and the audit log (the audit log is planned for Round 3).
- The AI result varies from run to run. The saved result is the best of its round, not a typical one.
- Not tested yet: voice beyond that one run (other browsers, accents, long answers), Firefox and Safari, a real phone, a deployed instance (including Vercel),
docker compose --profile frontend up, and Docker upload and analysis on the current build. Each item is listed indocs/TESTING.md. - A departing member can change an answer until the lead approves. After approval the server refuses changes (
409). - A gap statement or question with no source of its own is hidden or neutral for the incoming member (and for the departing member's questions), so it cannot name a restricted place. This is enforced in
backend/app/access.pyand tested, and the pipeline also removes restricted names from statement and question text. Pattern-based, so it can miss unusual wording. - The AI runs on a free tier with request limits. When it is unavailable, the app shows saved results from a real run, then a basic listing.
- All pieces go to the model in one request, so a large repository would need chunking.
- Only three kinds of conflict (token lifetime, capacity, QR format) are checked by rules in code, others depend on the model.
- Redaction is pattern based.
- No live Slack, Jira or GitHub API import. Repositories come in as an uploaded export.
- No database migrations (tables are created at start), and a running analysis is lost if the server restarts.
More in docs/TESTING.md and docs/ARCHITECTURE.md.
Committed for Round 3 (not built yet):
- Follow-up questions on any statement, answered by the lead or departing member as new versions.
- A decision timeline with conflicts shown side by side.
- An audit log of who viewed, edited and approved what, and tests that restricted information never appears in a summary.
Also planned: fix reliability problems found in Round 2, improve usability and accessibility, and run structured feedback sessions (docs/FEEDBACK.md). Ideas beyond that: live source connectors, chunking for large repositories, database migrations, and Postgres row-level security.
| Member | GitHub | Main areas |
|---|---|---|
| Kishan S (team leader) | KishanSadeesh | Frontend, synthetic demo project, testing, deployment, demonstration |
| Tharun Sridhar | tharunsridhar | AI pipeline, backend, access control, Docker, documentation |
Both members work together across the project.
The repository is owned by the GitHub account try2mastercode, which belongs to Tharun Sridhar. All commits come from the two members' own accounts listed above.
- Demonstration data is synthetic.
- AI assistance used in development, including AI-generated code, is disclosed in this repository. The backend code was written with help from Claude Code and reviewed by the team.
- External services: a large language model API (Gemini by default), GitHub, Render and Vercel. Render and Vercel are not deployed to yet.
