Skip to main content

RBI Compliance Agent

The RBI Compliance Agent is a powerful regulatory intelligence platform designed for Indian financial institutions. It automates the processing of RBI circulars, extracts actionable compliance guidelines, and provides an AI-powered conversational assistant for navigating complex regulatory requirements.

Base URL​

/api/agents/compliance_agent

Authentication​

All endpoints require authentication. Sign up to https://cloud.nextneural.ai to get your API key.

How It Works​

The RBI Compliance Agent performs multi-layered regulatory document processing:

  1. Document Ingestion: Upload RBI circulars via URL, file upload, or knowledge base integration
  2. Intelligent Parsing: AI-powered extraction of document metadata, structure, and content
  3. Section Segmentation: Hierarchical document structure detection (5 levels deep)
  4. Guideline Extraction: LLM-based extraction of compliance rules with rich metadata
  5. Definition Extraction: Automatic identification and storage of regulatory term definitions
  6. Conversational AI: Natural language queries with SQL generation and context-aware responses

Key Features​

FeatureDescription
Multi-Source IngestionURL (PDF/HTML), file upload, KB document integration
Entity ClassificationSupport for all 11 RBI-regulated entity types
Hierarchical Parsing5-level document structure detection
Guideline ExtractionPriority, type, timeline, and compliance requirements
Definition ManagementAutomatic term definition extraction
AI Chat AssistantStreaming conversational interface with context retention
Multi-Tenant IsolationUser and organization-level data separation

Regulated Entity Types​

The agent supports all 11 RBI-regulated entity categories:

CodeEntity Type
CBCommercial Banks
SFBSmall Finance Banks
PBPayments Banks
LABLocal Area Banks
RRBRegional Rural Banks
UCBUrban Cooperative Banks
RCBRural Cooperative Banks
AIFIAll India Financial Institutions
NBFCNon-Banking Financial Companies
ARCAsset Reconstruction Companies
CICCredit Information Companies

Endpoints​

1. Health Check​

Check if the RBI Compliance Agent service is running.

Endpoint: GET /health

Authentication: None required

Response:

{
"status": "healthy",
"service": "RBI Compliance Agent"
}

2. Get Regulated Entities​

Retrieve all supported RBI-regulated entity types.

Endpoint: GET /regulated_entities

Authentication: Required

Request Example:

curl -X GET "https://nextneural-api.superteams.ai/api/agents/compliance_agent/regulated_entities" \
-H "Authorization: Bearer YOUR_TOKEN"

Response:

{
"entities": [
{"code": "CB", "name": "Commercial Banks"},
{"code": "SFB", "name": "Small Finance Banks"},
{"code": "PB", "name": "Payments Banks"},
{"code": "LAB", "name": "Local Area Banks"},
{"code": "RRB", "name": "Regional Rural Banks"},
{"code": "UCB", "name": "Urban Cooperative Banks"},
{"code": "RCB", "name": "Rural Cooperative Banks"},
{"code": "AIFI", "name": "All India Financial Institutions"},
{"code": "NBFC", "name": "Non-Banking Financial Companies"},
{"code": "ARC", "name": "Asset Reconstruction Companies"},
{"code": "CIC", "name": "Credit Information Companies"}
]
}

Circular (Document) Management​

3. Upload Circular via URL​

Upload an RBI circular by providing a URL or knowledge base document reference.

Endpoint: POST /upload_circular

Authentication: Required (scope: agent:compliance)

Request Body:

{
"pdf_url": "https://rbi.org.in/circulars/example.pdf",
"applicable_to": ["CB", "NBFC"],
"document_id": "550e8400-e29b-41d4-a716-446655440000"
}

Parameters:

  • pdf_url (optional, string): URL to the RBI circular (PDF or HTML)
  • applicable_to (optional, array): List of entity codes this circular applies to
  • document_id (optional, string): UUID of knowledge base document containing the circular

Request Example:

curl -X POST "https://nextneural-api.superteams.ai/api/agents/compliance_agent/upload_circular" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"pdf_url": "https://rbi.org.in/circulars/2025/circular-001.pdf",
"applicable_to": ["CB", "SFB", "NBFC"]
}'

Response:

{
"success": true,
"message": "Circular uploaded successfully",
"circular_id": 456,
"name": "Master Direction on KYC",
"reference_number": "RBI/2025-26/01",
"status": "Processing"
}

Notes:

  • Either pdf_url or document_id must be provided
  • The system automatically extracts metadata (name, reference number, date, subject)
  • Processing happens asynchronously; use the process endpoint or poll for status

4. Upload Circular File​

Upload a PDF file directly for processing.

Endpoint: POST /upload_circular_file

Authentication: Required (scope: agent:compliance)

Request: Multipart form data

Form Fields:

  • file (required): PDF file to upload
  • applicable_to (optional): Comma-separated entity codes

Request Example:

curl -X POST "https://nextneural-api.superteams.ai/api/agents/compliance_agent/upload_circular_file" \
-H "Authorization: Bearer YOUR_TOKEN" \
-F "file=@/path/to/circular.pdf" \
-F "applicable_to=CB,NBFC,SFB"

Response:

{
"success": true,
"message": "Circular uploaded successfully",
"circular_id": 457,
"file_size": 2048576,
"page_count": 25,
"status": "Processing"
}

Notes:

  • Files are stored securely in S3
  • Maximum file size: 50MB
  • Supported format: PDF

5. Get User Circulars​

Retrieve all circulars uploaded by the authenticated user.

Endpoint: GET /circulars

Authentication: Required (scope: agent:compliance)

Query Parameters:

  • entity_type (optional): Filter by applicable entity type (e.g., "CB", "NBFC")
  • limit (optional, default: 100): Maximum number of circulars to return
  • offset (optional, default: 0): Pagination offset

Request Example:

curl -X GET "https://nextneural-api.superteams.ai/api/agents/compliance_agent/circulars?entity_type=NBFC&limit=50" \
-H "Authorization: Bearer YOUR_TOKEN"

Response:

{
"success": true,
"count": 15,
"circulars": [
{
"id": 456,
"name": "Master Direction on KYC",
"reference_number": "RBI/2025-26/01",
"reference_id": "DoR.AML.REC.01/14.01.001/2025-26",
"date": "2025-01-10",
"subject": "Know Your Customer (KYC) Direction, 2025",
"applicable_to": ["CB", "SFB", "NBFC"],
"applies_to_all": false,
"sectors": ["Banking", "NBFC"],
"categories": ["AML/CFT", "Customer Due Diligence"],
"status": "Completed",
"page_count": 45,
"file_size": 2048576,
"guideline_count": 127,
"uploaded_at": "2025-01-14T10:30:00",
"kb_document_id": "550e8400-e29b-41d4-a716-446655440000"
}
]
}

6. Get Specific Circular​

Retrieve detailed information for a specific circular with its guidelines.

Endpoint: GET /circular/{circular_id}

Authentication: Required (scope: agent:compliance)

Path Parameters:

  • circular_id (required): The ID of the circular to retrieve

Request Example:

curl -X GET "https://nextneural-api.superteams.ai/api/agents/compliance_agent/circular/456" \
-H "Authorization: Bearer YOUR_TOKEN"

Response:

{
"success": true,
"circular": {
"id": 456,
"name": "Master Direction on KYC",
"reference_number": "RBI/2025-26/01",
"reference_id": "DoR.AML.REC.01/14.01.001/2025-26",
"date": "2025-01-10",
"subject": "Know Your Customer (KYC) Direction, 2025",
"regulator": "Reserve Bank of India",
"document_type": "Master Direction",
"applicable_to": ["CB", "SFB", "NBFC"],
"applies_to_all": false,
"sectors": ["Banking", "NBFC"],
"categories": ["AML/CFT", "Customer Due Diligence"],
"status": "Completed",
"page_count": 45,
"file_size": 2048576,
"pdf_url": "https://rbi.org.in/circulars/2025/circular-001.pdf",
"uploaded_at": "2025-01-14T10:30:00",
"created_at": "2025-01-14T10:30:00",
"updated_at": "2025-01-14T10:35:00"
},
"guidelines_summary": {
"total": 127,
"by_priority": {
"High": 23,
"Medium": 78,
"Low": 26
},
"by_status": {
"Pending Review": 100,
"Approved": 25,
"Rejected": 2
}
}
}

7. Delete Circular​

Delete a circular and all its associated guidelines, sections, and definitions.

Endpoint: DELETE /circular/{circular_id}

Authentication: Required (scope: agent:compliance)

Path Parameters:

  • circular_id (required): The ID of the circular to delete

Request Example:

curl -X DELETE "https://nextneural-api.superteams.ai/api/agents/compliance_agent/circular/456" \
-H "Authorization: Bearer YOUR_TOKEN"

Response:

{
"success": true,
"message": "Circular and all associated data deleted successfully",
"deleted": {
"circular_id": 456,
"guidelines_deleted": 127,
"sections_deleted": 45,
"definitions_deleted": 32
}
}

Notes:

  • This is a cascading delete operation
  • All guidelines, sections, and definitions linked to the circular are permanently removed
  • This action cannot be undone

8. Process Circular​

Trigger AI-powered parsing of an uploaded circular to extract sections, guidelines, and definitions.

Endpoint: POST /circular/{circular_id}/process

Authentication: Required (scope: agent:compliance)

Path Parameters:

  • circular_id (required): The ID of the circular to process

Query Parameters:

  • force_reprocess (optional, default: false): Re-process even if already completed

Request Example:

curl -X POST "https://nextneural-api.superteams.ai/api/agents/compliance_agent/circular/456/process?force_reprocess=false" \
-H "Authorization: Bearer YOUR_TOKEN"

Response (Processing Started):

{
"success": true,
"status": "Processing",
"message": "Document parsing initiated",
"circular_id": 456
}

Response (Already Processed):

{
"success": true,
"status": "Completed",
"message": "Document already processed",
"circular_id": 456,
"sections_count": 45,
"guidelines_count": 127,
"definitions_count": 32,
"processed_at": "2025-01-14T10:35:00"
}

Notes:

  • Processing extracts document structure, guidelines, and definitions
  • Large documents may take 30-60 seconds to process
  • Use force_reprocess=true to re-extract with updated AI models

Guideline Management​

9. Get Circular Guidelines​

Retrieve all guidelines extracted from a specific circular.

Endpoint: GET /circular/{circular_id}/guidelines

Authentication: Required (scope: agent:compliance)

Path Parameters:

  • circular_id (required): The ID of the circular

Query Parameters:

  • priority (optional): Filter by priority (High, Medium, Low)
  • status (optional): Filter by status (Pending Review, Approved, Rejected)
  • guideline_type (optional): Filter by type (Mandatory, Advisory, Conditional, etc.)
  • limit (optional, default: 100): Maximum number of guidelines
  • offset (optional, default: 0): Pagination offset

Request Example:

curl -X GET "https://nextneural-api.superteams.ai/api/agents/compliance_agent/circular/456/guidelines?priority=High&status=Pending%20Review" \
-H "Authorization: Bearer YOUR_TOKEN"

Response:

{
"success": true,
"circular_id": 456,
"count": 23,
"guidelines": [
{
"id": 1001,
"rule_id": "KYC-001",
"rule_type": "Compliance Requirement",
"title": "Customer Due Diligence for New Accounts",
"description": "Regulated entities shall carry out Customer Due Diligence (CDD) for all new customers before establishing an account-based relationship.",
"category": "Customer Due Diligence",
"sector": "Banking",
"guideline_type": "Mandatory",
"priority": "High",
"status": "Pending Review",
"applicable_to": ["CB", "SFB", "NBFC"],
"date": "2025-01-10",
"effective_date": "2025-04-01",
"implementation_deadline": "2025-06-30",
"review_date": "2026-01-10",
"section_id": 101,
"section_title": "Chapter III - Customer Due Diligence",
"extracted_data": {
"compliance_requirements": [
"Verify identity using officially valid documents",
"Obtain recent photograph",
"Verify current address"
],
"action_items": [
"Update KYC policy",
"Train staff on new requirements",
"Update customer onboarding forms"
],
"documentation_required": [
"Aadhaar/PAN/Passport",
"Address proof",
"Recent photograph"
],
"reporting_requirements": [
"Maintain records for 5 years after account closure"
],
"penalties": [
"Regulatory action under Section 47A of BR Act",
"Monetary penalty up to Rs. 1 crore"
],
"exceptions": [
"Small accounts with balance not exceeding Rs. 50,000"
],
"thresholds": {
"small_account_limit": "Rs. 50,000",
"enhanced_due_diligence_threshold": "Rs. 10,00,000"
}
},
"created_at": "2025-01-14T10:35:00",
"updated_at": "2025-01-14T10:35:00"
}
]
}

10. Get Specific Guideline​

Retrieve detailed information for a specific guideline.

Endpoint: GET /guideline/{guideline_id}

Authentication: Required (scope: agent:compliance)

Path Parameters:

  • guideline_id (required): The ID of the guideline

Request Example:

curl -X GET "https://nextneural-api.superteams.ai/api/agents/compliance_agent/guideline/1001" \
-H "Authorization: Bearer YOUR_TOKEN"

Response:

{
"success": true,
"guideline": {
"id": 1001,
"rule_id": "KYC-001",
"rule_type": "Compliance Requirement",
"title": "Customer Due Diligence for New Accounts",
"description": "Regulated entities shall carry out Customer Due Diligence (CDD) for all new customers before establishing an account-based relationship.",
"category": "Customer Due Diligence",
"sector": "Banking",
"guideline_type": "Mandatory",
"priority": "High",
"status": "Pending Review",
"applicable_to": ["CB", "SFB", "NBFC"],
"applies_to_all": false,
"date": "2025-01-10",
"effective_date": "2025-04-01",
"implementation_deadline": "2025-06-30",
"review_date": "2026-01-10",
"document": {
"id": 456,
"name": "Master Direction on KYC",
"reference_number": "RBI/2025-26/01"
},
"section": {
"id": 101,
"title": "Chapter III - Customer Due Diligence",
"level": 1
},
"extracted_data": {
"compliance_requirements": [...],
"action_items": [...],
"documentation_required": [...],
"reporting_requirements": [...],
"conditions": [...],
"thresholds": {...},
"exceptions": [...],
"penalties": [...],
"consequences": [...],
"references": [...],
"supersedes": [...],
"related_guidelines": [...],
"rationale": "...",
"examples": [...],
"notes": [...]
},
"approved_by": null,
"approved_at": null,
"reviewed_by": null,
"reviewed_at": null,
"parent_guideline_id": null,
"order_index": 1,
"created_at": "2025-01-14T10:35:00",
"updated_at": "2025-01-14T10:35:00"
}
}

11. Update Guideline Status​

Update the approval status of a guideline.

Endpoint: PATCH /guideline/{guideline_id}/status

Authentication: Required (scope: agent:compliance)

Path Parameters:

  • guideline_id (required): The ID of the guideline

Request Body:

{
"status": "Approved",
"reviewed_by": "Compliance Officer"
}

Parameters:

  • status (required, string): New status - "Pending Review", "Approved", or "Rejected"
  • reviewed_by (optional, string): Name or ID of the reviewer

Request Example:

curl -X PATCH "https://nextneural-api.superteams.ai/api/agents/compliance_agent/guideline/1001/status" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"status": "Approved",
"reviewed_by": "John Smith - Chief Compliance Officer"
}'

Response:

{
"success": true,
"guideline_id": 1001,
"previous_status": "Pending Review",
"new_status": "Approved",
"reviewed_by": "John Smith - Chief Compliance Officer",
"reviewed_at": "2025-01-14T11:00:00"
}

Section Management​

12. Get Circular Sections​

Retrieve the hierarchical section structure of a circular.

Endpoint: GET /circular/{circular_id}/sections

Authentication: Required (scope: agent:compliance)

Path Parameters:

  • circular_id (required): The ID of the circular

Request Example:

curl -X GET "https://nextneural-api.superteams.ai/api/agents/compliance_agent/circular/456/sections" \
-H "Authorization: Bearer YOUR_TOKEN"

Response:

{
"success": true,
"circular_id": 456,
"total_sections": 45,
"sections": [
{
"id": 100,
"section_id": "I",
"title": "Chapter I - Introduction",
"level": 1,
"order_index": 1,
"section_type": "introduction",
"parent_section_id": null,
"has_guidelines": false,
"guideline_count": 0,
"children": [
{
"id": 101,
"section_id": "1",
"title": "Short Title and Commencement",
"level": 2,
"order_index": 1,
"section_type": "procedural",
"parent_section_id": 100,
"has_guidelines": true,
"guideline_count": 2
},
{
"id": 102,
"section_id": "2",
"title": "Applicability",
"level": 2,
"order_index": 2,
"section_type": "scope",
"parent_section_id": 100,
"has_guidelines": true,
"guideline_count": 3
}
]
},
{
"id": 110,
"section_id": "II",
"title": "Chapter II - Definitions",
"level": 1,
"order_index": 2,
"section_type": "definition",
"parent_section_id": null,
"has_guidelines": false,
"guideline_count": 0,
"definition_count": 32
}
]
}

13. Get Specific Section​

Retrieve detailed content for a specific section.

Endpoint: GET /section/{section_id}

Authentication: Required (scope: agent:compliance)

Path Parameters:

  • section_id (required): The ID of the section

Query Parameters:

  • include_guidelines (optional, default: false): Include guidelines in this section

Request Example:

curl -X GET "https://nextneural-api.superteams.ai/api/agents/compliance_agent/section/101?include_guidelines=true" \
-H "Authorization: Bearer YOUR_TOKEN"

Response:

{
"success": true,
"section": {
"id": 101,
"section_id": "1",
"title": "Short Title and Commencement",
"content": "1. These Directions shall be called the Reserve Bank of India (Know Your Customer (KYC)) Direction, 2025.\n\n2. These Directions shall come into effect from April 1, 2025.",
"level": 2,
"order_index": 1,
"section_type": "procedural",
"parent_section_id": 100,
"document_id": 456,
"section_metadata": {
"word_count": 45,
"has_tables": false,
"has_lists": true
},
"processing_status": "Completed",
"guidelines": [
{
"id": 1001,
"title": "Direction Title",
"priority": "Low",
"status": "Pending Review"
},
{
"id": 1002,
"title": "Effective Date",
"priority": "High",
"status": "Pending Review"
}
]
}
}

14. Get Section Guidelines​

Retrieve all guidelines within a specific section.

Endpoint: GET /section/{section_id}/guidelines

Authentication: Required (scope: agent:compliance)

Path Parameters:

  • section_id (required): The ID of the section

Request Example:

curl -X GET "https://nextneural-api.superteams.ai/api/agents/compliance_agent/section/120/guidelines" \
-H "Authorization: Bearer YOUR_TOKEN"

Response:

{
"success": true,
"section_id": 120,
"section_title": "Chapter III - Customer Due Diligence",
"count": 15,
"guidelines": [
{
"id": 1001,
"rule_id": "KYC-001",
"title": "Customer Due Diligence for New Accounts",
"priority": "High",
"guideline_type": "Mandatory",
"status": "Pending Review"
}
]
}

Definition Management​

15. Get Circular Definitions​

Retrieve all term definitions extracted from a circular.

Endpoint: GET /circular/{circular_id}/definitions

Authentication: Required (scope: agent:compliance)

Path Parameters:

  • circular_id (required): The ID of the circular

Request Example:

curl -X GET "https://nextneural-api.superteams.ai/api/agents/compliance_agent/circular/456/definitions" \
-H "Authorization: Bearer YOUR_TOKEN"

Response:

{
"success": true,
"circular_id": 456,
"count": 32,
"definitions": [
{
"id": 501,
"term": "Beneficial Owner",
"term_id": "def-beneficial-owner",
"definition": "Beneficial owner means the natural person who ultimately owns or controls a client and/or the person on whose behalf a transaction is being conducted, and includes a person who exercises ultimate effective control over a legal person or arrangement.",
"category": "Core Definition",
"source_reference": "Chapter II, Clause 2(c)",
"section_id": 110
},
{
"id": 502,
"term": "Customer Due Diligence",
"term_id": "def-cdd",
"definition": "Customer Due Diligence (CDD) means identifying and verifying the customer and beneficial owner using reliable and independent sources of information/data/documentation.",
"category": "Core Definition",
"source_reference": "Chapter II, Clause 2(e)",
"section_id": 110
}
]
}

16. Get Specific Definition​

Retrieve a specific term definition.

Endpoint: GET /definition/{definition_id}

Authentication: Required (scope: agent:compliance)

Path Parameters:

  • definition_id (required): The ID of the definition

Request Example:

curl -X GET "https://nextneural-api.superteams.ai/api/agents/compliance_agent/definition/501" \
-H "Authorization: Bearer YOUR_TOKEN"

Response:

{
"success": true,
"definition": {
"id": 501,
"term": "Beneficial Owner",
"term_id": "def-beneficial-owner",
"definition": "Beneficial owner means the natural person who ultimately owns or controls a client and/or the person on whose behalf a transaction is being conducted, and includes a person who exercises ultimate effective control over a legal person or arrangement.",
"category": "Core Definition",
"source_reference": "Chapter II, Clause 2(c)",
"document": {
"id": 456,
"name": "Master Direction on KYC",
"reference_number": "RBI/2025-26/01"
},
"section": {
"id": 110,
"title": "Chapter II - Definitions"
}
}
}

AI Chat Assistant​

17. Chat with Compliance Agent (Streaming)​

Engage in a conversational Q&A session with the AI-powered compliance assistant using Server-Sent Events (SSE) for real-time streaming responses.

Endpoint: POST /chat/stream

Authentication: Required (scope: agent:compliance)

Request Body:

{
"message": "What are the KYC requirements for NBFCs?",
"conversation_id": 789
}

Parameters:

  • message (required, string): User's question or query
  • conversation_id (optional, integer): Existing conversation ID for context continuity

Request Example:

curl -X POST "https://nextneural-api.superteams.ai/api/agents/compliance_agent/chat/stream" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-H "Accept: text/event-stream" \
-d '{
"message": "What are the KYC requirements for NBFCs?",
"conversation_id": 789
}'

Response (SSE Stream):

event: status
data: {"status": "analyzing", "message": "Analyzing your query..."}

event: status
data: {"status": "searching", "message": "Searching compliance database..."}

event: content
data: {"chunk": "Based on the RBI Master Direction on KYC, "}

event: content
data: {"chunk": "NBFCs are required to perform Customer Due Diligence (CDD) "}

event: content
data: {"chunk": "for all new customers before establishing an account-based relationship..."}

event: context
data: {
"sources": [
{"document_id": 456, "name": "Master Direction on KYC", "reference": "RBI/2025-26/01"}
],
"relatedGuidelines": [
{"id": 1001, "title": "Customer Due Diligence for New Accounts", "priority": "High"}
],
"complianceImpact": "High"
}

event: done
data: {
"conversation_id": 789,
"message_id": 1050,
"processing_time_ms": 2340
}

Notes:

  • Uses Server-Sent Events (SSE) for real-time streaming
  • Creates a new conversation if conversation_id is not provided
  • Maintains conversation context for follow-up questions
  • Automatically detects and handles off-topic queries
  • Returns sources and related guidelines for transparency

Conversation Management​

18. Create Conversation​

Create a new conversation session with the compliance agent.

Endpoint: POST /conversations

Authentication: Required

Request Body:

{
"title": "KYC Compliance Review"
}

Parameters:

  • title (optional, string): Custom title for the conversation

Request Example:

curl -X POST "https://nextneural-api.superteams.ai/api/agents/compliance_agent/conversations" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"title": "KYC Compliance Review"
}'

Response:

{
"success": true,
"conversation": {
"id": 789,
"user_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"title": "KYC Compliance Review",
"is_active": true,
"is_archived": false,
"created_at": "2025-01-14T10:30:00",
"last_message_at": null
}
}

19. List Conversations​

Retrieve all conversations for the authenticated user.

Endpoint: GET /conversations

Authentication: Required

Query Parameters:

  • limit (optional, default: 50): Maximum number of conversations
  • offset (optional, default: 0): Pagination offset
  • include_archived (optional, default: false): Include archived conversations

Request Example:

curl -X GET "https://nextneural-api.superteams.ai/api/agents/compliance_agent/conversations?limit=20" \
-H "Authorization: Bearer YOUR_TOKEN"

Response:

{
"success": true,
"count": 15,
"conversations": [
{
"id": 789,
"title": "KYC Compliance Review",
"summary": "Discussion about KYC requirements for NBFCs",
"message_count": 12,
"is_active": true,
"is_archived": false,
"created_at": "2025-01-14T10:30:00",
"last_message_at": "2025-01-14T11:45:00"
},
{
"id": 788,
"title": "AML Guidelines Query",
"summary": "Questions about anti-money laundering reporting",
"message_count": 8,
"is_active": true,
"is_archived": false,
"created_at": "2025-01-13T15:20:00",
"last_message_at": "2025-01-13T16:30:00"
}
]
}

20. Get Conversation​

Retrieve a specific conversation with all its messages.

Endpoint: GET /conversations/{conversation_id}

Authentication: Required

Path Parameters:

  • conversation_id (required): The ID of the conversation

Request Example:

curl -X GET "https://nextneural-api.superteams.ai/api/agents/compliance_agent/conversations/789" \
-H "Authorization: Bearer YOUR_TOKEN"

Response:

{
"success": true,
"conversation": {
"id": 789,
"user_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"title": "KYC Compliance Review",
"summary": "Discussion about KYC requirements for NBFCs",
"is_active": true,
"is_archived": false,
"created_at": "2025-01-14T10:30:00",
"last_message_at": "2025-01-14T11:45:00",
"messages": [
{
"id": 1001,
"role": "user",
"content": "What are the KYC requirements for NBFCs?",
"created_at": "2025-01-14T10:31:00"
},
{
"id": 1002,
"role": "assistant",
"content": "Based on the RBI Master Direction on KYC, NBFCs are required to perform Customer Due Diligence (CDD) for all new customers...",
"context": {
"sources": [
{"document_id": 456, "name": "Master Direction on KYC"}
],
"relatedGuidelines": [
{"id": 1001, "title": "Customer Due Diligence for New Accounts"}
]
},
"processing_time_ms": 2340,
"created_at": "2025-01-14T10:31:15"
}
]
}
}

21. Update Conversation​

Update conversation title or archive status.

Endpoint: PUT /conversations/{conversation_id}

Authentication: Required

Path Parameters:

  • conversation_id (required): The ID of the conversation

Request Body:

{
"title": "Updated Title",
"is_archived": false
}

Request Example:

curl -X PUT "https://nextneural-api.superteams.ai/api/agents/compliance_agent/conversations/789" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"title": "KYC Compliance - NBFCs",
"is_archived": false
}'

Response:

{
"success": true,
"conversation": {
"id": 789,
"title": "KYC Compliance - NBFCs",
"is_archived": false,
"updated_at": "2025-01-14T12:00:00"
}
}

22. Delete Conversation​

Delete a conversation and all its messages.

Endpoint: DELETE /conversations/{conversation_id}

Authentication: Required

Path Parameters:

  • conversation_id (required): The ID of the conversation

Request Example:

curl -X DELETE "https://nextneural-api.superteams.ai/api/agents/compliance_agent/conversations/789" \
-H "Authorization: Bearer YOUR_TOKEN"

Response:

{
"success": true,
"message": "Conversation deleted successfully",
"deleted": {
"conversation_id": 789,
"messages_deleted": 12
}
}

23. Send Message​

Send a message in an existing conversation and get a response.

Endpoint: POST /conversations/{conversation_id}/messages

Authentication: Required

Path Parameters:

  • conversation_id (required): The ID of the conversation

Request Body:

{
"content": "What about enhanced due diligence requirements?"
}

Request Example:

curl -X POST "https://nextneural-api.superteams.ai/api/agents/compliance_agent/conversations/789/messages" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"content": "What about enhanced due diligence requirements?"
}'

Response:

{
"success": true,
"user_message": {
"id": 1003,
"role": "user",
"content": "What about enhanced due diligence requirements?",
"created_at": "2025-01-14T11:45:00"
},
"assistant_message": {
"id": 1004,
"role": "assistant",
"content": "Enhanced Due Diligence (EDD) is required for higher-risk customers and transactions. According to the KYC Direction, EDD must be applied when...",
"context": {
"sources": [...],
"relatedGuidelines": [...]
},
"processing_time_ms": 1890,
"created_at": "2025-01-14T11:45:05"
}
}

24. Get Conversation Messages​

Retrieve messages from a conversation with pagination.

Endpoint: GET /conversations/{conversation_id}/messages

Authentication: Required

Path Parameters:

  • conversation_id (required): The ID of the conversation

Query Parameters:

  • limit (optional, default: 50): Maximum number of messages
  • offset (optional, default: 0): Pagination offset (for loading older messages)

Request Example:

curl -X GET "https://nextneural-api.superteams.ai/api/agents/compliance_agent/conversations/789/messages?limit=20" \
-H "Authorization: Bearer YOUR_TOKEN"

Response:

{
"success": true,
"conversation_id": 789,
"count": 12,
"messages": [
{
"id": 1001,
"role": "user",
"content": "What are the KYC requirements for NBFCs?",
"is_spam": false,
"created_at": "2025-01-14T10:31:00"
},
{
"id": 1002,
"role": "assistant",
"content": "Based on the RBI Master Direction on KYC...",
"context": {...},
"processing_time_ms": 2340,
"created_at": "2025-01-14T10:31:15"
}
]
}

Data Models​

Circular (Document) Structure​

{
"id": 456,
"name": "Master Direction on KYC",
"reference_number": "RBI/2025-26/01",
"reference_id": "DoR.AML.REC.01/14.01.001/2025-26",
"date": "2025-01-10",
"subject": "Know Your Customer (KYC) Direction, 2025",
"regulator": "Reserve Bank of India",
"document_type": "Master Direction",
"applicable_to": ["CB", "SFB", "NBFC"],
"applies_to_all": false,
"sectors": ["Banking", "NBFC"],
"categories": ["AML/CFT", "Customer Due Diligence"],
"pdf_url": "https://...",
"source_type": "url",
"kb_document_id": "550e8400-e29b-41d4-a716-446655440000",
"page_count": 45,
"file_size": 2048576,
"status": "Completed",
"processing_error": null,
"extracted_text": "...",
"uploaded_at": "2025-01-14T10:30:00",
"created_at": "2025-01-14T10:30:00",
"updated_at": "2025-01-14T10:35:00"
}

Guideline Structure​

{
"id": 1001,
"rule_id": "KYC-001",
"rule_type": "Compliance Requirement",
"title": "Customer Due Diligence for New Accounts",
"description": "Full description text...",
"category": "Customer Due Diligence",
"sector": "Banking",
"guideline_type": "Mandatory",
"priority": "High",
"status": "Pending Review",
"applicable_to": ["CB", "SFB", "NBFC"],
"applies_to_all": false,
"date": "2025-01-10",
"effective_date": "2025-04-01",
"implementation_deadline": "2025-06-30",
"review_date": "2026-01-10",
"document_id": 456,
"section_id": 101,
"parent_guideline_id": null,
"order_index": 1,
"extracted_data": {
"compliance_requirements": [...],
"action_items": [...],
"documentation_required": [...],
"reporting_requirements": [...],
"conditions": [...],
"thresholds": {...},
"exceptions": [...],
"penalties": [...],
"consequences": [...],
"references": [...],
"supersedes": [...],
"related_guidelines": [...],
"rationale": "...",
"examples": [...],
"notes": [...]
},
"approved_by": null,
"approved_at": null,
"reviewed_by": null,
"reviewed_at": null,
"created_at": "2025-01-14T10:35:00",
"updated_at": "2025-01-14T10:35:00"
}

Section Structure​

{
"id": 101,
"section_id": "1",
"title": "Short Title and Commencement",
"content": "Full section content...",
"level": 2,
"order_index": 1,
"section_type": "procedural",
"parent_section_id": 100,
"document_id": 456,
"section_metadata": {
"word_count": 150,
"has_tables": false,
"has_lists": true
},
"processing_status": "Completed",
"processing_error": null
}

Definition Structure​

{
"id": 501,
"term": "Beneficial Owner",
"term_id": "def-beneficial-owner",
"definition": "Full definition text...",
"category": "Core Definition",
"source_reference": "Chapter II, Clause 2(c)",
"document_id": 456,
"section_id": 110
}

Conversation Structure​

{
"id": 789,
"user_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"organization_id": "org-123",
"title": "KYC Compliance Review",
"summary": "Discussion about KYC requirements...",
"is_active": true,
"is_archived": false,
"created_at": "2025-01-14T10:30:00",
"updated_at": "2025-01-14T11:45:00",
"last_message_at": "2025-01-14T11:45:00"
}

Message Structure​

{
"id": 1002,
"conversation_id": 789,
"role": "assistant",
"content": "Response content...",
"context": {
"sources": [...],
"relatedGuidelines": [...],
"complianceImpact": "High",
"agent_decision": {...},
"query_results": [...]
},
"is_spam": false,
"processing_time_ms": 2340,
"created_at": "2025-01-14T10:31:15"
}

Guideline Types​

TypeDescription
MandatoryMust be complied with; non-compliance attracts penalties
AdvisoryRecommended practices; compliance encouraged but not enforced
ConditionalApplies only under specific conditions or thresholds
ExemptionProvides relief from certain requirements
ProhibitionActions or practices that are explicitly prohibited
ProceduralProcess or procedure to be followed
ReportingReporting obligations and timelines
DisclosureInformation disclosure requirements

Priority Levels​

PriorityDescriptionTypical Characteristics
HighCritical compliance requirementsRegulatory deadlines, penalties for non-compliance, core requirements
MediumImportant but with flexibilitySignificant requirements with reasonable implementation timelines
LowInformational or minor requirementsBest practices, clarifications, minor procedural points

Processing States​

StatusDescription
ProcessingDocument is being parsed and analyzed
CompletedProcessing finished successfully
FailedProcessing failed (see processing_error for details)

Error Responses​

All endpoints may return the following error responses:

400 Bad Request:

{
"detail": "Invalid request: pdf_url or document_id is required"
}

403 Forbidden:

{
"detail": "Access denied. This circular does not belong to your account."
}

404 Not Found:

{
"detail": "Circular not found"
}

422 Unprocessable Entity:

{
"detail": "Invalid entity type. Allowed values: CB, SFB, PB, LAB, RRB, UCB, RCB, AIFI, NBFC, ARC, CIC"
}

500 Internal Server Error:

{
"detail": "Error processing document: [error message]"
}

Best Practices​

Document Upload​

  1. Use Knowledge Base Integration: For better document management, upload files to the knowledge base first and reference by document_id
  2. Specify Entity Applicability: Provide applicable_to to improve search and filtering
  3. Wait for Processing: After upload, use /circular/{id} to check processing status before querying

Using the Chat Assistant​

  1. Be Specific: Ask specific questions about regulations, guidelines, or definitions
  2. Use Follow-ups: Leverage conversation context for deeper exploration
  3. Reference Documents: Mention specific circulars or topics for targeted responses

Managing Guidelines​

  1. Review High Priority First: Focus on High priority guidelines for critical compliance
  2. Track Implementation Deadlines: Use implementation_deadline for compliance planning
  3. Use Status Workflow: Move guidelines through Pending Review → Approved/Rejected

Workflow Example​

# 1. Upload an RBI circular
curl -X POST "https://nextneural-api.superteams.ai/api/agents/compliance_agent/upload_circular" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"pdf_url": "https://rbi.org.in/circulars/2025/kyc-master-direction.pdf",
"applicable_to": ["CB", "NBFC", "SFB"]
}'

# 2. Process the document
curl -X POST "https://nextneural-api.superteams.ai/api/agents/compliance_agent/circular/456/process" \
-H "Authorization: Bearer YOUR_TOKEN"

# 3. Check processing status
curl -X GET "https://nextneural-api.superteams.ai/api/agents/compliance_agent/circular/456" \
-H "Authorization: Bearer YOUR_TOKEN"

# 4. View extracted guidelines
curl -X GET "https://nextneural-api.superteams.ai/api/agents/compliance_agent/circular/456/guidelines?priority=High" \
-H "Authorization: Bearer YOUR_TOKEN"

# 5. Start a conversation
curl -X POST "https://nextneural-api.superteams.ai/api/agents/compliance_agent/conversations" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"title": "KYC Compliance Analysis"}'

# 6. Ask compliance questions (streaming)
curl -X POST "https://nextneural-api.superteams.ai/api/agents/compliance_agent/chat/stream" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-H "Accept: text/event-stream" \
-d '{
"message": "What are the key KYC requirements for NBFCs?",
"conversation_id": 789
}'

# 7. Approve a guideline after review
curl -X PATCH "https://nextneural-api.superteams.ai/api/agents/compliance_agent/guideline/1001/status" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"status": "Approved",
"reviewed_by": "Chief Compliance Officer"
}'

Security Features​

  • User Isolation: All data is private to your account
  • Organization Support: Multi-tenant architecture with organization-level isolation
  • Document Ownership: Only you can access your uploaded circulars
  • Authentication: All endpoints require valid API tokens with appropriate scopes
  • No File Path Exposure: Internal file paths are never exposed in API responses
  • Secure Storage: Documents stored securely in S3 with access controls

Performance Considerations​

  • Processing Time: Document parsing typically takes 30-60 seconds depending on document size
  • Streaming Responses: Chat uses SSE for real-time response delivery
  • Caching: Processed documents are cached; use force_reprocess=true to re-analyze
  • Pagination: Use limit and offset parameters for large result sets
  • Concurrent Processing: Multiple documents can be processed simultaneously