AI agent that drafts the Capital Structure and Shareholding Pattern section of a Draft Red Herring Prospectus (DRHP) from ROC filings and supporting documents.
- RAG: Ingest PAS-3, SH-7, List of Allottees, MOA from
data/(markdown) - Agentic retrieval: Multi-query search via
search_knowledge - Structured output:
@structuredDraftOutput(Syrin schema, OpenAI-compatible) - Automation transparency: Sources used, auto-extracted parts, items needing review
- Grounding: Fact extraction and verification from source documents
- Guardrails: FactVerificationGuardrail to verify grounded facts
- Budget: Cost limits per run
- Output: Markdown (
.md) and optional DOCX - HTTP serving:
serve.pyfor/chatand/playground
- Python 3.11+ (syrin)
OPENAI_API_KEY
From the syrin-python repo root:
cd examples/ipo_drafting_agent
uv sync # or: uv pip install -e "../..[knowledge,docx,serve]" python-dotenvCreate .env with OPENAI_API_KEY, or export it.
# From ipo_drafting_agent (or repo root with PYTHONPATH)
python run.pyOutput: output_draft_section.md (draft + transparency metadata). Use --trace to inspect intermediate steps.
python serve.pyThen:
curl -X POST http://localhost:8000/chat \
-H "Content-Type: application/json" \
-d '{"message": "Draft the Capital Structure and Shareholding Pattern section."}'Or visit http://localhost:8000/playground for the web UI.
output_draft_section.md– draft section + automation transparency (sources, auto-extracted, requires review)output_draft_section.docx– same as Word (if syrin[docx] installed)
Intermediate structured data is visible via --trace; no separate JSON file.
Add documents under data/:
data/PAS-3/– PAS-3 forms, allotment resolutions, list of allotteesdata/SH-7/– SH-7, MOA, board resolutions, EGM notices
| Component | Purpose |
|---|---|
Knowledge |
Document loaders, chunking, embedding, vector store |
Agent |
LLM + tools, structured output |
search_knowledge |
RAG retrieval (auto-added via knowledge=) |
Output(DraftOutput) |
@structured output |
GroundingConfig |
Fact extraction and verification |
FactVerificationGuardrail |
Verify grounded facts |
Budget |
Cost limits per run |
PYTHONPATH=examples/ipo_drafting_agent uv run pytest examples/ipo_drafting_agent/ipo_tests/ -v