Create a Praxos client instance and initialize an environment:
Copy
Ask AI
from praxos_python import SyncClient# Initialize the client with your API keyclient = SyncClient(api_key=API_KEY)# Validate your API keytry: is_valid = client.validate_api_key() print(f"API key is valid: {is_valid}")except Exception as e: print(f"API key validation failed: {e}")# Create a new environment or get an existing oneenv = client.create_environment(name="my-quickstart-environment")# Alternative: Get an existing environment# env = client.get_environment(name="my-quickstart-environment")
To learn more about the client, please review this page.
The knowledge graph requires time to index new sources. Indexing duration varies based on source size. Monitor the status before querying:
Copy
Ask AI
import time# Check status of both sourcessources = [conversation_source, data_source]for source in sources: print(f"Checking status for: {source.name}") # Wait for indexing to complete while source.get_status() != "success": status = source.get_status() print(f"Status: {status}...") if status == "failed": print("Indexing failed!") break time.sleep(2) print(f"✅ {source.name} is ready!")
More documentation about sources is available here.
Now that your data is indexed, use Praxos’s AI-powered Intelligent Search for natural language queries:
Copy
Ask AI
# Ask natural language questions about your dataresults = env.intelligent_search("What are our highest revenue customers?")print("=== Search Results ===")for hit in results["hits"]: print(f"Score: {hit['score']:.2f}") print(f"Content: {hit['sentence']}") print("---")# Access AI analysis insightsanalysis = results["intelligent_analysis"]print(f"\n=== AI Analysis ===")print(f"Query Intent: {analysis.get('intent', 'unknown')}")print(f"Strategies Used: {analysis['strategies_used']}")# Check for automatic analytical operationsif "toolset_analysis" in results: print(f"\n=== Analytical Results ===") for operation in results["toolset_analysis"]: if operation['operation'] == 'find_maximum': print(f"Highest Revenue: ${operation['max_value']:,.2f}") print(f"Customer: {operation['max_item']}")
# Ask about sales targetsresults = env.intelligent_search("What are our Q4 sales targets and current progress?")# Ask analytical questionsresults = env.intelligent_search("What's the average customer revenue by industry?")# Ask temporal questionsresults = env.intelligent_search("Show me enterprise customers with revenue above $200k")# The AI automatically:# - Understands the query intent# - Identifies relevant data types# - Selects optimal search strategies # - Performs calculations when needed
The retrieved information can be utilized to enhance LLM responses, build RAG applications, or power business intelligence dashboards for your specific use case.