API ReferenceΒΆ
Auto-generated documentation from source code docstrings.
ConfigurationΒΆ
Configuration management for Ragdoll.
Settings are resolved from four layers, highest priority first:
Environment variables (
RAGDOLL_*) Ephemeral overrides, great for CI or one-off runs. Example:RAGDOLL_CHAT_MODEL=deepseek-r1:32b ragdoll chatWorking-directory config (per-project) -
./ragdoll.tomlβ project-level settings (safe to commit) -./.envβ project-level secrets (git-ignored)User config (
~/.ragdoll/config.toml) Personal defaults shared across all projects.Package defaults (hardcoded in this file) Sensible fallbacks so ragdoll works out of the box.
This follows the same convention as git, pip, and npm: most-specific scope wins.
- class ragdoll.config.MaskedSecret(secret_value)[source]ΒΆ
Bases:
SecretStrSecretStr wrapper that masks in logs/repr while supporting equality with str for testing.
- Parameters:
secret_value (SecretType)
- class ragdoll.config.Settings(_case_sensitive=None, _nested_model_default_partial_update=None, _env_prefix=None, _env_prefix_target=None, _env_file=PosixPath('.'), _env_file_encoding=None, _env_ignore_empty=None, _env_nested_delimiter=None, _env_nested_max_split=None, _env_parse_none_str=None, _env_parse_enums=None, _cli_prog_name=None, _cli_parse_args=None, _cli_settings_source=None, _cli_parse_none_str=None, _cli_hide_none_type=None, _cli_avoid_json=None, _cli_enforce_required=None, _cli_use_class_docs_for_groups=None, _cli_show_env_vars=None, _cli_exit_on_error=None, _cli_prefix=None, _cli_flag_prefix_char=None, _cli_implicit_flags=None, _cli_ignore_unknown_args=None, _cli_kebab_case=None, _cli_shortcuts=None, _secrets_dir=None, _build_sources=None, *, jira_servers=<factory>, jira_url='https://jira.example.com', jira_user='', jira_token=MaskedSecret(''), jira_batch_size=100, jira_auth_method='pat', bitbucket_servers=<factory>, bitbucket_url='https://bitbucket.example.com', bitbucket_user='', bitbucket_token=MaskedSecret(''), bitbucket_auth_method='pat', github_servers=<factory>, github_url='https://api.github.com', github_token=MaskedSecret(''), github_default_owner='', github_repos=<factory>, confluence_servers=<factory>, confluence_url='https://confluence.example.com', confluence_user='', confluence_token=MaskedSecret(''), confluence_auth_method='pat', confluence_cookie=MaskedSecret(''), ollama_host='http://localhost:11434', embed_model='nomic-embed-text', chat_model='gemma4:12b', temperature=0.0, enable_thinking=False, num_predict=4096, data_dir=PosixPath('/home/docs/.ragdoll/data'), collection_name='ragdoll', chroma_host=None, chroma_port=8000, chroma_ssl=False, chroma_auth_token=None, chroma_tenant='default_tenant', chroma_database='default_database', chunk_size=1000, chunk_overlap=200, top_k=10)[source]ΒΆ
Bases:
BaseSettingsRagdoll configuration.
All fields map to environment variables prefixed with
RAGDOLL_. For exampleRAGDOLL_CHAT_MODELβchat_model.Precedence: env vars > ./ragdoll.toml > ./.env > ~/.ragdoll/config.toml > defaults.
- Parameters:
_case_sensitive (bool | None)
_nested_model_default_partial_update (bool | None)
_env_prefix (str | None)
_env_prefix_target (EnvPrefixTarget | None)
_env_file (DotenvType | None)
_env_file_encoding (str | None)
_env_ignore_empty (bool | None)
_env_nested_delimiter (str | None)
_env_nested_max_split (int | None)
_env_parse_none_str (str | None)
_env_parse_enums (bool | None)
_cli_prog_name (str | None)
_cli_settings_source (CliSettingsSource[Any] | None)
_cli_parse_none_str (str | None)
_cli_hide_none_type (bool | None)
_cli_avoid_json (bool | None)
_cli_enforce_required (bool | None)
_cli_use_class_docs_for_groups (bool | None)
_cli_show_env_vars (bool | None)
_cli_exit_on_error (bool | None)
_cli_prefix (str | None)
_cli_flag_prefix_char (str | None)
_cli_implicit_flags (bool | Literal['dual', 'toggle'] | None)
_cli_ignore_unknown_args (bool | None)
_cli_kebab_case (bool | Literal['all', 'no_enums'] | None)
_secrets_dir (PathType | None)
_build_sources (tuple[tuple[PydanticBaseSettingsSource, ...], dict[str, Any]] | None)
jira_url (str)
jira_user (str)
jira_token (MaskedSecret)
jira_batch_size (int)
jira_auth_method (str)
bitbucket_url (str)
bitbucket_user (str)
bitbucket_token (MaskedSecret)
bitbucket_auth_method (str)
github_url (str)
github_token (MaskedSecret)
github_default_owner (str)
confluence_url (str)
confluence_user (str)
confluence_token (MaskedSecret)
confluence_auth_method (str)
confluence_cookie (MaskedSecret)
ollama_host (str)
embed_model (str)
chat_model (str)
temperature (float)
enable_thinking (bool)
num_predict (int)
data_dir (Path)
collection_name (str)
chroma_host (str | None)
chroma_port (int)
chroma_ssl (bool)
chroma_auth_token (MaskedSecret | None)
chroma_tenant (str)
chroma_database (str)
chunk_size (int)
chunk_overlap (int)
top_k (int)
- model_config = {'arbitrary_types_allowed': True, 'case_sensitive': False, 'cli_avoid_json': False, 'cli_enforce_required': False, 'cli_exit_on_error': True, 'cli_flag_prefix_char': '-', 'cli_hide_none_type': False, 'cli_ignore_unknown_args': False, 'cli_implicit_flags': False, 'cli_kebab_case': False, 'cli_parse_args': None, 'cli_parse_none_str': None, 'cli_prefix': '', 'cli_prog_name': None, 'cli_shortcuts': None, 'cli_show_env_vars': False, 'cli_use_class_docs_for_groups': False, 'enable_decoding': True, 'env_file': '.env', 'env_file_encoding': 'utf-8', 'env_ignore_empty': False, 'env_nested_delimiter': None, 'env_nested_max_split': None, 'env_parse_enums': None, 'env_parse_none_str': None, 'env_prefix': 'RAGDOLL_', 'env_prefix_target': 'variable', 'extra': 'ignore', 'json_file': None, 'json_file_encoding': None, 'nested_model_default_partial_update': False, 'protected_namespaces': ('model_validate', 'model_dump', 'settings_customise_sources'), 'secrets_dir': None, 'toml_file': ['ragdoll.toml', '/home/docs/.ragdoll/config.toml'], 'validate_default': True, 'yaml_config_section': None, 'yaml_file': None, 'yaml_file_encoding': None}ΒΆ
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- classmethod settings_customise_sources(settings_cls, init_settings, env_settings, dotenv_settings, file_secret_settings)[source]ΒΆ
Define the 4-layer config precedence.
pydantic-settings resolves left-to-right: the first source to provide a value wins.
- jira_token: MaskedSecretΒΆ
- get_jira_config(server_name=None, project=None)[source]ΒΆ
Get the active Jira configuration.
Resolution precedence: 1. Explicit server_name in jira_servers. 2. Match by project key against jira_servers[β¦][βprojectsβ]. 3. Single server in jira_servers (if top-level token is not set). 4. βdefaultβ server in jira_servers (if present). 5. Global top-level jira_* settings.
- bitbucket_token: MaskedSecretΒΆ
- github_token: MaskedSecretΒΆ
- confluence_token: MaskedSecretΒΆ
- confluence_cookie: MaskedSecretΒΆ
- get_confluence_config(server_name=None, space=None)[source]ΒΆ
Get the active Confluence configuration.
Resolution precedence: 1. Explicit server_name in confluence_servers. 2. Match by space against confluence_servers[β¦][βspacesβ]. 3. Single server in confluence_servers (if top-level token is not set). 4. βdefaultβ server in confluence_servers (if present). 5. Global top-level confluence_* settings.
- chroma_auth_token: MaskedSecret | NoneΒΆ
CLIΒΆ
Ragdoll CLI β the main user-facing entry point.
Provides commands for ingesting data, searching, summarizing, and interacting with the local RAG system.
Usage:
ragdoll ingest pdf ./docs/
ragdoll ingest jira --jql "project = PROJ AND updated >= -30d"
ragdoll search "database query performance regression"
ragdoll summarize "connection pool known issues"
ragdoll chat
ragdoll status
IngestionΒΆ
PDFΒΆ
Incremental PDF ingestion pipeline via LlamaIndex.
Loads PDF documents, computes content hashes, checks existing ChromaDB records, bypasses unmodified files, and re-indexes modified/new PDFs.
JIRAΒΆ
JIRA ingestion pipeline via LlamaIndex.
Connects to a JIRA instance, retrieves issues using JQL, and indexes them into the vector store using a fast 2-phase scanning architecture.
- ragdoll.ingest.jira.ingest_jira(jql, server=None, max_results=None, force=False, override_url=None, override_user=None, override_token=None, override_auth_method=None)[source]ΒΆ
Ingest JIRA issues with ultra-fast 2-phase scanning and server namespacing.
- Phase 1 (Lightweight Scan):
Fast-scans JIRA using only fields=[βupdatedβ] (~0.15s per 100 issues) and diffs against stored ChromaDB timestamps.
- Phase 2 (Targeted Full Fetch):
Fetches complete issue details and full comment threads ONLY for new or modified issues.
- Phase 3 (Vector Embedding):
Embeds and indexes documents in batches via LlamaIndex and Ollama.
CodeΒΆ
Multi-language source-code ingestion module.
Recursively walks directories for source code files across multiple languages: - Python (.py) - C / C++ (.c, .h, .cpp, .cc, .cxx, .hpp, .hh, .hxx, .tcc, .cu, .cuh) - Fortran (.f, .for, .f90, .f95) - Shell Scripts (.sh, .bash, .zsh) - Templates & Build (CMakeLists.txt, .cmake, .xml, .mako, Makefile, Dockerfile) - Config & Modern Languages (.json, .yaml, .yml, .toml, .rs, .go, .js, .ts, .sql)
Extracts semantically meaningful code units (classes, functions, subroutines) or coherent chunk blocks for the RAG vector store.
- ragdoll.ingest.code.ingest_code(paths, chunk_size=None, chunk_overlap=None, extensions=None, force=False)[source]ΒΆ
Ingest source code files across supported languages with incremental file-hash caching.
- Parameters:
paths (list[Path]) β Files or directories to ingest.
chunk_size (int | None) β Custom chunk size for non-AST splitters.
chunk_overlap (int | None) β Custom overlap for non-AST splitters.
extensions (set[str] | None) β Optional whitelist of extensions to ingest (e.g. {β.pyβ, β.cppβ}).
force (bool) β If True, re-indexes all source files even if unmodified.
- Returns:
(extracted_documents, skipped_files_count).
- Return type:
LLMΒΆ
Ollama HTTP client for Ragdoll CLI status.
(Note: Generation and Embeddings are now handled natively by LlamaIndex.)
Vector StoreΒΆ
ChromaDB vector store wrapper for LlamaIndex.
Manages a local or remote ChromaDB collection for storing and querying document chunk embeddings via LlamaIndex.
- class ragdoll.store.vectordb.RagdollChromaVectorStore(chroma_collection=None, collection_name=None, host=None, port=None, ssl=False, headers=None, persist_dir=None, collection_kwargs=None, *, stores_text=True, is_embedding_query=True, flat_metadata=True)[source]ΒΆ
Enhanced ChromaVectorStore that uses collection.upsert instead of collection.add.
Default LlamaIndex ChromaVectorStore calls collection.add(), which silently ignores nodes if their ID already exists in ChromaDB. Using upsert ensures that updated issues, wiki pages, pull requests, and documentation chunks overwrite the previous record with the new text, embedding, and updated_at_ts metadata.
- Parameters:
- model_config = {'arbitrary_types_allowed': True}ΒΆ
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_post_init(context, /)ΒΆ
This function is meant to behave like a BaseModel method to initialize private attributes.
It takes context as an argument since thatβs what pydantic-core passes when calling it.
- Parameters:
self (BaseModel) β The BaseModel instance.
context (Any) β The context.
- Return type:
None
- ragdoll.store.vectordb.get_vector_store(name=None)[source]ΒΆ
Get the LlamaIndex ChromaVectorStore wrapper with upsert support.
- Parameters:
name (str | None)
- Return type:
- ragdoll.store.vectordb.get_index(name=None)[source]ΒΆ
Get the LlamaIndex VectorStoreIndex for querying and inserting.
- Parameters:
name (str | None)
- Return type:
VectorStoreIndex
QueryΒΆ
RetrieverΒΆ
Semantic retriever via LlamaIndex.
Queries the vector store and returns structured search results.
- class ragdoll.query.retriever.SearchResult(chunk_id, text, score, metadata=<factory>)[source]ΒΆ
A single search hit.
RAG ChainΒΆ
RAG chain via LlamaIndex.
This module ties together retrieval and generation into a single question-answering pipeline using LlamaIndex LLM engines.
- ragdoll.query.rag.query(question, top_k=None, source_filter=None, stream=False)[source]ΒΆ
Single-turn RAG query.
- ragdoll.query.rag.summarize(topic, top_k=None, source_filter=None, stream=False)[source]ΒΆ
Summarize context retrieved for a topic.
- ragdoll.query.rag.query_live_jira(jql)[source]ΒΆ
Execute a JQL query directly against all configured JIRA APIs.
- ragdoll.query.rag.query_live_bitbucket(project, repo, state='OPEN')[source]ΒΆ
Execute a query directly against configured Bitbucket APIs for PRs.
- ragdoll.query.rag.query_live_github(owner, repo, state='open', item_type='all')[source]ΒΆ
Execute a query directly against GitHub API for issues/PRs.