Create three separate OpenAI assistants with access to your vector storage:
Report assistant
Summary assistant
Resource assistant
assistant = client.beta.assistants.create( name="Compliance Report Generator", instructions="You are a financial compliance expert. Analyze company data and identify potential regulatory red flags that could affect business compliance. Focus on licensing, AML/KYC, consumer protection, and cross-border regulations.", model="gpt-4-turbo-preview", tools=[{"type": "file_search"}], tool_resources={ "file_search": { "vector_store_ids": ["vs_abc123xyz"] } })print(f"Report Assistant ID: {assistant.id}")
Add to secrets as ASSISTANT_ID
assistant = client.beta.assistants.create( name="Regulatory Summary Generator", instructions="You are a regulatory compliance advisor. Provide concise summaries of financial regulations relevant to companies. Focus on jurisdiction-specific requirements, licensing needs, and key regulatory frameworks.", model="gpt-4-turbo-preview", tools=[{"type": "file_search"}], tool_resources={ "file_search": { "vector_store_ids": ["vs_abc123xyz"] } })print(f"Summary Assistant ID: {assistant.id}")
Add to secrets as SUMMARY_ASSISTANT
assistant = client.beta.assistants.create( name="Regulatory Resource Compiler", instructions="You are a regulatory documentation specialist. List relevant financial regulatory documents, laws, standards, and frameworks applicable to companies. Include specific document names, URLs when available, and brief descriptions.", model="gpt-4-turbo-preview", tools=[{"type": "file_search"}], tool_resources={ "file_search": { "vector_store_ids": ["vs_abc123xyz"] } })print(f"Resource Assistant ID: {assistant.id}")
Add to secrets as RESOURCE_ASSISTANT
All three assistants use the same vector storage ID but have different instructions optimized for their specific tasks.
IMPORTANT: Use testnet credentials ONLY. Never configure mainnet wallet secrets in the application. The code connects to s.altnet.rippletest.net:51234 which is a testnet endpoint.
Use testnet credentials only - never mainnet wallets
Rotate API keys periodically
Restrict OpenAI API key permissions if possible
Use environment variables in production
Enable Redis authentication in production
Monitor API usage and set spending limits
For team environments, use a secrets management service (AWS Secrets Manager, HashiCorp Vault, etc.) instead of committing secrets to shared locations.