actx)Transform any file, drive, or folder into a living, real-time AI context.
AnyContext is the ultimate bridge between your local data and Artificial Intelligence. Developed with an absolute focus on privacy, modularity, and efficiency, AnyContext is a smart, autonomous Local AI Engine equipped with 3-Level Hierarchical Long-Term Memory, a High-Performance REST API Server, and a Model Context Protocol (MCP) Server.
Whether you are a developer seeking deep codebase insights, a business analyzing confidential reports, or an enterprise deploying a private RAG context layer in your VPC, AnyContext operates 100% on your infrastructure, ensuring your data never feeds third-party models without explicit permission.
actx --serve): Exposes high-performance HTTP endpoints for external web dashboards, VS Code extensions, mobile backends, and automation workflows. Features interactive Swagger UI at http://127.0.0.1:8000/docs.actx --mcp): Native JSON-RPC stdio implementation of Anthropicโs MCP specification, allowing Claude Desktop, Cursor IDE, and Antigravity to query your local knowledge base seamlessly.--host 0.0.0.0): Simple 1-command deployment for private cloud (AWS, GCP, Azure, On-Premise) serving entire corporate networks via internal VPN/VPC.README.md) into the vector database for all workspaces. Ask the AI agent how to deploy, configure, update, or useAnyContext directly in chat!Admin, Analyst, Viewer), Bearer Tokens (actx_sec_...), and Workspace-level Access Scopes.Viewer or Editor roles). Transparent folder visibility across all collaborators with strict folder ownership locking ([๐ Your Folder] vs [๐ Read-Only]).โ๏ธ SQLite Configuration Store (settings.db): Thread-safe, ACID-compliant SQLite configuration store (ConfigDBStore) serving as the single source of truth for all settings, workspaces, RBAC users, tokens, and encrypted API Key storage with password masking (sk-...****).
actx --update / /update): Non-blocking startup release notification, manual check (actx --check-update), and 1-click self-updater supporting locked Windows executables and private GitHub repositories.src/any_context/
โโโ cli/ # Terminal User Interface & Command Handling
โ โโโ banner.py # Signature ASCII Art splash screen & branding
โ โโโ chat_loop.py # Interactive chat loop & slash command intercepter
โ โโโ config_menu.py # Interactive configuration menu & onboarding wizard
โ โโโ updater.py # Self-update manager & release checker
โ โโโ workspace_selector.py # Workspace selection & CLI argument parser
โโโ config/ # Persistent SQLite Configuration System
โ โโโ app_settings.py # Pydantic schemas & settings loader
โ โโโ db_store.py # SQLite ConfigDBStore manager
โโโ core/ # LangGraph Orchestration Engine
โ โโโ agent.py # Agent graph definition & tool binding
โ โโโ utils.py # API key resolvers & prompt finders
โโโ ingestion/ # Incremental RAG Ingestion Pipeline
โ โโโ local_folder_ingestor.py # Recursive folder scanner & ChromaDB updater
โโโ memory/ # Standalone 3-Level Hierarchical Memory Engine
โ โโโ models.py # Memory schemas (SHORT_TERM, SESSION_SUMMARY, META_SUMMARY)
โ โโโ store.py # ChromaDB memory vector store wrapper
โ โโโ compressor.py # LLM-powered Level-1 & Level-3 summarization engine
โ โโโ manager.py # Asynchronous memory background thread orchestrator
โโโ server/ # External Integration Layer (REST & MCP)
โ โโโ api.py # FastAPI REST API Server & Swagger endpoints
โ โโโ mcp.py # Model Context Protocol (MCP) stdio JSON-RPC server
โโโ tools/ # Agent Dynamic Tools
โโโ search_tools.py # ChromaDB vector retriever tool (search_db)
install.ps1install.sh.\install.ps1
chmod +x install.sh
./install.sh
The installer configures your User PATH environment variable, enabling actx globally.
git clone https://github.com/Levix-Digital/any-context.git
cd any-context
pip install -e .
(Available command aliases: actx, anycontext, any-context, ac)
AnyContext supports three distinct operating modes:
actx)Launch the interactive agent directly in your console:
actx
# Specify a workspace directly:
actx -w "MyProject"
# View version:
actx -v
actx --serve)Start the FastAPI REST Server to allow external web apps, VS Code extensions, or backend services to connect:
actx --serve --port 8000 --host 127.0.0.1
# or simply:
actx server
Access interactive OpenAPI / Swagger documentation at http://127.0.0.1:8000/docs.
actx --mcp)Start AnyContext as a standard MCP server communicating over stdio JSON-RPC 2.0:
actx --mcp
claude_desktop_config.json):{
"mcpServers": {
"any-context": {
"command": "actx",
"args": ["--mcp"]
}
}
}
AnyContext is designed for effortless deployment inside an enterprise Virtual Private Cloud (VPC), AWS EC2, Google Cloud Compute Engine, Azure VM, or On-Premise Private Server.
To allow internal company applications (ERPs, CRMs, Intranets, Slack/Teams Bots, VS Code Extensions) to query AnyContext across your private network/VPN:
actx --serve --host 0.0.0.0 --port 8000
Note: Binding to
--host 0.0.0.0enables listening on all internal network interfaces within your VPC.
systemd)To ensure AnyContext runs continuously as a background service on your VPC Linux instance and restarts automatically on server reboots:
Create /etc/systemd/system/anycontext.service:
[Unit]
Description=AnyContext Universal AI Server
After=network.target
[Service]
User=ubuntu
WorkingDirectory=/home/ubuntu
ExecStart=/home/ubuntu/.local/bin/actx --serve --host 0.0.0.0 --port 8000
Restart=always
[Install]
WantedBy=multi-user.target
Enable and start the service:
sudo systemctl daemon-reload
sudo systemctl enable anycontext
sudo systemctl start anycontext
External enterprise applications specify the target department using the "workspace" JSON field in REST requests:
{
"message": "What is the policy for business travel expense reimbursement?",
"workspace": "HumanResources"
}
Supported department workspaces example: "HumanResources", "Finance", "Legal", "Engineering".
For strict SOC2 / LGPD compliance where zero data may leave the enterprise network:
actx --config to point to http://internal-llm-server:11434/v1.| Method | Endpoint | Description |
|---|---|---|
GET |
/v1/health |
Health check, version, and server security status. |
GET |
/v1/auth/status |
Check if Admin account is configured & security mode status. |
POST |
/v1/auth/setup-admin |
Initial Administrator setup wizard (first-time deployment). |
POST |
/v1/auth/login |
Authenticate user credentials and retrieve Bearer Access Token. |
GET |
/v1/users |
List all team user accounts (Admin only). |
POST |
/v1/users |
Create new team user with role and workspace scopes (Admin only). |
DELETE |
/v1/users/{user_id} |
Revoke/delete a team user account (Admin only). |
GET |
/v1/tokens |
List active Bearer security access tokens (Admin only). |
POST |
/v1/tokens |
Generate new Bearer security access token (Admin only). |
DELETE |
/v1/tokens/{token_id} |
Revoke a Bearer security access token (Admin only). |
GET |
/v1/workspaces |
List all configured workspaces and associated folder paths. |
GET |
/v1/docs/readme |
Retrieve raw application documentation (README.md) as JSON. |
POST |
/v1/chat |
Send a message to the AI agent with RAG search & session memory. |
POST |
/v1/search |
Perform raw vector search across workspace knowledge bases. |
POST |
/v1/index |
Trigger background re-indexing for a specific or all workspaces. |
POST |
/v1/reset-memory |
Purge long-term vector memory for a workspace or globally. |
POST |
/v1/factory-reset |
Wipe all settings, API keys, users, workspaces, and databases (Factory Reset). |
curl)POST /v1/chat)curl -X POST "http://127.0.0.1:8000/v1/chat" \
-H "Content-Type: application/json" \
-d '{
"message": "What were the security requirements discussed in the project specs?",
"workspace": "MyProject"
}'
POST /v1/search)curl -X POST "http://127.0.0.1:8000/v1/search" \
-H "Content-Type: application/json" \
-d '{
"query": "authentication bearer tokens",
"workspace": "MyProject"
}'
POST /v1/index)curl -X POST "http://127.0.0.1:8000/v1/index" \
-H "Content-Type: application/json" \
-d '{ "workspace": "MyProject" }'
/switch: Interactively switch active workspace with instant vector DB resync./version (or /v): Display AnyContext version information./update: Check for and install the latest release automatically./check-update: Check if a newer version is available./reset-memory (or /reset): Purge long-term vector memories for the active workspace./factory-reset: Wipe all workspaces, API keys, settings, and vector databases (Factory Reset)./config: Open the interactive configuration menu (Workspaces, AI Models, API Keys)./help: Display detailed in-app command instructions and tips.Ctrl+C: Gracefully exit while triggering a background memory summary.AnyContext stores configurations and API keys securely in config/settings.db (SQLite). Manage settings interactively using actx --config or /config during chat:
sk-...****). Supported providers: OpenAI, OpenRouter, Anthropic, Gemini, DeepSeek, Groq.gpt-4o-mini + text-embedding-3-small.http://localhost:1234/v1).To completely uninstall AnyContext (actx) and clean PATH variables:
uninstall.ps1 (Windows) or uninstall.sh (Linux / Git Bash) from Latest Release Assets..\uninstall.ps1
chmod +x uninstall.sh
./uninstall.sh
Built with โ and โค๏ธ by Levix Digital to transform document chaos into your personal AI assistant.