Skip to content
SolidRusT.ai

Agent Chat

The Agent Chat endpoint provides an AI assistant that can autonomously use tools to search the knowledge base, recall past conversations, and store facts for future use.

POST https://api.solidrust.ai/v1/agent/chat
ParameterTypeRequiredDefaultDescription
messagestring✅ YesThe user’s message
system_promptstringNoCustom system prompt to guide behavior
historyobject[]NoPrevious conversation turns
temperaturenumberNo0.7Sampling temperature (0.0–2.0)
max_tokensintegerNo1024Maximum response tokens

Each history entry has role (user or assistant) and content:

{
"history": [
{"role": "user", "content": "What is semantic search?"},
{"role": "assistant", "content": "Semantic search finds documents by meaning..."}
]
}
Terminal window
curl -X POST "https://api.solidrust.ai/v1/agent/chat" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"message": "How do I implement RAG with Python?",
"temperature": 0.3,
"max_tokens": 1024
}'
import requests
API_KEY = "YOUR_API_KEY"
BASE_URL = "https://api.solidrust.ai"
def agent_chat(
message: str,
history: list[dict] | None = None,
system_prompt: str | None = None,
temperature: float = 0.7,
max_tokens: int = 1024,
) -> dict:
"""Chat with the tool-enabled agent."""
payload = {
"message": message,
"temperature": temperature,
"max_tokens": max_tokens,
}
if history:
payload["history"] = history
if system_prompt:
payload["system_prompt"] = system_prompt
response = requests.post(
f"{BASE_URL}/v1/agent/chat",
headers={
"Authorization": f"Bearer {API_KEY}",
"Content-Type": "application/json",
},
json=payload,
)
return response.json()
result = agent_chat("How do I implement RAG with Python?")
if result["success"]:
print(f"Agent: {result['response']}")
if result.get("tool_calls"):
print("\nTools used:")
for call in result["tool_calls"]:
print(f" - {call['tool']}")
else:
print(f"Error: {result.get('error')}")
async function agentChat(message, options = {}) {
const payload = {
message,
temperature: options.temperature ?? 0.7,
max_tokens: options.maxTokens ?? 1024,
};
if (options.history) payload.history = options.history;
if (options.systemPrompt) payload.system_prompt = options.systemPrompt;
const res = await fetch(`${BASE_URL}/v1/agent/chat`, {
method: 'POST',
headers: { Authorization: `Bearer ${API_KEY}`, 'Content-Type': 'application/json' },
body: JSON.stringify(payload),
});
return res.json();
}
{
"success": true,
"response": "To implement RAG with Python, you can use the SolidRusT AI API. First, search the knowledge base with hybrid search, then pass the results as context to the chat completions endpoint...",
"tool_calls": [
{
"tool": "HybridSearchTool",
"arguments": {"query": "Python RAG implementation", "limit": 5},
"result": {"total": 3, "results": [...]}
},
{
"tool": "KnowledgeGraphTool",
"arguments": {"entity": "RAG", "depth": 1},
"result": {"entities": [...], "relationships": [...]}
}
]
}

Maintain context by passing previous turns:

conversation = []
def chat_with_history(message: str, system_prompt: str = None) -> str:
result = agent_chat(
message=message,
history=conversation,
system_prompt=system_prompt,
)
if result["success"]:
conversation.append({"role": "user", "content": message})
conversation.append({"role": "assistant", "content": result["response"]})
return result["response"]
return f"Error: {result.get('error')}"
# Multi-turn
print(chat_with_history("What is semantic search?"))
print(chat_with_history("How is it different from keyword search?"))
print(chat_with_history("Show me a code example"))
system_prompt = """
You are a knowledgeable API documentation assistant.
Always cite sources from the knowledge base.
Provide code examples in Python when possible.
Keep responses concise and developer-friendly.
If you don't know, say so honestly.
"""
result = agent_chat(
message="How do I authenticate API requests?",
system_prompt=system_prompt,
temperature=0.3,
)

The agent has access to these built-in tools:

ToolDescription
SemanticSearchToolVector similarity search across the knowledge base
KnowledgeGraphToolEntity relationship queries in Neo4j
HybridSearchToolCombined semantic + graph search with entity extraction
MemorySearchToolSearch companion memory (vector + keyword + graph + KB)
MemoryStoreToolStore important facts for future recall
MemoryStatsToolCheck memory system health and population

See Agent Tools for complete tool schemas and parameters.

GET /v1/agent/health
Terminal window
curl "https://api.solidrust.ai/v1/agent/health" \
-H "Authorization: Bearer YOUR_API_KEY"
StatusMeaning
healthyAll providers reachable
degradedOne provider down, fallback active
unhealthyNo providers available
StatusCodeDescription
400invalid_requestMissing or invalid parameters
401INVALID_API_KEYMissing or invalid API key
429RATE_LIMIT_EXCEEDEDToo many requests
503service_unavailableNo LLM provider available
ApproachBest ForControl
Agent ChatUsers who want automatic tool selectionAgent decides which search strategy to use
Direct RAGDevelopers building custom pipelinesYou control search parameters and strategy