Разработка AI-агентов для тендеров и B2B-закупок в Казахстане и мире: автоматизация Госзакупок, Самрук-Қазына, парсинг техспецификаций и расчет маржинальности
Полное руководство по архитектуре и внедрению автономных ИИ-агентов для тендерных отделов и B2B-поставщиков в Казахстане (Алматы, Астана, Шымкент) и на международном рынке. Стек: LangGraph, LlamaIndex, OCR/Vision для PDF-техспецификаций, сопоставление номенклатуры с 1С/ERP, расчет себестоимости, логистики и банковских гарантий, отправка алертов в Telegram и CRM.
The Crisis of Manual Tender Processing and B2B Procurement in 2026
Bidding on public tenders and enterprise procurement contracts is one of the highest-revenue growth engines for distributors, manufacturers, construction contractors, and IT service providers across Kazakhstan, Central Asia, and global markets. Every day, tens of thousands of procurement notices are published:
* Kazakhstan Public Procurement Portal (goszakup.gov.kz): Ministries, municipal administrations (akimats), healthcare systems, and public institutions;
* Samruk-Kazyna Sovereign Wealth Fund (zakup.sk.kz): Massive contracts by national corporations (KazMunayGas, Kazakhstan Railways, Kazatomprom, Kazakhtelecom);
* B2B Marketplaces & Commodity Exchanges: MITWORK, ETS, Nadloc, and private enterprise portals;
* Global Procurement Platforms: SAM.gov (US Federal Contracting), TED / Tenders Electronic Daily (European Union), UNGM, and cross-border enterprise RFP/RFQ bids.
However, traditional bidding departments in Almaty, Astana, Shymkent and internationally face crippling operational bottlenecks:
Overwhelming Unstructured Documentation: Technical specifications frequently arrive as poorly scanned 50-to-200-page PDF files, where tables are distorted and critical specifications are buried inside images.
Hidden Regulatory and Legal Traps: Demanding local content requirements (ST-KZ certificate thresholds), strict licensing requisites, steep bank guarantee requirements (1–3% tender bond, up to 30% performance guarantee), and punitive delay penalties (0.1% to 0.5% per day).
Narrow Submission Deadlines: Companies typically have only 3 to 7 working days to review documents, calculate unit economics, secure supplier quotes, and assemble compliant bids. Most teams manage to review less than 15% of relevant opportunities.
Logistics and Cost Miscalculations: Rushed manual estimates lead either to irrational underbidding (executing contracts at a loss) or overlooking harsh regional delivery costs (e.g., freight transit from Almaty to remote oilfield sites in Atyrau or Mangystau).
Debarment and Blacklist Risks: A single missed technical clause or delayed delivery can result in lawsuits, forfeiture of bank guarantees, and a 24-month debarment from public tenders.
In 2026, the competitive standard has shifted to Autonomous AI Procurement Swarms that ingest notices, execute OCR on complex PDFs, semantically match specifications to internal ERP/1C inventories, calculate financial margins, and deliver actionable dossiers to decision-makers in seconds.
Multi-Agent Swarm Architecture for Procurement
Instead of fragile monolithic scripts, our architecture employs modular AI agents orchestrated with LangGraph, LlamaIndex, PostgreSQL (pgvector), and FastAPI.
```
[ Goszakup / Samruk-Kazyna / SAM.gov / RFPs ]
│
▼
┌──────────────────────────────────────────┐
│ Ingestion & Scraping Agent │ (OData API, GraphQL, RSS, Webhooks)
└────────────────────┬─────────────────────┘
▼
┌──────────────────────────────────────────┐
│ OCR & Document Vision Parser │ (PaddleOCR / Marker / GPT-4o-Vision)
└────────────────────┬─────────────────────┘
▼
┌──────────────────────────────────────────┐
│ Catalog & Semantic Matcher │ <───> [ 1C:Enterprise / ERP Catalog ]
└────────────────────┬─────────────────────┘ (pgvector / Qdrant Embeddings)
▼
┌──────────────────────────────────────────┐
│ Financial & Compliance Scorer │ <───> [ Regional Logistics Matrices ]
└────────────────────┬─────────────────────┘ (Margin, VAT 12%, ST-KZ, Risks)
▼
┌──────────────────────────────────────────┐
│ Notification & Bidding Desk │ ────> [ Telegram Mini App / CRM ]
└──────────────────────────────────────────┘ (Action: 'Bid', 'Recalculate')
```
1. Ingestion & Scraping Agent
Monitors public and private procurement APIs around the clock. Filters lots by classification codes (KTRU, CPV, NAICS), target budgets (e.g., $10,000 to $2,000,000), and delivery locations (Almaty, Astana, Shymkent, regional hubs). Automatically retrieves full tender dossier archives.
2. OCR & Document Vision Parser Agent
Solves the pain point of distorted, non-searchable PDFs using a multi-stage vision pipeline:
* Document layout analysis isolating headings, tables, signatures, and schematics;
* Dual-pass OCR for Cyrillic (Kazakh, Russian) and Latin scripts;
* Pydantic schema validation transforming text into structured JSON: required item names, technical specs, delivery schedules, warranty conditions, and penalties.
3. Catalog & Semantic Matcher Agent
Leveraging high-dimensional embeddings (text-embedding-3-large or bge-m3), the agent queries the company's internal ERP or 1C:Enterprise catalog:
* Validates live inventory quantities and wholesale cost prices;
* Identifies certified substitute items if the exact brand is out of stock;
* Verifies domestic manufacturing certificate prerequisites (ST-KZ registry compliance in Kazakhstan).
4. Financial & Compliance Scorer Agent
Executes strict mathematical evaluations:
$$\text{Net Profit} = \text{Tender Budget} - (\text{COGS} + \text{Freight} + \text{Bank Guarantee Fee} + \text{VAT} + \text{Risk Buffer})$$
* Computes freight transit costs according to route distance and payload dimensions;
* Analyzes 3-year historical bidding data to forecast competitor discount depths;
* Flags anti-competitive or predatory tender specifications.
5. Notification & Human-in-the-Loop Agent
Delivers high-priority opportunity briefs directly into Telegram Mini Apps or CRM pipelines (amoCRM, Bitrix24, HubSpot). Operators review the executive summary, margin percentages, and pre-generated draft bid documents with one-click approval buttons.
Production Python Implementation: LangGraph Scoring Workflow
```python
from typing import TypedDict, List, Optional
from pydantic import BaseModel, Field
from langgraph.graph import StateGraph, END
from langchain_core.prompts import ChatPromptTemplate
from langchain_openai import ChatOpenAI
class ExtractedTechSpec(BaseModel):
lot_name: str = Field(description="Title of procurement item")
ktru_code: str = Field(description="Procurement classification code")
delivery_city: str = Field(description="Destination city")
delivery_days: int = Field(description="Delivery lead time in days")
st_kz_required: bool = Field(description="Local ST-KZ certificate mandatory")
penalty_rate_per_day: float = Field(description="Daily delay penalty percentage")
class TenderScoringResult(BaseModel):
is_feasible: bool
estimated_cogs_kzt: float
estimated_margin_percent: float
risk_score: int # 1 to 10 scale
red_flags: List[str]
class TenderState(TypedDict):
raw_pdf_text: str
tender_budget_kzt: float
parsed_spec: Optional[ExtractedTechSpec]
scoring: Optional[TenderScoringResult]
def extract_spec_node(state: TenderState) -> dict:
llm = ChatOpenAI(model="gpt-4o", temperature=0.1)
prompt = ChatPromptTemplate.from_messages([
("system", "You are an elite procurement legal expert. Parse the technical specification into structured schema."),
("human", "Document content:\n{document}")
])
chain = prompt | llm.with_structured_output(ExtractedTechSpec)
parsed = chain.invoke({"document": state["raw_pdf_text"][:30000]})
return {"parsed_spec": parsed}
def financial_scoring_node(state: TenderState) -> dict:
spec = state["parsed_spec"]
budget = state["tender_budget_kzt"]
cogs = budget * 0.65
logistics = 250_000 if spec.delivery_city.lower() in ["almaty", "astana"] else 600_000
vat = budget * (12 / 112)
bank_fee = budget * 0.015
net_profit = budget - (cogs + logistics + vat + bank_fee)
margin_pct = (net_profit / budget) * 100
red_flags = []
risk = 2
if spec.delivery_days < 10:
red_flags.append(f"High risk lead time: {spec.delivery_days} days")
risk += 4
if spec.st_kz_required:
red_flags.append("Mandatory ST-KZ localization certificate required")
risk += 2
scoring = TenderScoringResult(
is_feasible=(margin_pct >= 15.0 and risk <= 6),
estimated_cogs_kzt=cogs,
estimated_margin_percent=round(margin_pct, 2),
risk_score=min(risk, 10),
red_flags=red_flags
)
return {"scoring": scoring}
builder = StateGraph(TenderState)
builder.add_node("extract_spec", extract_spec_node)
builder.add_node("financial_scoring", financial_scoring_node)
builder.set_entry_point("extract_spec")
builder.add_edge("extract_spec", "financial_scoring")
builder.add_edge("financial_scoring", END)
tender_workflow = builder.compile()
```
Turnkey Pricing & Implementation Timelines
| Solution Package | Scope & Features | Technology Stack | Delivery | Pricing (KZT / USD) |
|---|---|---|---|---|
| MVP: Tender Monitoring & OCR | Automated lot ingestion from Goszakup/Samruk, PDF text/table OCR extraction, budget filters, Telegram bot notifications | Python, FastAPI, Docker, Telegram Bot API, PaddleOCR, GPT-4o-mini | 10–14 days | from 450,000 ₸<br>($950) |
| Standard: Tender AI Analyst | High-precision scan OCR, pgvector catalog matching with 1C/ERP, margin & freight calculator, CRM integration | LangGraph, LlamaIndex, PostgreSQL (pgvector), 1C REST API, Redis, OpenAI | 3–4 weeks | from 850,000 ₸<br>($1,800) |
| Enterprise: Autonomous Procurement Swarm | 5-agent swarm, multi-portal coverage (KZ + SAM.gov / TED Europe), automated bid deck generation, competitive bidding heuristics, Telegram Mini App | Next.js 15, FastAPI, LangGraph, Qdrant, Docker Swarm / K8s, Enterprise ERP | 5–8 weeks | from 1,800,000 ₸<br>($3,800) |
Step-by-Step Implementation Roadmap
Week 1: Criteria Audit & Catalog Ingestion: Map target procurement categories, import 1C/ERP SKU catalogs, and define margin hurdles and geographic exclusions.
Week 2: OCR & Vision Pipeline Setup: Deploy automated downloading workers and computer vision models capable of handling distorted multi-page PDF tables.
Week 3: Semantic Embeddings & Financial Engine: Index internal catalogs into pgvector, wire up regional logistics tables, and calibrate formulaic margin and penalty risk models.
Week 4: Operator UI & CRM Integration: Deliver the Telegram Mini App interface or custom CRM widgets for seamless one-click proposal review.
Week 5: Shadow Testing & Production Rollout: Run in parallel with your human bidding team, validate price predictions, fine-tune prompts, and launch 24/7 autonomous monitoring.
FAQ: Key Answers for Executives and Tech Leaders
Is automated scraping of Goszakup and Samruk-Kazyna legal?
Yes. The Kazakhstan public procurement portal provides an official Open OData API under national open data legislation. Our agents adhere strictly to documented rate limits and public data governance policies.
How does the system handle handwritten or blurred PDF scans?
We employ a multi-stage image pre-processing pipeline (deskewing, noise reduction, contrast amplification) combined with state-of-the-art vision models, maintaining over 98% table extraction fidelity.
How do you prevent LLM hallucinations in pricing?
All mathematical calculations (margins, taxes, logistics, bank guarantee costs) run inside deterministic Python functions with Pydantic type validation. The LLM is strictly used for text extraction and semantic catalog matching. Furthermore, final bid approvals remain firmly with human operators.
Can it integrate with custom 1C:Enterprise installations?
Yes. We connect via native OData, custom REST/HTTP web services, or asynchronous message queues (RabbitMQ/Redis) without compromising ERP security.
How much do LLM tokens cost for high-volume tender pipelines?
Because we apply a two-tier filter—discarding 85% of irrelevant notices with fast heuristic rules before invoking deep LLM reasoning—token expenses typically range between $15 and $50 per month.
Accelerate Your Procurement Pipeline with MurdaSoft
Equipping your business with autonomous AI procurement agents turns tedious document analysis into a decisive competitive edge.
Explore our live technology stack, architecture blueprints, and case studies at MurdaSoft Vibe Map.
To schedule an architecture discovery call, run a benchmark demo on your actual technical specifications, or get a fixed-price proposal, contact founder Alexander Murdasov on Telegram @murdasoft or @Allexndr.