Complete API reference with examples for all endpoints.
- Local Development:
http://localhost:8000 - Production:
https://stillme-backend-production.up.railway.app
Most endpoints are public. Some endpoints require API key:
- Set
X-API-Keyheader:X-API-Key: your-api-key - Or use
api_keyquery parameter:?api_key=your-api-key
- Chat & RAG APIs
- Learning APIs
- Ethical Safety APIs
- Self-Diagnosis APIs
- Validator Metrics APIs
- System & Health APIs
- Debug APIs
- Continuum Memory APIs
- SPICE Framework APIs
Chat with StillMe using RAG (Retrieval-Augmented Generation).
Request:
{
"message": "What is StillMe?",
"use_rag": true,
"context_limit": 3
}Response:
{
"response": "StillMe is a continuously self-learning AI system...",
"confidence_score": 0.85,
"sources": [
{
"content": "...",
"metadata": {"title": "...", "source": "..."}
}
],
"validation_info": {
"passed": true,
"overlap": 0.15
}
}Example (cURL):
curl -X POST http://localhost:8000/api/chat/rag \
-H "Content-Type: application/json" \
-d '{
"message": "What embedding model do you use?",
"use_rag": true
}'Example (HTTPie):
http POST :8000/api/chat/rag \
message="What is StillMe?" \
use_rag:=true \
context_limit:=3Rate Limit: 10 requests/minute
Add knowledge to RAG vector database.
Request:
{
"content": "StillMe uses ChromaDB as vector database...",
"source": "documentation",
"content_type": "knowledge",
"metadata": {
"title": "StillMe Architecture",
"tags": "architecture,vector-db"
}
}Response:
{
"status": "Knowledge added successfully",
"content_type": "knowledge"
}Example:
curl -X POST http://localhost:8000/api/rag/add_knowledge \
-H "Content-Type: application/json" \
-d '{
"content": "StillMe uses all-MiniLM-L6-v2 for embeddings",
"source": "technical-docs",
"content_type": "knowledge",
"metadata": {"title": "Embedding Model"}
}'Rate Limit: 20 requests/hour
Query RAG system directly.
Request:
{
"query": "What is RAG?",
"limit": 5
}Response:
{
"results": [
{
"content": "...",
"metadata": {...},
"distance": 0.23
}
]
}Example:
http POST :8000/api/rag/query \
query="What is StillMe?" \
limit:=5Get RAG statistics.
Response:
{
"total_documents": 1250,
"collections": ["stillme_knowledge", "stillme_conversations"],
"embedding_model": "all-MiniLM-L6-v2",
"dimensions": 384
}Example:
curl http://localhost:8000/api/rag/statsFetch content from all sources (RSS, arXiv, CrossRef, Wikipedia).
Request:
{
"max_items_per_source": 5,
"auto_add": false,
"use_pre_filter": true
}Response:
{
"entries": [
{
"title": "...",
"summary": "...",
"link": "...",
"source": "rss"
}
],
"stats": {
"rss": 5,
"arxiv": 3,
"crossref": 2,
"wikipedia": 0
}
}Example:
http POST :8000/api/learning/sources/fetch \
max_items_per_source:=5 \
auto_add:=false \
use_pre_filter:=trueRate Limit: 5 requests/hour
Get automated scheduler status.
Response:
{
"is_running": true,
"next_run": "2025-01-10T14:00:00Z",
"last_run": "2025-01-10T10:00:00Z",
"cycles_completed": 42,
"stats": {
"total_fetched": 1250,
"total_added": 850,
"total_filtered": 400
}
}Example:
curl http://localhost:8000/api/learning/scheduler/statusManually trigger a learning cycle immediately.
Request: (empty body)
Response:
{
"status": "started",
"job_id": "abc123",
"message": "Learning cycle started"
}Example:
curl -X POST http://localhost:8000/api/learning/scheduler/run-nowNote: Requires API key
Get ethical violation history.
Response:
{
"violations": [
{
"timestamp": "2025-01-10T10:30:00Z",
"content": "...",
"reason": "hate_speech",
"action": "blocked"
}
],
"total": 15,
"by_reason": {
"hate_speech": 5,
"violence": 3,
"adult_content": 7
}
}Example:
curl http://localhost:8000/api/learning/ethics/violationsGet ethical filter statistics.
Response:
{
"total_checked": 1250,
"total_blocked": 15,
"block_rate": 0.012,
"by_category": {
"hate_speech": 5,
"violence": 3,
"adult_content": 7
}
}Example:
http GET :8000/api/learning/ethics/statsTest content for ethical compliance.
Request:
{
"content": "Test content to check..."
}Response:
{
"is_safe": true,
"reasons": [],
"confidence": 0.95
}Example:
http POST :8000/api/learning/ethics/check-content \
content="This is a test message"Analyze knowledge coverage across topics.
Request:
{
"topic": "blockchain",
"depth": 3
}Response:
{
"topic": "blockchain",
"coverage_score": 0.45,
"gaps": [
{
"subtopic": "smart contracts",
"coverage": 0.2,
"priority": "high"
}
],
"suggestions": [
"Learn more about smart contracts",
"Add Ethereum documentation"
]
}Example:
curl -X POST http://localhost:8000/api/learning/self-diagnosis/analyze-coverage \
-H "Content-Type: application/json" \
-d '{
"topic": "blockchain",
"depth": 3
}'Use Case: When user asks "What knowledge is missing about [topic]?", use this endpoint.
Check knowledge gap for a specific query.
Request:
{
"query": "How does Ethereum work?"
}Response:
{
"has_gap": true,
"gap_score": 0.6,
"suggested_sources": ["ethereum.org", "docs.ethereum.org"]
}Example:
http POST :8000/api/learning/self-diagnosis/check-gap \
query="How does Ethereum work?"Suggest learning focus based on gaps.
Response:
{
"suggestions": [
{
"topic": "blockchain",
"priority": "high",
"reason": "Low coverage (0.2)"
}
]
}Example:
curl http://localhost:8000/api/learning/self-diagnosis/suggest-focusGet validation metrics.
Response:
{
"metrics": {
"total_validations": 1250,
"pass_rate": 0.92,
"passed_count": 1150,
"failed_count": 100,
"avg_overlap_score": 0.15,
"avg_confidence_score": 0.78,
"hallucination_reduction_rate": 0.08,
"fallback_usage_count": 25,
"uncertainty_expressed_count": 150
}
}Example:
curl http://localhost:8000/api/validators/metricsUse Case: Check how well validators are working, hallucination reduction rate.
Health check endpoint.
Response:
{
"status": "healthy",
"timestamp": "2025-01-10T12:00:00Z"
}Example:
curl http://localhost:8000/healthReadiness check (checks dependencies).
Response:
{
"status": "ready",
"components": {
"rag": true,
"chromadb": true,
"embedding": true
}
}Example:
curl http://localhost:8000/readySystem status with detailed information.
Response:
{
"status": "operational",
"version": "0.6.2",
"components": {
"rag": {"status": "ok"},
"chromadb": {"status": "ok"},
"embedding": {"status": "ok"}
},
"errors": []
}Example:
curl http://localhost:8000/api/statusGet model cache status.
Response:
{
"status": "success",
"cache": {
"exists": true,
"path": "/app/hf_cache",
"size_mb": 80.5,
"model_files_found": true,
"is_persistent": true,
"is_writable": true
}
}Example:
curl http://localhost:8000/api/debug/cache-statusGet model loading status.
Response:
{
"status": "success",
"model": {
"model_name": "all-MiniLM-L6-v2",
"model_loaded": true,
"embedding_dimension": 384,
"cache": {
"exists": true,
"path": "/app/hf_cache"
}
}
}Example:
http GET :8000/api/debug/model-statusGet environment variables and paths.
Response:
{
"status": "success",
"environment_variables": {
"HF_HOME": "/app/hf_cache",
"TRANSFORMERS_CACHE": "/app/hf_cache",
"SENTENCE_TRANSFORMERS_HOME": "/app/hf_cache"
},
"railway_persistent_volume": {
"path": "/app/hf_cache",
"exists": true,
"is_persistent": true
}
}Example:
curl http://localhost:8000/api/debug/environmentGet tier statistics (L0-L3).
Response:
{
"tiers": {
"L0": {"count": 100, "size_mb": 5.2},
"L1": {"count": 50, "size_mb": 2.5},
"L2": {"count": 20, "size_mb": 1.0},
"L3": {"count": 10, "size_mb": 0.5}
}
}Example:
curl http://localhost:8000/api/v1/tiers/statsPromote item to higher tier.
Example:
curl -X POST http://localhost:8000/api/v1/tiers/promote/abc123 \
-H "X-API-Key: your-key"Note: Requires API key
Run SPICE evaluation cycle.
Request:
{
"challenger_type": "ethical",
"topics": ["AI ethics", "transparency"]
}Response:
{
"status": "completed",
"results": {
"challenges_generated": 10,
"answers_validated": 8,
"score": 0.85
}
}Example:
http POST :8000/api/spice/run-cycle \
challenger_type="ethical" \
topics:='["AI ethics"]'response: Generated text responseconfidence_score: 0.0-1.0 confidence levelsources: Array of retrieved context documentsvalidation_info: Validation resultspassed: Booleanoverlap: Evidence overlap scoreused_fallback: Boolean
{
"error": "Error message",
"detail": "Detailed error information"
}- Cause: RAG system not initialized
- Solution: Wait for startup to complete, check
/readyendpoint
- Cause: Rate limit exceeded
- Solution: Wait and retry, check rate limits
- Cause: API key required but not provided
- Solution: Add
X-API-Keyheader orapi_keyquery parameter
StillMe provides interactive API documentation via Swagger UI:
- Local: http://localhost:8000/docs
- Production: https://stillme-backend-production.up.railway.app/docs
You can test all endpoints directly in the browser!
- All timestamps are in ISO 8601 format (UTC)
- All endpoints return JSON
- Rate limits are per IP address
- Some endpoints require API key (see Authentication section)
Last Updated: 2025-01-10
API Version: v0.6.2