feb19 generic Python Backend: Generic LangGraph AI Agent for Orders and SchedulingFreelanceJobs • Canada
This job offer is no longer available
feb19 generic Python Backend: Generic LangGraph AI Agent for Orders and Scheduling
FreelanceJobs
- Canada
- Canada
About
Summary
create backend generic python code for AI agent to get orders nad or scheduling . generic meaning it can be any business like pizza store or dry cleaner or dentist office or library . So get order or scheduling or provide info . input is pdf file with business description like menu or items available or schedule or all three . use python and langchain and langgraph . best way find such repo in github . acceptance criteria I can use it by myself on my windows computer. you provide .doc file with instructions how to install python code and related software like data base; how to install and use ; set up ; testing procedure and testng input data . you provide python code . should use some data base. use openai or gemini or claude or same grade good LLM
*** important provide extensive logs for all historical detail of calculations , especially for tools calls. like @langchain_tool
Python Backend: Generic LangGraph RAG AI Agent for Orders + Scheduling from Business PDF (Windows-Ready, DB + Docs)
Job Description
I need a generic Python backend framework for an AI agent that can run a small-business workflow for any business type, such as:
Pizza store (ordering)
Dry cleaner (service orders)
Dentist office (appointment scheduling)
Library (hours, membership, holds)
Any similar small business
The agent's only business input is a PDF that describes the business (menu/items/services, pricing, hours, policies, scheduling rules, availability, etc.). From that PDF, the agent must support three capabilities:
Order intake (build cart / order, collect missing info, confirm)
Scheduling (create appointments/reservations, check availability, reschedule/cancel)
Information Q&A (hours, policies, pricing, FAQs)
This must be implemented in Python using LangChain + LangGraph, with a clean tool-based architecture (not a rigid state machine). The output should be a reusable framework where I can swap the PDF and run the same agent for a different business.
Key Requirements
Core Functionality
PDF ingestion → knowledge base: parse and chunk PDF; build retrieval (RAG) so the agent answers grounded in the PDF.
Tool-based agent flow (LangGraph):
Tools for: search_knowledge, create_order, update_order, confirm_order, check_availability, book_appointment, modify_appointment, cancel_appointment, get_business_info, etc.
Agent should proactively ask clarifying questions when required fields are missing.
Database required (not just in-memory):
Must store orders, appointments, customers, conversation sessions, and audit logs.
Prefer: PostgreSQL (local or Docker) OR SQLite as a minimal local option (explain tradeoffs). If PostgreSQL: provide simple Windows setup and schema/migrations.
Backend API:
Provide a FastAPI server with endpoints:
POST /agent/chat (conversation turns)
GET /health
Optional: POST /business/load_pdf to load/update a business PDF
Include a local test client script.
Generic Business Support
The system must not hardcode "pizza-specific" logic. It should work from the PDF business rules. The only "domain behaviors" should be:
Entities: items/services, modifiers/options, pricing, hours, availability, policies
Universal flows: order building, appointment booking, info responses, confirmations
Logging + Traceability (Important)
Full structured logging for debugging:
LLM prompts and tool calls (sanitized keys)
Retrieved chunks / citations from PDF
DB writes
Errors and stack traces
DB audit tables or log files are acceptable, but must be consistent and readable.
Deliverables
Complete Python project (ready to run on Windows):
app/ FastAPI server
agent/ LangGraph graph + tools
rag/ PDF ingestion + embeddings + retrieval
db/ schema + migrations + models + seed scripts
tests/ runnable smoke tests
.env.example
Database schema + setup (Postgres or SQLite, must be documented)
Sample PDFs + test data (at least 2 example businesses):
Example 1: restaurant menu + hours
Example 2: dentist schedule rules + services
Testing procedure:
A script like python that runs several scripted conversations:
Place an order end-to-end
Book an appointment end-to-end
Ask 10 info questions grounded in the PDF
Documentation (.docx) with screenshots:
Step-by-step Windows install (Python, venv, dependencies, DB)
How to run server and test scripts
How to swap in a new PDF business and re-index
Troubleshooting section (common errors)
Short end-to-end demo video (screen recording) showing setup + run + tests.
Acceptance Criteria (Must Pass)
I can clone the repo on Windows 10/11, follow the .docx, and run:
pip install -r
DB setup command(s)
uvicorn --port 5000
python
Agent must successfully handle:
Order flow: choose item(s), handle options/modifiers, compute total, request missing info, produce final confirmation.
Scheduling flow: propose times, check conflicts, book, reschedule, cancel.
Info flow: answer questions with retrieval-based grounding (include citations / chunk references).
All orders and appointments must be persisted in the DB and retrievable via admin/debug endpoints or DB queries.
Logs must clearly show tool calls and retrieval sources for each answer.
Preferred Tech Stack
Python 3.11+
FastAPI + Uvicorn
LangChain + LangGraph
Postgres (preferred) or SQLite (acceptable if well-structured)
Vector storage: pgvector (if Postgres) or a local vector store (document and justify)
Strict config via .env
RAG for context creation
Below are natural conversation story scenarios you can include in your specification and test scripts.
They are written to exercise an agentic flow (clarification, correction, memory, slot-filling, grounding), not a rigid form-filling bot.
Each scenario intentionally contains:
changing intent
missing info
corrections
confirmations
multi-turn reasoning
You can directly use these as acceptance test conversations.
Scenario 1 — Restaurant (Order + Change Mind + Add Items)
Context
Business PDF contains menu, modifiers, drinks, delivery rules, address collection.
Conversation
Customer:
Hi
AI:
Hello Welcome to Mario's Pizza. What would you like today?
Customer:
I want to order a pizza
AI:
Sure — what size and which toppings?
Customer:
Large pepperoni
AI:
Great. Would you like regular crust or thin crust?
Customer:
Regular
AI:
Added: Large pepperoni pizza, regular crust.
Anything else?
Customer:
Yes also a drink
AI:
We have cola, diet cola, sprite, and iced tea. What would you like?
Customer:
Coke
AI:
Added: Coke.
Anything more?
Customer:
Actually I changed my mind. I don't want pizza. I want garlic bread instead.
AI (important behavior — edit existing order):
No problem — I removed the pizza and added garlic bread.
Your current order:
Garlic bread
Coke
Anything else?
Customer:
No
AI:
Is this for pickup or delivery?
Customer:
Delivery
AI:
Please provide your delivery address.
Customer:
34 Front Street, postal code N4K 4L7
AI (validate + normalize):
Got it:
34 Front Street, N4K 4L7
Do you want to add apartment or buzzer number?
Customer:
No
AI:
Your total is $9.75.
Would you like to confirm the order?
Customer:
Yes
AI:
Order confirmed. Estimated delivery: 35–45 minutes.
What this scenario tests
replace item in cart
remove previously chosen items
ask missing fields
address capture
confirmation flow
memory of current order state
Scenario 2 — Dry Cleaner (Service Order + Clarification)
Context
PDF contains service list, pricing rules, turnaround times.
Conversation
Customer:
Hi I need clothes cleaned
AI:
Sure — what items do you have?
Customer:
2 shirts and a suit
AI:
Is the suit dry-clean only or regular wash?
Customer:
Dry clean
AI:
Got it:
2 shirts (wash & press)
1 suit (dry clean)
Do you need express service (24h) or regular (3 days)?
Customer:
How much is express?
AI:
Express adds $12 to the order.
Customer:
Ok regular then
AI:
Pickup or drop-off?
Customer:
Pickup
AI:
Please provide your address.
Customer:
12 King St West, N5A 2L2
AI:
When should we come?
Customer:
Tomorrow morning
AI:
We have pickup windows: 9–11 AM or 11–1 PM.
Customer:
9–11
AI:
Great. Pickup scheduled tomorrow between 9–11 AM.
Estimated total: $28.
Confirm?
Customer:
Yes
AI:
Pickup scheduled. You will receive a notification when cleaning is complete.
What this tests
service classification
conditional pricing
scheduling window selection
clarification questions
structured job creation
Scenario 3 — Dermatology Clinic (Appointment Scheduling + Reschedule)
Context
PDF includes services, durations, doctor availability.
Conversation
Customer:
Hello I need to see a skin doctor
AI:
Sure — is this a consultation, acne treatment, or mole check?
Customer:
Mole check
AI:
The appointment takes 20 minutes.
Would you prefer Dr. Smith or first available?
Customer:
First available
AI:
Available times:
Monday 2:40 PM
Tuesday 11:20 AM
Wednesday 9:00 AM
Customer:
Tuesday
AI:
Booked Tuesday at 11:20 AM.
May I have your name?
Customer:
John Carter
AI:
Phone number?
Customer:
226
AI:
Appointment created. Would you like SMS reminder?
Customer:
Yes
AI:
Done.
Later same conversation (modify intent)
Customer:
Actually I can't Tuesday
AI:
No problem — do you want to reschedule or cancel?
Customer:
Reschedule
AI:
Next available:
Wednesday 9:00 AM
Thursday 3:10 PM
Customer:
Wednesday
AI:
Appointment moved to Wednesday 9:00 AM.
What this tests
slot booking
capturing identity fields
modifying an existing booking
conversational continuity
Scenario 4 — Information Only (No Order)
Customer:
Are you open on holidays?
AI:
Yes — we are closed on Christmas and New Year's Day but open all other holidays 10am–4pm.
Customer:
Do you accept cash?
AI:
Yes, cash and cards are accepted.
What this tests
Pure RAG informational answering (no workflow triggered)
Scenario 5 — Mixed Intent (Hard Case)
Customer:
Hi are you open today?
AI:
Yes, until 9 PM.
Customer:
Ok book appointment at 8
AI:
What service do you need?
Customer:
Also how much is cleaning a jacket?
AI should:
answer price question
continue appointment flow
How You Should Use These
You can include them in your Upwork post as:
"Developer must implement agent capable of handling attached conversation scenarios exactly — including corrections, multi-intent messages, and context continuity."
These scenarios force the developer to implement:
real agent graph
memory
tool routing
slot filling
correction handling
Contract duration of less than 1 month.
Mandatory skills: Python, API, Chatbot, Gemini, OpenAI API
Languages
- English
Notice for Users
This job was posted by one of our partners. You can view the original job source here.